mirror of
				https://github.com/hyperion-project/hyperion.ng.git
				synced 2025-03-01 10:33:28 +00:00 
			
		
		
		
	[Windows] Installer/Uninstaller notification when Hyperion is running. (#1033)
This commit is contained in:
		
							
								
								
									
										8
									
								
								.github/workflows/pull-request.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										8
									
								
								.github/workflows/pull-request.yml
									
									
									
									
										vendored
									
									
								
							| @@ -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 | ||||
|   | ||||
							
								
								
									
										6
									
								
								.github/workflows/push-master.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										6
									
								
								.github/workflows/push-master.yml
									
									
									
									
										vendored
									
									
								
							| @@ -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 | ||||
|   | ||||
							
								
								
									
										
											BIN
										
									
								
								cmake/nsis/template/FindProcDLL.dll
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								cmake/nsis/template/FindProcDLL.dll
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| @@ -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" | ||||
|   | ||||
| @@ -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")); | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user