Add an option to control whether Sunshine starts on boot
This commit is contained in:
@@ -712,6 +712,11 @@ if(WIN32) # see options at: https://cmake.org/cmake/help/latest/cpack_gen/nsis.h
|
|||||||
DESTINATION "scripts"
|
DESTINATION "scripts"
|
||||||
COMPONENT assets)
|
COMPONENT assets)
|
||||||
|
|
||||||
|
# Configurable options for the service
|
||||||
|
install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/windows/misc/autostart/"
|
||||||
|
DESTINATION "scripts"
|
||||||
|
COMPONENT autostart)
|
||||||
|
|
||||||
# scripts
|
# scripts
|
||||||
install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/windows/misc/firewall/"
|
install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/windows/misc/firewall/"
|
||||||
DESTINATION "scripts"
|
DESTINATION "scripts"
|
||||||
@@ -747,6 +752,7 @@ if(WIN32) # see options at: https://cmake.org/cmake/help/latest/cpack_gen/nsis.h
|
|||||||
nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\add-firewall-rule.bat\\\"'
|
nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\add-firewall-rule.bat\\\"'
|
||||||
nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\install-service.bat\\\"'
|
nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\install-service.bat\\\"'
|
||||||
nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\install-vigembus.bat\\\"'
|
nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\install-vigembus.bat\\\"'
|
||||||
|
nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\autostart-service.bat\\\"'
|
||||||
NoController:
|
NoController:
|
||||||
")
|
")
|
||||||
|
|
||||||
@@ -804,6 +810,11 @@ if(WIN32) # see options at: https://cmake.org/cmake/help/latest/cpack_gen/nsis.h
|
|||||||
set(CPACK_COMPONENT_APPLICATION_REQUIRED true)
|
set(CPACK_COMPONENT_APPLICATION_REQUIRED true)
|
||||||
set(CPACK_COMPONENT_APPLICATION_DEPENDS assets)
|
set(CPACK_COMPONENT_APPLICATION_DEPENDS assets)
|
||||||
|
|
||||||
|
# service auto-start script
|
||||||
|
set(CPACK_COMPONENT_AUTOSTART_DISPLAY_NAME "Launch on Startup")
|
||||||
|
set(CPACK_COMPONENT_AUTOSTART_DESCRIPTION "If enabled, launches Sunshine automatically on system startup.")
|
||||||
|
set(CPACK_COMPONENT_AUTOSTART_GROUP "Core")
|
||||||
|
|
||||||
# assets
|
# assets
|
||||||
set(CPACK_COMPONENT_ASSETS_DISPLAY_NAME "Required Assets")
|
set(CPACK_COMPONENT_ASSETS_DISPLAY_NAME "Required Assets")
|
||||||
set(CPACK_COMPONENT_ASSETS_DESCRIPTION "Shaders, default box art, and web UI.")
|
set(CPACK_COMPONENT_ASSETS_DESCRIPTION "Shaders, default box art, and web UI.")
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
@echo off
|
||||||
|
|
||||||
|
rem Set the service to auto-start
|
||||||
|
sc config sunshinesvc start= auto
|
||||||
@@ -5,7 +5,9 @@ for %%I in ("%~dp0\..") do set "ROOT_DIR=%%~fI"
|
|||||||
|
|
||||||
set SERVICE_NAME=sunshinesvc
|
set SERVICE_NAME=sunshinesvc
|
||||||
set SERVICE_BIN="%ROOT_DIR%\tools\sunshinesvc.exe"
|
set SERVICE_BIN="%ROOT_DIR%\tools\sunshinesvc.exe"
|
||||||
set SERVICE_START_TYPE=auto
|
|
||||||
|
rem Set service to demand start. It will be changed to auto later if the user selected that option.
|
||||||
|
set SERVICE_START_TYPE=demand
|
||||||
|
|
||||||
rem Check if sunshinesvc already exists
|
rem Check if sunshinesvc already exists
|
||||||
sc qc %SERVICE_NAME% > nul 2>&1
|
sc qc %SERVICE_NAME% > nul 2>&1
|
||||||
|
|||||||
Reference in New Issue
Block a user