Skip to content

Commit 8caa03a

Browse files
ci(webview2): bundle WebView2Loader.dll in CI and package
- CI never copied the loader DLL from the NuGet runtime dir, causing runtime failures on machines without Edge installed - Packaging step must include the loader so the app is self-contained - User-data directory must exist before CreateEnvironment is called; mkpath ensures the path is created eagerly rather than relying on WebView2 to create it (which it does not always do)
1 parent 053265f commit 8caa03a

3 files changed

Lines changed: 6 additions & 0 deletions

File tree

‎.github/workflows/build.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ jobs:
6565
unzip -q -o webview2.nupkg -d webview2-sdk
6666
cp webview2-sdk/build/native/include/WebView2.h thirdparty/webview2/include/WebView2.h
6767
cp webview2-sdk/build/native/include/WebView2EnvironmentOptions.h thirdparty/webview2/include/WebView2EnvironmentOptions.h
68+
cp webview2-sdk/runtimes/win-x64/native/WebView2Loader.dll deploy/windows/WebView2Loader.dll
6869
6970
- name: Setup Linux
7071
if: runner.os == 'Linux'

‎cmake/PackagingWindows.cmake‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ add_custom_target(package
4848
"${CMAKE_SOURCE_DIR}/deploy/windows/libssl-1_1-x64.dll"
4949
"${PACKAGE_DIR}/libssl-1_1-x64.dll"
5050

51+
COMMAND ${CMAKE_COMMAND} -E copy_if_different
52+
"${CMAKE_SOURCE_DIR}/deploy/windows/WebView2Loader.dll"
53+
"${PACKAGE_DIR}/WebView2Loader.dll"
54+
5155
# Run windeployqt with correct flags
5256
COMMAND windeployqt ${WINDEPLOYQT_ARGS}
5357
)

‎src/widgets/WebViewWidget_win.cpp‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ class WebViewWidgetWin : public WebViewWidget
165165
const QString appData = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation);
166166
m_dbgUserDataFolder = QDir::toNativeSeparators(
167167
appData + QStringLiteral("/MiniApps/") + appId());
168+
QDir().mkpath(m_dbgUserDataFolder);
168169

169170
auto createEnv = resolveCreateEnvironment();
170171
m_dbgLoaderResolved = (createEnv != nullptr);

0 commit comments

Comments
 (0)