Skip to content

Commit 9926a24

Browse files
committed
fix: improve Vayu process detection in installer script to handle locale variations
1 parent fc391a9 commit 9926a24

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

app/installer/installer.nsh

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,16 @@
1919
!macro customInit
2020
; Check if Vayu is running
2121
nsExec::ExecToStack 'tasklist /FI "IMAGENAME eq Vayu.exe" /NH'
22-
Pop $0
23-
Pop $1
22+
Pop $0 ; Exit code
23+
Pop $1 ; Output
2424

25-
; Check if the output contains "Vayu.exe" (means it's running)
26-
${If} $1 != ""
27-
${AndIf} $1 != "INFO: No tasks are running which match the specified criteria."
25+
; Check if the output actually contains "Vayu.exe" (means it's running)
26+
; When tasklist finds the process, output starts with "Vayu.exe"
27+
; When not found, output is empty or contains "INFO: No tasks..."
28+
; We check if output starts with "Vayu.exe" (first 8 chars) to avoid locale issues
29+
StrCpy $2 $1 8 ; Extract first 8 characters
30+
${If} $2 == "Vayu.exe"
31+
; Vayu.exe is running
2832
MessageBox MB_OKCANCEL|MB_ICONINFORMATION \
2933
"Vayu is currently running.$\n$\nClick OK to close it and continue installation, or Cancel to abort." \
3034
IDOK closeApp IDCANCEL abortInstall

0 commit comments

Comments
 (0)