Skip to content

Commit

Permalink
fix(nsis) detect partially killed processes.
Browse files Browse the repository at this point in the history
Change to not relying on taskkill's return value.
taskkill returns 0 when at least one process is killed even if there are
any other process not killed.
  • Loading branch information
I-Otsuki committed Dec 4, 2021
1 parent c469156 commit 00fb5d2
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,12 @@
Sleep 1000
!ifdef INSTALL_MODE_PER_ALL_USERS
nsExec::Exec `taskkill /f /im "${APP_EXECUTABLE_FILENAME}" /fi "PID ne $pid"`
Pop $R0
!else
nsExec::Exec `cmd /c taskkill /f /im "${APP_EXECUTABLE_FILENAME}" /fi "PID ne $pid" /fi "USERNAME eq %USERNAME%"`
Pop $R0
!endif
${If} $R0 != 0
DetailPrint `Waiting for "${PRODUCT_NAME}" to close (taskkill exit code $R0).`
!insertmacro FIND_PROCESS "${APP_EXECUTABLE_FILENAME}" $R0
${If} $R0 == 0
DetailPrint `Waiting for "${PRODUCT_NAME}" to close.`
Sleep 2000
${else}
Goto not_running
Expand Down

0 comments on commit 00fb5d2

Please sign in to comment.