Skip to content

Commit 57f73f1

Browse files
jetliamrbashir
andauthored
fix(bundler/nsis): use temp dir for webview2 installer, closes #7409 (#7486)
* fix(bundler/nsis): use temp dir for webview2 installer, closes #7409 * Update .changes/fix-nsis-webview2-installer-use-tempdir.md --------- Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com>
1 parent 2d35f93 commit 57f73f1

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'tauri-bundler': 'patch:enhance'
3+
---
4+
5+
On Windows, NSIS installer will write webview2 installer file to the well-known temp dir instead of the install dir, so we don't pollute the install dir.

tooling/bundler/src/bundle/windows/templates/installer.nsi

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -456,18 +456,18 @@ Section WebView2
456456
!endif
457457

458458
!if "${INSTALLWEBVIEW2MODE}" == "embedBootstrapper"
459-
CreateDirectory "$INSTDIR\redist"
460-
File "/oname=$INSTDIR\redist\MicrosoftEdgeWebview2Setup.exe" "${WEBVIEW2BOOTSTRAPPERPATH}"
459+
Delete "$TEMP\MicrosoftEdgeWebview2Setup.exe"
460+
File "/oname=$TEMP\MicrosoftEdgeWebview2Setup.exe" "${WEBVIEW2BOOTSTRAPPERPATH}"
461461
DetailPrint "$(installingWebview2)"
462-
StrCpy $6 "$INSTDIR\redist\MicrosoftEdgeWebview2Setup.exe"
462+
StrCpy $6 "$TEMP\MicrosoftEdgeWebview2Setup.exe"
463463
Goto install_webview2
464464
!endif
465465

466466
!if "${INSTALLWEBVIEW2MODE}" == "offlineInstaller"
467-
CreateDirectory "$INSTDIR\redist"
468-
File "/oname=$INSTDIR\redist\MicrosoftEdgeWebView2RuntimeInstaller.exe" "${WEBVIEW2INSTALLERPATH}"
467+
Delete "$TEMP\MicrosoftEdgeWebView2RuntimeInstaller.exe"
468+
File "/oname=$TEMP\MicrosoftEdgeWebView2RuntimeInstaller.exe" "${WEBVIEW2INSTALLERPATH}"
469469
DetailPrint "$(installingWebview2)"
470-
StrCpy $6 "$INSTDIR\redist\MicrosoftEdgeWebView2RuntimeInstaller.exe"
470+
StrCpy $6 "$TEMP\MicrosoftEdgeWebView2RuntimeInstaller.exe"
471471
Goto install_webview2
472472
!endif
473473

0 commit comments

Comments
 (0)