use nsProcess to check if process is running

This commit is contained in:
Stephen Birarda 2016-01-18 16:15:31 -08:00
parent e2ee3da9d1
commit 96c3adaa19

View file

@ -984,21 +984,22 @@ Function HandlePostInstallOptions
FunctionEnd FunctionEnd
!include nsProcess.nsh
!macro PromptForRunningApplication applicationName displayName !macro PromptForRunningApplication applicationName displayName
FindProcDLL::FindProc ${applicationName} ${nsProcess::FindProcess} ${applicationName} $R0
${If} $R0 == 1 ${If} $R0 == 0
MessageBox MB_OK|MB_ICONEXCLAMATION "The High Fidelity ${displayName} is running. Please close it first." /SD IDOK MessageBox MB_OK|MB_ICONEXCLAMATION "The High Fidelity ${displayName} is running. Please close it first." /SD IDOK
Abort Abort
${EndIf} ${EndIf}
!macroend !macroend
!macro CheckForRunningApplications !macro CheckForRunningApplications
!insertmacro PromptForRunningApplication "$INSTDIR\@INTERFACE_WIN_EXEC_NAME@" "Client" !insertmacro PromptForRunningApplication "@INTERFACE_WIN_EXEC_NAME@" "Client"
!insertmacro PromptForRunningApplication "$INSTDIR\@CONSOLE_WIN_EXEC_NAME@" "@CONSOLE_SHORTCUT_NAME@" !insertmacro PromptForRunningApplication "@CONSOLE_WIN_EXEC_NAME@" "@CONSOLE_SHORTCUT_NAME@"
!insertmacro PromptForRunningApplication "$INSTDIR\@DS_EXEC_NAME@" "domain-server" !insertmacro PromptForRunningApplication "@DS_EXEC_NAME@" "domain-server"
!insertmacro PromptForRunningApplication "$INSTDIR\@AC_EXEC_NAME@" "assignment-client" !insertmacro PromptForRunningApplication "@AC_EXEC_NAME@" "assignment-client"
!macroend !macroend
;-------------------------------- ;--------------------------------