diff --git a/.changes/bundler-nsis-process-current-user.md b/.changes/bundler-nsis-process-current-user.md new file mode 100644 index 000000000000..3029fdc4fe39 --- /dev/null +++ b/.changes/bundler-nsis-process-current-user.md @@ -0,0 +1,5 @@ +--- +'tauri-bundler': 'patch:bug' +--- + +NSIS perUser installers will now only check if the app is running on the current user. \ No newline at end of file diff --git a/tooling/bundler/src/bundle/windows/nsis.rs b/tooling/bundler/src/bundle/windows/nsis.rs index 13299d6b8bad..86515081a538 100644 --- a/tooling/bundler/src/bundle/windows/nsis.rs +++ b/tooling/bundler/src/bundle/windows/nsis.rs @@ -37,8 +37,8 @@ const NSIS_URL: &str = const NSIS_SHA1: &str = "057e83c7d82462ec394af76c87d06733605543d4"; const NSIS_APPLICATIONID_URL: &str = "https://github.com/tauri-apps/binary-releases/releases/download/nsis-plugins-v0/NSIS-ApplicationID.zip"; const NSIS_TAURI_UTILS: &str = - "https://github.com/tauri-apps/nsis-tauri-utils/releases/download/nsis_tauri_utils-v0.2.1/nsis_tauri_utils.dll"; -const NSIS_TAURI_UTILS_SHA1: &str = "53A7CFAEB6A4A9653D6D5FBFF02A3C3B8720130A"; + "https://github.com/tauri-apps/nsis-tauri-utils/releases/download/nsis_tauri_utils-v0.2.2/nsis_tauri_utils.dll"; +const NSIS_TAURI_UTILS_SHA1: &str = "16DF1D1A5B4D5DF3859447279C55BE36D4109DFB"; #[cfg(target_os = "windows")] const NSIS_REQUIRED_FILES: &[&str] = &[ diff --git a/tooling/bundler/src/bundle/windows/templates/installer.nsi b/tooling/bundler/src/bundle/windows/templates/installer.nsi index ddbd31ca959e..05aecc5dbd63 100644 --- a/tooling/bundler/src/bundle/windows/templates/installer.nsi +++ b/tooling/bundler/src/bundle/windows/templates/installer.nsi @@ -493,13 +493,21 @@ Section WebView2 SectionEnd !macro CheckIfAppIsRunning - nsis_tauri_utils::FindProcess "${MAINBINARYNAME}.exe" + !if "${INSTALLMODE}" == "currentUser" + nsis_tauri_utils::FindProcessCurrentUser "${MAINBINARYNAME}.exe" + !else + nsis_tauri_utils::FindProcess "${MAINBINARYNAME}.exe" + !endif Pop $R0 ${If} $R0 = 0 IfSilent kill 0 ${IfThen} $PassiveMode != 1 ${|} MessageBox MB_OKCANCEL "$(appRunningOkKill)" IDOK kill IDCANCEL cancel ${|} kill: - nsis_tauri_utils::KillProcess "${MAINBINARYNAME}.exe" + !if "${INSTALLMODE}" == "currentUser" + nsis_tauri_utils::KillProcessCurrentUser "${MAINBINARYNAME}.exe" + !else + nsis_tauri_utils::KillProcess "${MAINBINARYNAME}.exe" + !endif Pop $R0 Sleep 500 ${If} $R0 = 0