SplatTool-public/SplatTool_Installer.nsi

55 lines
1.8 KiB
NSIS
Raw Normal View History

2026-04-23 17:08:47 +02:00
!define PKG_DIR "pkg-win"
!ifndef VERSION
!error "VERSION not defined (pass with -DVERSION=...)"
!endif
!ifndef SHORT_SHA
!error "SHORT_SHA not defined (pass with -DSHORT_SHA=...)"
!endif
Name "SplatTool"
OutFile "SplatTool-${VERSION}-${SHORT_SHA}-Setup.exe"
InstallDir "$PROGRAMFILES64\SplatTool"
RequestExecutionLevel admin ; Needed to write to Program Files
Page directory
Page instfiles
Section "Install Files"
SetOutPath "$INSTDIR"
File /r "${PKG_DIR}\*.*"
; Create shortcuts
CreateDirectory "$SMPROGRAMS\SplatTool"
CreateShortCut "$DESKTOP\SplatTool.lnk" "$INSTDIR\SplatTool.exe" "" "$INSTDIR\icon.ico"
CreateShortCut "$SMPROGRAMS\SplatTool\SplatTool.lnk" "$INSTDIR\SplatTool.exe" "" "$INSTDIR\icon.ico"
WriteUninstaller "$INSTDIR\Uninstall.exe"
; Register in Add/Remove Programs
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\SplatTool" "DisplayName" "SplatTool"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\SplatTool" "UninstallString" "$INSTDIR\Uninstall.exe"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\SplatTool" "DisplayIcon" "$INSTDIR\icon.ico"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\SplatTool" "DisplayVersion" "${VERSION}"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\SplatTool" "Publisher" "CrafterPika"
SectionEnd
Section "Uninstall"
Delete "$INSTDIR\SplatTool.exe"
Delete "$INSTDIR\icon.ico"
RMDir /r "$INSTDIR"
Delete "$DESKTOP\SplatTool.lnk"
Delete "$SMPROGRAMS\SplatTool\SplatTool.lnk"
RMDir "$SMPROGRAMS\SplatTool"
; Remove registry keys on uninstall
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\SplatTool"
SectionEnd