Skip to content

Commit 5ff9d45

Browse files
amr-crabnebulaFabianLars-crabnebulaamrbashir
authored
fix(bundler/nsis): only kill processes of current user (#8390)
* fix(bundler/nsis): only kill processes of current user Co-authored-by: FabianLars-crabnebula <fabianlars@crabnebula.dev> * change file --------- Co-authored-by: FabianLars-crabnebula <fabianlars@crabnebula.dev> Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com>
1 parent 30adc8d commit 5ff9d45

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
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:bug'
3+
---
4+
5+
NSIS perUser installers will now only check if the app is running on the current user.

tooling/bundler/src/bundle/windows/nsis.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ const NSIS_URL: &str =
3737
const NSIS_SHA1: &str = "057e83c7d82462ec394af76c87d06733605543d4";
3838
const NSIS_APPLICATIONID_URL: &str = "https://github.com/tauri-apps/binary-releases/releases/download/nsis-plugins-v0/NSIS-ApplicationID.zip";
3939
const NSIS_TAURI_UTILS: &str =
40-
"https://github.com/tauri-apps/nsis-tauri-utils/releases/download/nsis_tauri_utils-v0.2.1/nsis_tauri_utils.dll";
41-
const NSIS_TAURI_UTILS_SHA1: &str = "53A7CFAEB6A4A9653D6D5FBFF02A3C3B8720130A";
40+
"https://github.com/tauri-apps/nsis-tauri-utils/releases/download/nsis_tauri_utils-v0.2.2/nsis_tauri_utils.dll";
41+
const NSIS_TAURI_UTILS_SHA1: &str = "16DF1D1A5B4D5DF3859447279C55BE36D4109DFB";
4242

4343
#[cfg(target_os = "windows")]
4444
const NSIS_REQUIRED_FILES: &[&str] = &[

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -493,13 +493,21 @@ Section WebView2
493493
SectionEnd
494494

495495
!macro CheckIfAppIsRunning
496-
nsis_tauri_utils::FindProcess "${MAINBINARYNAME}.exe"
496+
!if "${INSTALLMODE}" == "currentUser"
497+
nsis_tauri_utils::FindProcessCurrentUser "${MAINBINARYNAME}.exe"
498+
!else
499+
nsis_tauri_utils::FindProcess "${MAINBINARYNAME}.exe"
500+
!endif
497501
Pop $R0
498502
${If} $R0 = 0
499503
IfSilent kill 0
500504
${IfThen} $PassiveMode != 1 ${|} MessageBox MB_OKCANCEL "$(appRunningOkKill)" IDOK kill IDCANCEL cancel ${|}
501505
kill:
502-
nsis_tauri_utils::KillProcess "${MAINBINARYNAME}.exe"
506+
!if "${INSTALLMODE}" == "currentUser"
507+
nsis_tauri_utils::KillProcessCurrentUser "${MAINBINARYNAME}.exe"
508+
!else
509+
nsis_tauri_utils::KillProcess "${MAINBINARYNAME}.exe"
510+
!endif
503511
Pop $R0
504512
Sleep 500
505513
${If} $R0 = 0

0 commit comments

Comments
 (0)