|
| 1 | +!include "MUI2.nsh" |
| 2 | + |
| 3 | +!ifndef VERSION |
| 4 | + !define VERSION "dev" |
| 5 | +!endif |
| 6 | + |
| 7 | +Name "WinInspect ${VERSION}" |
| 8 | +OutFile "..\\dist\\WinInspect-Installer.exe" |
| 9 | +InstallDir "$PROGRAMFILES64\\WinInspect" |
| 10 | +RequestExecutionLevel admin |
| 11 | + |
| 12 | +!define MUI_ABORTWARNING |
| 13 | + |
| 14 | +!insertmacro MUI_PAGE_WELCOME |
| 15 | +!insertmacro MUI_PAGE_DIRECTORY |
| 16 | +!insertmacro MUI_PAGE_INSTFILES |
| 17 | +!insertmacro MUI_PAGE_FINISH |
| 18 | + |
| 19 | +!insertmacro MUI_UNPAGE_WELCOME |
| 20 | +!insertmacro MUI_UNPAGE_CONFIRM |
| 21 | +!insertmacro MUI_UNPAGE_INSTFILES |
| 22 | +!insertmacro MUI_UNPAGE_FINISH |
| 23 | + |
| 24 | +!insertmacro MUI_LANGUAGE "English" |
| 25 | + |
| 26 | +Section "WinInspect Core" SecCore |
| 27 | + SetOutPath "$INSTDIR" |
| 28 | + |
| 29 | + ; Binaries (assuming they are in build/Release/) |
| 30 | + File "..\build\Release\wininspectd.exe" |
| 31 | + File "..\build\Release\wininspect.exe" |
| 32 | + File "..\build\Release\wininspect-gui.exe" |
| 33 | + |
| 34 | + ; License |
| 35 | + File "..\LICENSE" |
| 36 | + |
| 37 | + ; Registry keys for uninstaller |
| 38 | + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\WinInspect" "DisplayName" "WinInspect" |
| 39 | + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\WinInspect" "UninstallString" '"$INSTDIR\uninstall.exe"' |
| 40 | + WriteUninstaller "$INSTDIR\uninstall.exe" |
| 41 | + |
| 42 | + ; Shortcuts |
| 43 | + CreateDirectory "$SMPROGRAMS\WinInspect" |
| 44 | + CreateShortcut "$SMPROGRAMS\WinInspect\WinInspect GUI.lnk" "$INSTDIR\wininspect-gui.exe" |
| 45 | + CreateShortcut "$SMPROGRAMS\WinInspect\Uninstall WinInspect.lnk" "$INSTDIR\uninstall.exe" |
| 46 | +SectionEnd |
| 47 | + |
| 48 | +Section "Uninstall" |
| 49 | + Delete "$INSTDIR\wininspectd.exe" |
| 50 | + Delete "$INSTDIR\wininspect.exe" |
| 51 | + Delete "$INSTDIR\wininspect-gui.exe" |
| 52 | + Delete "$INSTDIR\LICENSE" |
| 53 | + Delete "$INSTDIR\uninstall.exe" |
| 54 | + |
| 55 | + RMDir "$INSTDIR" |
| 56 | + |
| 57 | + Delete "$SMPROGRAMS\WinInspect\WinInspect GUI.lnk" |
| 58 | + Delete "$SMPROGRAMS\WinInspect\Uninstall WinInspect.lnk" |
| 59 | + RMDir "$SMPROGRAMS\WinInspect" |
| 60 | + |
| 61 | + DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\WinInspect" |
| 62 | +SectionEnd |
0 commit comments