[Windows] Installer/Uninstaller notification when Hyperion is running. (#1033)

This commit is contained in:
Paulchen Panther
2020-10-18 17:19:35 +02:00
committed by GitHub
parent 02d0ab68f6
commit 84607b4063
5 changed files with 40 additions and 23 deletions

Binary file not shown.

View File

@@ -384,7 +384,7 @@ Function un.RemoveFromPath
FunctionEnd
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Uninstall sutff
; Uninstall stuff
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
###########################################
@@ -810,6 +810,15 @@ FunctionEnd
;--------------------------------
; determine admin versus local install
Function un.onInit
; Check if Hyperion is running
loopIsRunningCheck:
FindProcDLL::FindProc "hyperiond.exe"
IntCmp $R0 1 0 notRunning
MessageBox MB_RETRYCANCEL|MB_ICONEXCLAMATION "Hyperion is running.$\n$\nClose it and press Retry, or press Cancel to exit." IDRETRY loopIsRunningCheck IDCANCEL abortnow
abortnow:
Abort
notRunning:
ClearErrors
UserInfo::GetName
@@ -873,6 +882,16 @@ FunctionEnd
;Uninstaller Section
Section "Uninstall"
; Check if Hyperion is running
loopIsRunningCheck:
FindProcDLL::FindProc "hyperiond.exe"
IntCmp $R0 1 0 notRunning
MessageBox MB_RETRYCANCEL|MB_ICONEXCLAMATION "Hyperion is running.$\n$\nClose it and press Retry, or press Cancel to exit." IDRETRY loopIsRunningCheck IDCANCEL abortnow
abortnow:
Abort
notRunning:
ReadRegStr $START_MENU SHCTX \
"Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@" "StartMenu"
;MessageBox MB_OK "Start menu is in: $START_MENU"
@@ -970,6 +989,16 @@ SectionEnd
; "Program Files" for AllUsers, "My Documents" for JustMe...
Function .onInit
; Check if Hyperion is running
loopIsRunningCheck:
FindProcDLL::FindProc "hyperiond.exe"
IntCmp $R0 1 0 notRunning
MessageBox MB_RETRYCANCEL|MB_ICONEXCLAMATION "Hyperion is running.$\n$\nClose it and press Retry, or press Cancel to exit." IDRETRY loopIsRunningCheck IDCANCEL abortnow
abortnow:
Abort
notRunning:
StrCmp "@CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL@" "ON" 0 inst
ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@" "UninstallString"