Skip to content

Commit

Permalink
fix(nsis): ensure that installer process is not killed as child process
Browse files Browse the repository at this point in the history
  • Loading branch information
develar committed Mar 7, 2018
1 parent e23cecb commit e0d0ff0
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@
launch:
!macroend

Var pid

!macro CHECK_APP_RUNNING
${GetProcessInfo} 0 $0 $1 $2 $3 $4
${GetProcessInfo} 0 $pid $1 $2 $3 $4
${if} $3 != "${APP_EXECUTABLE_FILENAME}"
nsProcess::_FindProcess /NOUNLOAD "${APP_EXECUTABLE_FILENAME}"
Pop $R0
Expand All @@ -38,7 +40,7 @@
Quit
doStopProcess:
DetailPrint 'Closing running "${PRODUCT_NAME}"...'
ExecWait 'taskkill /f /t /im "${APP_EXECUTABLE_FILENAME}"' $R0
ExecWait 'taskkill /f /t /im "${APP_EXECUTABLE_FILENAME}" /fi "PID ne $pid"' $R0
${If} $R0 == 0
# to ensure that files are not "in-use"
Sleep 100
Expand Down

0 comments on commit e0d0ff0

Please sign in to comment.