[feat] make CrossDesk service start and stop with the app

This commit is contained in:
dijunkun
2026-04-28 10:25:16 +08:00
parent 71bce08549
commit 5f541f5c8b
4 changed files with 198 additions and 16 deletions
+1 -8
View File
@@ -195,14 +195,7 @@ Function RegisterInstalledService
Abort
${EndIf}
DetailPrint "Starting CrossDesk service"
ExecWait '"$INSTDIR\CrossDesk.exe" --service-start' $0
${If} $0 != 0
ExecWait '"$INSTDIR\CrossDesk.exe" --service-uninstall' $1
ExecWait '"$SYSDIR\sc.exe" delete ${PRODUCT_SERVICE_NAME}' $1
MessageBox MB_ICONSTOP|MB_OK "The CrossDesk service was registered but could not be started. The installation will be aborted."
Abort
${EndIf}
DetailPrint "CrossDesk service registered for on-demand start"
Return