|
| 1 | +;=========================================================== |
| 2 | +; Modern NSIS Installer for a Single EXE (64-bit) |
| 3 | +;=========================================================== |
| 4 | + |
| 5 | +!define APPNAME "PlumeImpactor" |
| 6 | +!define APPEXE "plumeimpactor.exe" |
| 7 | +!define COMPANY "Samara" |
| 8 | + |
| 9 | +Name "${APPNAME}" |
| 10 | +BrandingText "${APPNAME} Setup" |
| 11 | + |
| 12 | +OutFile "PlumeInstaller.exe" |
| 13 | + |
| 14 | +RequestExecutionLevel admin |
| 15 | +InstallDir "$PROGRAMFILES64\${APPNAME}" |
| 16 | +InstallDirRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "InstallLocation" |
| 17 | + |
| 18 | +;----------------------------------------------------------- |
| 19 | +; Modern UI 2 |
| 20 | +;----------------------------------------------------------- |
| 21 | +!include "MUI2.nsh" |
| 22 | + |
| 23 | +!define MUI_ABORTWARNING |
| 24 | +!define MUI_ICON "icon.ico" |
| 25 | +!define MUI_UNICON "icon.ico" |
| 26 | + |
| 27 | +;----------------------------------------------------------- |
| 28 | +; Installer Pages |
| 29 | +;----------------------------------------------------------- |
| 30 | +!insertmacro MUI_PAGE_WELCOME |
| 31 | +!insertmacro MUI_PAGE_DIRECTORY |
| 32 | +!insertmacro MUI_PAGE_INSTFILES |
| 33 | +!insertmacro MUI_PAGE_FINISH |
| 34 | + |
| 35 | +;----------------------------------------------------------- |
| 36 | +; Uninstaller Pages |
| 37 | +;----------------------------------------------------------- |
| 38 | +!insertmacro MUI_UNPAGE_WELCOME |
| 39 | +!insertmacro MUI_UNPAGE_CONFIRM |
| 40 | +!insertmacro MUI_UNPAGE_INSTFILES |
| 41 | +!insertmacro MUI_UNPAGE_FINISH |
| 42 | + |
| 43 | +!insertmacro MUI_LANGUAGE "English" |
| 44 | + |
| 45 | +;=========================================================== |
| 46 | +; Installer Section |
| 47 | +;=========================================================== |
| 48 | +Section "Install" |
| 49 | + |
| 50 | + SetOutPath "$INSTDIR" |
| 51 | + File "${APPEXE}" |
| 52 | + |
| 53 | + ; Start Menu entries |
| 54 | + CreateDirectory "$SMPROGRAMS\${APPNAME}" |
| 55 | + CreateShortcut "$SMPROGRAMS\${APPNAME}\${APPNAME}.lnk" "$INSTDIR\${APPEXE}" |
| 56 | + |
| 57 | + CreateShortcut "$DESKTOP\${APPNAME}.lnk" "$INSTDIR\${APPEXE}" |
| 58 | + |
| 59 | + WriteUninstaller "$INSTDIR\Uninstall.exe" |
| 60 | + |
| 61 | + ; 64-bit registry uninstall entry |
| 62 | + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "DisplayName" "${APPNAME}" |
| 63 | + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "Publisher" "${COMPANY}" |
| 64 | + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "InstallLocation" "$INSTDIR" |
| 65 | + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "UninstallString" "$INSTDIR\Uninstall.exe" |
| 66 | + WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "NoModify" 1 |
| 67 | + WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "NoRepair" 1 |
| 68 | + |
| 69 | +SectionEnd |
| 70 | + |
| 71 | +;=========================================================== |
| 72 | +; Uninstaller Section |
| 73 | +;=========================================================== |
| 74 | +Section "Uninstall" |
| 75 | + |
| 76 | + Delete "$DESKTOP\${APPNAME}.lnk" |
| 77 | + Delete "$SMPROGRAMS\${APPNAME}\${APPNAME}.lnk" |
| 78 | + RMDir "$SMPROGRAMS\${APPNAME}" |
| 79 | + |
| 80 | + Delete "$INSTDIR\${APPEXE}" |
| 81 | + Delete "$INSTDIR\Uninstall.exe" |
| 82 | + |
| 83 | + RMDir "$INSTDIR" |
| 84 | + |
| 85 | + DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" |
| 86 | + |
| 87 | +SectionEnd |
0 commit comments