From d795aeb0ec73f1123d778b1c9e90762e5474b263 Mon Sep 17 00:00:00 2001 From: Tunglies <77394545+Tunglies@users.noreply.github.com> Date: Wed, 2 Dec 2026 02:00:48 +0800 Subject: [PATCH] fix(installer): align NSIS locale variables with Tauri 2.13 --- src-tauri/packages/windows/installer.nsi | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src-tauri/packages/windows/installer.nsi b/src-tauri/packages/windows/installer.nsi index d40880023..beb12d4ad 100644 --- a/src-tauri/packages/windows/installer.nsi +++ b/src-tauri/packages/windows/installer.nsi @@ -81,6 +81,9 @@ Var VC_RUNTIME_NEEDED Var ServiceExisted Var ServiceStartType Var ServiceWasRunning +Var ExistingVersionKind +Var Webview2DownloadResult +Var Webview2InstallExitCode Name "${PRODUCTNAME}" BrandingText "${COPYRIGHT}" @@ -214,13 +217,13 @@ Function PageReinstall ; Compare this installar version with the existing installation ; and modify the messages presented to the user accordingly compare_version: - StrCpy $R4 "$(older)" + StrCpy $ExistingVersionKind "$(older)" ${If} $WixMode = 1 ReadRegStr $R0 HKLM "$R6" "DisplayVersion" ${Else} ReadRegStr $R0 SHCTX "${UNINSTKEY}" "DisplayVersion" ${EndIf} - ${IfThen} $R0 == "" ${|} StrCpy $R4 "$(unknown)" ${|} + ${IfThen} $R0 == "" ${|} StrCpy $ExistingVersionKind "$(unknown)" ${|} nsis_tauri_utils::SemverCompare "${VERSION}" $R0 Pop $R0 @@ -895,8 +898,8 @@ Section WebView2 Delete "$TEMP\MicrosoftEdgeWebview2Setup.exe" DetailPrint "$(webview2Downloading)" NSISdl::download "https://go.microsoft.com/fwlink/p/?LinkId=2124703" "$TEMP\MicrosoftEdgeWebview2Setup.exe" - Pop $0 - ${If} $0 == "success" + Pop $Webview2DownloadResult + ${If} $Webview2DownloadResult == "success" DetailPrint "$(webview2DownloadSuccess)" ${Else} DetailPrint "$(webview2DownloadError)" @@ -927,8 +930,8 @@ Section WebView2 install_webview2: DetailPrint "$(installingWebview2)" ; $6 holds the path to the webview2 installer - ExecWait "$6 ${WEBVIEW2INSTALLERARGS} /install" $1 - ${If} $1 = 0 + ExecWait "$6 ${WEBVIEW2INSTALLERARGS} /install" $Webview2InstallExitCode + ${If} $Webview2InstallExitCode = 0 DetailPrint "$(webview2InstallSuccess)" ${Else} DetailPrint "$(webview2InstallError)" @@ -953,8 +956,8 @@ Section WebView2 ${If} $R1 != "" ; Chromium updater docs: https://source.chromium.org/chromium/chromium/src/+/main:docs/updater/user_manual.md ; Modified from "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft EdgeWebView\ModifyPath" - ExecWait `"$R1" /install appguid=${WEBVIEW2APPGUID}&needsadmin=true` $1 - ${If} $1 = 0 + ExecWait `"$R1" /install appguid=${WEBVIEW2APPGUID}&needsadmin=true` $Webview2InstallExitCode + ${If} $Webview2InstallExitCode = 0 DetailPrint "$(webview2InstallSuccess)" ${Else} MessageBox MB_ICONEXCLAMATION|MB_ABORTRETRYIGNORE "$(webview2InstallError)" IDIGNORE ignore IDRETRY update_webview