Tom Butcher a196d0f26d
All checks were successful
farmcontrol/farmcontrol-ui/pipeline/head This commit looks good
Update Windows installer and deeplink handling
- Changed the default icon reference in the Windows installer from `deeplink.exe` to `launcher.exe`.
- Updated the command for opening the deeplink to use `bun.exe` with the new `deeplink.js` script.
- Refactored the deeplink build script to rename the function from `buildWindowsDeeplinkExe` to `stageWindowsDeeplink` for clarity.
- Adjusted the PowerShell script to check for the presence of `deeplink.js` instead of `deeplink.exe`, ensuring correct staging of the application.
- Modified the finalization script to reflect the new staging function for the deeplink, enhancing the build process.
2026-08-02 21:34:43 +01:00

65 lines
2.0 KiB
NSIS

!macro quitFarmControl
DetailPrint "Stopping running Farm Control processes..."
ExecWait 'taskkill /F /IM launcher.exe /T' $R0
!macroend
!macro uninstallPreviousFarmControl
ClearErrors
ReadRegStr $R0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Farm Control" "UninstallString"
StrCmp $R0 "" check_install_dir run_uninstall
check_install_dir:
ReadRegStr $R0 HKLM "Software\Tom Butcher\Farm Control" "InstallDir"
StrCmp $R0 "" check_default_dir
StrCpy $R0 "$R0\Uninstall.exe"
Goto run_uninstall
check_default_dir:
StrCpy $R0 "$PROGRAMFILES64\Farm Control\Uninstall.exe"
IfFileExists $R0 run_uninstall done_uninstall
run_uninstall:
IfFileExists $R0 0 done_uninstall
DetailPrint "Removing previous Farm Control installation..."
!insertmacro quitFarmControl
ExecWait '$R0 /S' $R1
DetailPrint "Previous installation removed (exit code: $R1)"
done_uninstall:
!macroend
!macro createDesktopShortcut
CreateShortCut "$DESKTOP\Farm Control.lnk" "$INSTDIR\bin\launcher.exe"
!macroend
!macro createStartMenuShortcut
CreateDirectory "$SMPROGRAMS\Farm Control"
CreateShortCut "$SMPROGRAMS\Farm Control\Farm Control.lnk" "$INSTDIR\bin\launcher.exe"
!macroend
!macro removeDesktopShortcut
Delete "$DESKTOP\Farm Control.lnk"
!macroend
!macro removeStartMenuShortcut
Delete "$SMPROGRAMS\Farm Control\Farm Control.lnk"
RMDir "$SMPROGRAMS\Farm Control"
!macroend
!macro customInstall
DetailPrint "Register farmcontrol URI Handler"
DeleteRegKey HKCR "farmcontrol"
WriteRegStr HKCR "farmcontrol" "" "URL:farmcontrol"
WriteRegStr HKCR "farmcontrol" "URL Protocol" ""
WriteRegStr HKCR "farmcontrol\DefaultIcon" "" "$INSTDIR\bin\launcher.exe"
WriteRegStr HKCR "farmcontrol\shell" "" ""
WriteRegStr HKCR "farmcontrol\shell\Open" "" ""
WriteRegStr HKCR "farmcontrol\shell\Open\command" "" '"$INSTDIR\bin\bun.exe" "$INSTDIR\bin\deeplink.js" "%1"'
!macroend
!macro customUnInstall
!insertmacro removeDesktopShortcut
!insertmacro removeStartMenuShortcut
DeleteRegKey HKCR "farmcontrol"
!macroend