Some checks failed
farmcontrol/farmcontrol-ui/pipeline/head There was a failure building this commit
- Introduced a new script to build the Windows deeplink executable, enhancing deep link handling. - Updated the installer script to replace references from `launcher.exe` to `deeplink.exe` for better integration with the new deeplink functionality. - Added a new `deeplink.js` file to manage deeplink processing and communication with running instances. - Refactored single instance management to utilize the new deeplink capabilities, improving instance handling and navigation. - Removed deprecated Windows launch argument handling to streamline the codebase.
65 lines
2.0 KiB
NSIS
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\deeplink.exe"
|
|
WriteRegStr HKCR "farmcontrol\shell" "" ""
|
|
WriteRegStr HKCR "farmcontrol\shell\Open" "" ""
|
|
WriteRegStr HKCR "farmcontrol\shell\Open\command" "" '"$INSTDIR\bin\deeplink.exe" "%1"'
|
|
!macroend
|
|
|
|
!macro customUnInstall
|
|
!insertmacro removeDesktopShortcut
|
|
!insertmacro removeStartMenuShortcut
|
|
DeleteRegKey HKCR "farmcontrol"
|
|
!macroend
|