Skip to content

Commit

Permalink
fix(bundler/nsis): use temp dir for webview2 installer, closes #7409 (#…
Browse files Browse the repository at this point in the history
…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>
  • Loading branch information
jetli and amrbashir authored Jul 25, 2023
1 parent 2d35f93 commit 57f73f1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .changes/fix-nsis-webview2-installer-use-tempdir.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'tauri-bundler': 'patch:enhance'
---

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.
12 changes: 6 additions & 6 deletions tooling/bundler/src/bundle/windows/templates/installer.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -456,18 +456,18 @@ Section WebView2
!endif

!if "${INSTALLWEBVIEW2MODE}" == "embedBootstrapper"
CreateDirectory "$INSTDIR\redist"
File "/oname=$INSTDIR\redist\MicrosoftEdgeWebview2Setup.exe" "${WEBVIEW2BOOTSTRAPPERPATH}"
Delete "$TEMP\MicrosoftEdgeWebview2Setup.exe"
File "/oname=$TEMP\MicrosoftEdgeWebview2Setup.exe" "${WEBVIEW2BOOTSTRAPPERPATH}"
DetailPrint "$(installingWebview2)"
StrCpy $6 "$INSTDIR\redist\MicrosoftEdgeWebview2Setup.exe"
StrCpy $6 "$TEMP\MicrosoftEdgeWebview2Setup.exe"
Goto install_webview2
!endif

!if "${INSTALLWEBVIEW2MODE}" == "offlineInstaller"
CreateDirectory "$INSTDIR\redist"
File "/oname=$INSTDIR\redist\MicrosoftEdgeWebView2RuntimeInstaller.exe" "${WEBVIEW2INSTALLERPATH}"
Delete "$TEMP\MicrosoftEdgeWebView2RuntimeInstaller.exe"
File "/oname=$TEMP\MicrosoftEdgeWebView2RuntimeInstaller.exe" "${WEBVIEW2INSTALLERPATH}"
DetailPrint "$(installingWebview2)"
StrCpy $6 "$INSTDIR\redist\MicrosoftEdgeWebView2RuntimeInstaller.exe"
StrCpy $6 "$TEMP\MicrosoftEdgeWebView2RuntimeInstaller.exe"
Goto install_webview2
!endif

Expand Down

0 comments on commit 57f73f1

Please sign in to comment.