Tom Butcher 0aa26eab66
Some checks failed
farmcontrol/farmcontrol-server/pipeline/head There was a failure building this commit
Enhance Windows installer with MSI support and shortcut creation
- Updated farmcontrol-server.nsi to include desktop and Start Menu shortcut creation.
- Added new macros in installer.nsh for managing shortcuts during installation and uninstallation.
- Introduced build-windows-msi.ps1 script for generating MSI installers, integrating with existing build processes.
- Modified finalize-desktop-artifacts.mjs to call the new MSI build script, ensuring proper artifact generation.
2026-08-01 22:21:49 +01:00

35 lines
1.2 KiB
NSIS

!macro createDesktopShortcut
CreateShortCut "$DESKTOP\Farm Control Server.lnk" "$INSTDIR\bin\launcher.exe"
!macroend
!macro createStartMenuShortcut
CreateDirectory "$SMPROGRAMS\Farm Control Server"
CreateShortCut "$SMPROGRAMS\Farm Control Server\Farm Control Server.lnk" "$INSTDIR\bin\launcher.exe"
!macroend
!macro removeDesktopShortcut
Delete "$DESKTOP\Farm Control Server.lnk"
!macroend
!macro removeStartMenuShortcut
Delete "$SMPROGRAMS\Farm Control Server\Farm Control Server.lnk"
RMDir "$SMPROGRAMS\Farm Control Server"
!macroend
!macro customInstall
DetailPrint "Register farmcontrolserver URI Handler"
DeleteRegKey HKCR "farmcontrolserver"
WriteRegStr HKCR "farmcontrolserver" "" "URL:farmcontrolserver"
WriteRegStr HKCR "farmcontrolserver" "URL Protocol" ""
WriteRegStr HKCR "farmcontrolserver\DefaultIcon" "" "$INSTDIR\bin\launcher.exe"
WriteRegStr HKCR "farmcontrolserver\shell" "" ""
WriteRegStr HKCR "farmcontrolserver\shell\Open" "" ""
WriteRegStr HKCR "farmcontrolserver\shell\Open\command" "" '"$INSTDIR\bin\launcher.exe" "%1"'
!macroend
!macro customUnInstall
!insertmacro removeDesktopShortcut
!insertmacro removeStartMenuShortcut
DeleteRegKey HKCR "farmcontrolserver"
!macroend