[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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 40 additions and 23 deletions

View File

@ -149,8 +149,10 @@ jobs:
with:
python-version: '3.x'
- name: Install NSIS
run: choco install --no-progress nsis -y
- name: Install NSIS & copy plugins
run: |
choco install --no-progress nsis -y
copy "cmake\nsis\template\*.dll" "C:\Program Files (x86)\NSIS\Plugins\x86-ansi\"
- name: Install OpenSSL
run: choco install --no-progress openssl -y
@ -171,7 +173,7 @@ jobs:
shell: bash
run: |
mkdir -p windows
mv build/*.zip windows
mv build/*.exe windows
# Upload artifacts
- name: Upload artifacts

View File

@ -113,8 +113,10 @@ jobs:
with:
python-version: '3.x'
- name: Install NSIS
run: choco install --no-progress nsis -y
- name: Install NSIS & copy plugins
run: |
choco install --no-progress nsis -y
copy "cmake\nsis\template\*.dll" "C:\Program Files (x86)\NSIS\Plugins\x86-ansi\"
- name: Install OpenSSL
run: choco install --no-progress openssl -y

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"

View File

@ -14,21 +14,5 @@ void CreateConsole()
freopen_s(&fDummy, "CONOUT$", "w", stdout);
freopen_s(&fDummy, "CONOUT$", "w", stderr);
freopen_s(&fDummy, "CONIN$", "r", stdin);
//std::cout.clear();
//std::clog.clear();
//std::cerr.clear();
//std::cin.clear();
/*// std::wcout, std::wclog, std::wcerr, std::wcin
HANDLE hConOut = CreateFile(_T("CONOUT$"), GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
HANDLE hConIn = CreateFile(_T("CONIN$"), GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
SetStdHandle(STD_OUTPUT_HANDLE, hConOut);
SetStdHandle(STD_ERROR_HANDLE, hConOut);
SetStdHandle(STD_INPUT_HANDLE, hConIn);
std::wcout.clear();
std::wclog.clear();
std::wcerr.clear();
std::wcin.clear();
*/
SetConsoleTitle(TEXT("Hyperion"));
}