56 lines
2.0 KiB
NSIS
56 lines
2.0 KiB
NSIS
Unicode true
|
|
!define MUI_ICON "app.ico"
|
|
!define MUI_UNICON "app.ico"
|
|
!include "MUI2.nsh"
|
|
!include "payload-files.nsh"
|
|
|
|
Name "Rusty Path of Building"
|
|
OutFile "${OUTPUT}"
|
|
RequestExecutionLevel user
|
|
InstallDir "$LOCALAPPDATA\Programs\Rusty Path of Building"
|
|
SetCompressor /SOLID lzma
|
|
|
|
!define APP "rusty-path-of-building.exe"
|
|
!define UNINSTALL_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\RustyPathOfBuilding"
|
|
!insertmacro MUI_PAGE_DIRECTORY
|
|
!insertmacro MUI_PAGE_INSTFILES
|
|
!insertmacro MUI_UNPAGE_CONFIRM
|
|
!insertmacro MUI_UNPAGE_INSTFILES
|
|
!insertmacro MUI_LANGUAGE "English"
|
|
|
|
Function .onInit
|
|
SetRegView 64
|
|
ReadRegStr $0 HKCU "${UNINSTALL_KEY}" "InstallLocation"
|
|
StrCmp $0 "" +2
|
|
StrCpy $INSTDIR $0
|
|
FunctionEnd
|
|
|
|
Section "Rusty Path of Building"
|
|
SetShellVarContext current
|
|
!insertmacro InstallPayload
|
|
SetOutPath "$INSTDIR"
|
|
WriteUninstaller "$INSTDIR\Uninstall.exe"
|
|
CreateShortcut "$SMPROGRAMS\Rusty Path of Building.lnk" "$INSTDIR\${APP}"
|
|
CreateShortcut "$SMPROGRAMS\Rusty Path of Building - PoE 1.lnk" "$INSTDIR\${APP}" "poe1"
|
|
CreateShortcut "$SMPROGRAMS\Rusty Path of Building - PoE 2.lnk" "$INSTDIR\${APP}" "poe2"
|
|
WriteRegStr HKCU "${UNINSTALL_KEY}" "DisplayName" "Rusty Path of Building"
|
|
WriteRegStr HKCU "${UNINSTALL_KEY}" "DisplayVersion" "${VERSION}"
|
|
WriteRegStr HKCU "${UNINSTALL_KEY}" "DisplayIcon" "$INSTDIR\${APP}"
|
|
WriteRegStr HKCU "${UNINSTALL_KEY}" "InstallLocation" "$INSTDIR"
|
|
WriteRegStr HKCU "${UNINSTALL_KEY}" "UninstallString" '"$INSTDIR\Uninstall.exe"'
|
|
WriteRegDWORD HKCU "${UNINSTALL_KEY}" "NoModify" 1
|
|
WriteRegDWORD HKCU "${UNINSTALL_KEY}" "NoRepair" 1
|
|
SectionEnd
|
|
|
|
Section "Uninstall"
|
|
SetRegView 64
|
|
SetShellVarContext current
|
|
Delete "$SMPROGRAMS\Rusty Path of Building.lnk"
|
|
Delete "$SMPROGRAMS\Rusty Path of Building - PoE 1.lnk"
|
|
Delete "$SMPROGRAMS\Rusty Path of Building - PoE 2.lnk"
|
|
!insertmacro UninstallPayload
|
|
Delete "$INSTDIR\Uninstall.exe"
|
|
RMDir "$INSTDIR"
|
|
DeleteRegKey HKCU "${UNINSTALL_KEY}"
|
|
SectionEnd
|