farmcontrol-server/packaging/windows/farmcontrol-server.nsi
Tom Butcher 72cea3a740
Some checks failed
farmcontrol/farmcontrol-server/pipeline/head There was a failure building this commit
Refactor Windows installer scripts and enhance build process
- Updated farmcontrol-server.nsi to simplify setup file handling by defining APP_SOURCE_DIR and removing unnecessary variables.
- Modified installer.nsh to reference the correct launcher executable path.
- Refactored build-windows-nsis.ps1 to accept APP_DIR instead of individual setup file parameters, streamlining the build process.
- Introduced expand-windows-installer.mjs for handling decompression and extraction of Windows app archives, improving artifact management.
- Enhanced finalize-desktop-artifacts.mjs to integrate the new expansion process and ensure proper cleanup of temporary files.
2026-08-01 22:10:41 +01:00

64 lines
2.0 KiB
NSIS

!include "MUI2.nsh"
!include "installer.nsh"
!ifndef OUTFILE
!define OUTFILE "farmcontrol-server-installer.exe"
!endif
!ifndef VERSION
!define VERSION "1.0.0"
!endif
!ifndef APP_SOURCE_DIR
!define APP_SOURCE_DIR "."
!endif
Name "Farm Control Server"
OutFile "${OUTFILE}"
InstallDir "$PROGRAMFILES64\Farm Control Server"
InstallDirRegKey HKLM "Software\Tom Butcher\Farm Control Server" "InstallDir"
RequestExecutionLevel admin
!define MUI_ABORTWARNING
!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install.ico"
!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico"
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_LANGUAGE "English"
Section "Farm Control Server" SecMain
SetOutPath $INSTDIR
File /r "${APP_SOURCE_DIR}\*"
!insertmacro customInstall
WriteRegStr HKLM "Software\Tom Butcher\Farm Control Server" "InstallDir" $INSTDIR
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Farm Control Server" \
"DisplayName" "Farm Control Server"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Farm Control Server" \
"DisplayVersion" "${VERSION}"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Farm Control Server" \
"Publisher" "Tom Butcher"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Farm Control Server" \
"UninstallString" "$INSTDIR\Uninstall.exe"
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Farm Control Server" \
"NoModify" 1
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Farm Control Server" \
"NoRepair" 1
WriteUninstaller "$INSTDIR\Uninstall.exe"
SectionEnd
Section "Uninstall"
!insertmacro customUnInstall
Delete "$INSTDIR\Uninstall.exe"
RMDir /r "$INSTDIR"
DeleteRegKey HKLM "Software\Tom Butcher\Farm Control Server"
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Farm Control Server"
SectionEnd