diff --git a/cmake/packaging/common.cmake b/cmake/packaging/common.cmake index 7c76756c..5ef26b36 100644 --- a/cmake/packaging/common.cmake +++ b/cmake/packaging/common.cmake @@ -2,14 +2,14 @@ # common cpack options set(CPACK_PACKAGE_NAME ${CMAKE_PROJECT_NAME}) -set(CPACK_PACKAGE_VENDOR "LizardByte") +set(CPACK_PACKAGE_VENDOR "SudoMaker") set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION}) set(CPACK_PACKAGE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/cpack_artifacts) -set(CPACK_PACKAGE_CONTACT "https://app.lizardbyte.dev") +set(CPACK_PACKAGE_CONTACT "https://www.sudomaker.com") set(CPACK_PACKAGE_DESCRIPTION ${CMAKE_PROJECT_DESCRIPTION}) set(CPACK_PACKAGE_HOMEPAGE_URL ${CMAKE_PROJECT_HOMEPAGE_URL}) set(CPACK_RESOURCE_FILE_LICENSE ${PROJECT_SOURCE_DIR}/LICENSE) -set(CPACK_PACKAGE_ICON ${PROJECT_SOURCE_DIR}/sunshine.png) +set(CPACK_PACKAGE_ICON ${PROJECT_SOURCE_DIR}/apollo.png) set(CPACK_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}") set(CPACK_STRIP_FILES YES) diff --git a/cmake/packaging/windows.cmake b/cmake/packaging/windows.cmake index 77f3a893..01c2c1d8 100644 --- a/cmake/packaging/windows.cmake +++ b/cmake/packaging/windows.cmake @@ -14,6 +14,11 @@ install(TARGETS audio-info RUNTIME DESTINATION "tools" COMPONENT audio) install(TARGETS ddprobe RUNTIME DESTINATION "tools" COMPONENT application) install(TARGETS sunshinesvc RUNTIME DESTINATION "tools" COMPONENT application) +# Drivers +install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/windows/drivers/sudovda" + DESTINATION "drivers" + COMPONENT sudovda) + # Mandatory scripts install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/windows/misc/service/" DESTINATION "scripts" @@ -62,8 +67,9 @@ set(CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_NAME}") SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "${CPACK_NSIS_EXTRA_INSTALL_COMMANDS} IfSilent +2 0 - ExecShell 'open' 'https://sunshinestream.readthedocs.io/' + # ExecShell 'open' 'https://sunshinestream.readthedocs.io/' nsExec::ExecToLog 'icacls \\\"$INSTDIR\\\" /reset' + nsExec::ExecToLog '\\\"$INSTDIR\\\\drivers\\\\sudovda\\\\install.bat\\\"' nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\migrate-config.bat\\\"' nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\add-firewall-rule.bat\\\"' nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\install-gamepad.bat\\\"' @@ -80,10 +86,15 @@ set(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\uninstall-service.bat\\\"' nsExec::ExecToLog '\\\"$INSTDIR\\\\sunshine.exe\\\" --restore-nvprefs-undo' MessageBox MB_YESNO|MB_ICONQUESTION \ - 'Do you want to remove Virtual Gamepad)?' \ + 'Do you want to remove Virtual Gamepad?' \ /SD IDNO IDNO NoGamepad nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\uninstall-gamepad.bat\\\"'; skipped if no NoGamepad: + MessageBox MB_YESNO|MB_ICONQUESTION \ + 'Do you want to remove SudoVDA Virtual Display Driver?' \ + /SD IDNO IDNO NoSudoVDA + nsExec::ExecToLog '\\\"$INSTDIR\\\\drivers\\\\sudovda\\\\uninstall.bat\\\"'; skipped if no + NoSudoVDA: MessageBox MB_YESNO|MB_ICONQUESTION \ 'Do you want to remove $INSTDIR (this includes the configuration, cover images, and settings)?' \ /SD IDNO IDNO NoDelete @@ -95,11 +106,11 @@ set(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS set(CPACK_NSIS_MODIFY_PATH "OFF") set(CPACK_NSIS_EXECUTABLES_DIRECTORY ".") # This will be shown on the installed apps Windows settings -set(CPACK_NSIS_INSTALLED_ICON_NAME "${CMAKE_PROJECT_NAME}.exe") +set(CPACK_NSIS_INSTALLED_ICON_NAME "sunshine.exe") set(CPACK_NSIS_CREATE_ICONS_EXTRA "${CPACK_NSIS_CREATE_ICONS_EXTRA} CreateShortCut '\$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\${CMAKE_PROJECT_NAME}.lnk' \ - '\$INSTDIR\\\\${CMAKE_PROJECT_NAME}.exe' '--shortcut' + '\$INSTDIR\\\\sunshine.exe' '--shortcut' ") set(CPACK_NSIS_DELETE_ICONS_EXTRA "${CPACK_NSIS_DELETE_ICONS_EXTRA} @@ -109,14 +120,14 @@ set(CPACK_NSIS_DELETE_ICONS_EXTRA # Checking for previous installed versions set(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL "ON") -set(CPACK_NSIS_HELP_LINK "https://sunshinestream.readthedocs.io/en/latest/about/installation.html") -set(CPACK_NSIS_URL_INFO_ABOUT "${CMAKE_PROJECT_HOMEPAGE_URL}") -set(CPACK_NSIS_CONTACT "${CMAKE_PROJECT_HOMEPAGE_URL}/support") +# set(CPACK_NSIS_HELP_LINK "https://sunshinestream.readthedocs.io/en/latest/about/installation.html") +# set(CPACK_NSIS_URL_INFO_ABOUT "${CMAKE_PROJECT_HOMEPAGE_URL}") +# set(CPACK_NSIS_CONTACT "${CMAKE_PROJECT_HOMEPAGE_URL}/support") -set(CPACK_NSIS_MENU_LINKS - "https://sunshinestream.readthedocs.io" "Sunshine documentation" - "https://app.lizardbyte.dev" "LizardByte Web Site" - "https://app.lizardbyte.dev/support" "LizardByte Support") +# set(CPACK_NSIS_MENU_LINKS +# "https://sunshinestream.readthedocs.io" "Sunshine documentation" +# "https://app.lizardbyte.dev" "LizardByte Web Site" +# "https://app.lizardbyte.dev/support" "LizardByte Support") set(CPACK_NSIS_MANIFEST_DPI_AWARE true) # Setting components groups and dependencies @@ -131,7 +142,7 @@ 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_DESCRIPTION "If enabled, launches Apollo automatically on system startup.") set(CPACK_COMPONENT_AUTOSTART_GROUP "Core") # assets @@ -140,6 +151,12 @@ set(CPACK_COMPONENT_ASSETS_DESCRIPTION "Shaders, default box art, and web UI.") set(CPACK_COMPONENT_ASSETS_GROUP "Core") set(CPACK_COMPONENT_ASSETS_REQUIRED true) +# drivers +set(CPACK_COMPONENT_SUDOVDA_DISPLAY_NAME "SudoVDA") +set(CPACK_COMPONENT_SUDOVDA_DESCRIPTION "Driver required for Virtual Display to function.") +set(CPACK_COMPONENT_SUDOVDA_GROUP "Drivers") +set(CPACK_COMPONENT_SUDOVDA_REQUIRED true) + # audio tool set(CPACK_COMPONENT_AUDIO_DISPLAY_NAME "audio-info") set(CPACK_COMPONENT_AUDIO_DESCRIPTION "CLI tool providing information about sound devices.") diff --git a/src/entry_handler.cpp b/src/entry_handler.cpp index fb1ece2c..1c057c80 100644 --- a/src/entry_handler.cpp +++ b/src/entry_handler.cpp @@ -140,7 +140,7 @@ namespace service_ctrl { return; } - service_handle = OpenServiceA(scm_handle, "SunshineService", service_desired_access); + service_handle = OpenServiceA(scm_handle, "ApolloService", service_desired_access); if (!service_handle) { auto winerr = GetLastError(); BOOST_LOG(error) << "OpenService() failed: "sv << winerr; diff --git a/src_assets/windows/drivers/sudovda/SudoVDA.inf b/src_assets/windows/drivers/sudovda/SudoVDA.inf new file mode 100644 index 00000000..f9753d42 Binary files /dev/null and b/src_assets/windows/drivers/sudovda/SudoVDA.inf differ diff --git a/src_assets/windows/drivers/sudovda/code_signing.crt b/src_assets/windows/drivers/sudovda/code_signing.crt new file mode 100644 index 00000000..1a4a9512 Binary files /dev/null and b/src_assets/windows/drivers/sudovda/code_signing.crt differ diff --git a/src_assets/windows/drivers/sudovda/install.bat b/src_assets/windows/drivers/sudovda/install.bat new file mode 100644 index 00000000..a7c6a702 --- /dev/null +++ b/src_assets/windows/drivers/sudovda/install.bat @@ -0,0 +1,25 @@ +@echo off + +pushd %~dp0 + +echo ================ +echo Installing cert for the SudoVDA driver... + +certutil -addstore -f root "code_signing.crt" +certutil -addstore -f TrustedPublisher "code_signing.crt" + +echo ================ +echo Removing the old driver... It's OK to show an error if you're installing the driver for the first time. + +nefconc.exe --remove-device-node --hardware-id root\sudomaker\sudovda --class-guid "4D36E968-E325-11CE-BFC1-08002BE10318" + +echo ================ +echo Installing the new driver... + +nefconc.exe --create-device-node --class-name Display --class-guid "4D36E968-E325-11CE-BFC1-08002BE10318" --hardware-id root\sudomaker\sudovda +nefconc.exe --install-driver --inf-path "SudoVDA.inf" + +echo ================ +echo Done! + +popd diff --git a/src_assets/windows/drivers/sudovda/sudovda.cat b/src_assets/windows/drivers/sudovda/sudovda.cat new file mode 100644 index 00000000..92f9a4c1 Binary files /dev/null and b/src_assets/windows/drivers/sudovda/sudovda.cat differ diff --git a/src_assets/windows/drivers/sudovda/uninstall.bat b/src_assets/windows/drivers/sudovda/uninstall.bat new file mode 100644 index 00000000..107d6ffb --- /dev/null +++ b/src_assets/windows/drivers/sudovda/uninstall.bat @@ -0,0 +1,9 @@ +@echo off + +pushd %~dp0 + +nefconc.exe --remove-device-node --hardware-id root\sudomaker\sudovda --class-guid "4D36E968-E325-11CE-BFC1-08002BE10318" + +popd + +pause diff --git a/src_assets/windows/misc/autostart/autostart-service.bat b/src_assets/windows/misc/autostart/autostart-service.bat index 13c6b6bc..0f40c9db 100644 --- a/src_assets/windows/misc/autostart/autostart-service.bat +++ b/src_assets/windows/misc/autostart/autostart-service.bat @@ -1,4 +1,4 @@ @echo off rem Set the service to auto-start -sc config SunshineService start= auto +sc config ApolloService start= auto diff --git a/src_assets/windows/misc/firewall/add-firewall-rule.bat b/src_assets/windows/misc/firewall/add-firewall-rule.bat index 81d5dd92..7543ee5b 100644 --- a/src_assets/windows/misc/firewall/add-firewall-rule.bat +++ b/src_assets/windows/misc/firewall/add-firewall-rule.bat @@ -3,7 +3,7 @@ rem Get sunshine root directory for %%I in ("%~dp0\..") do set "ROOT_DIR=%%~fI" -set RULE_NAME=Sunshine +set RULE_NAME=Apollo set PROGRAM_BIN="%ROOT_DIR%\sunshine.exe" rem Add the rule diff --git a/src_assets/windows/misc/firewall/delete-firewall-rule.bat b/src_assets/windows/misc/firewall/delete-firewall-rule.bat index 3ab0d4e9..df73cf8a 100644 --- a/src_assets/windows/misc/firewall/delete-firewall-rule.bat +++ b/src_assets/windows/misc/firewall/delete-firewall-rule.bat @@ -1,6 +1,6 @@ @echo off -set RULE_NAME=Sunshine +set RULE_NAME=Apollo rem Delete the rule netsh advfirewall firewall delete rule name=%RULE_NAME% diff --git a/src_assets/windows/misc/service/install-service.bat b/src_assets/windows/misc/service/install-service.bat index 03ce6e62..e81803ab 100644 --- a/src_assets/windows/misc/service/install-service.bat +++ b/src_assets/windows/misc/service/install-service.bat @@ -3,7 +3,7 @@ rem Get sunshine root directory for %%I in ("%~dp0\..") do set "ROOT_DIR=%%~fI" -set SERVICE_NAME=SunshineService +set SERVICE_NAME=ApolloService set SERVICE_BIN="%ROOT_DIR%\tools\sunshinesvc.exe" rem Set service to demand start. It will be changed to auto later if the user selected that option. @@ -13,7 +13,7 @@ rem Remove the legacy SunshineSvc service net stop sunshinesvc sc delete sunshinesvc -rem Check if SunshineService already exists +rem Check if ApolloService already exists sc qc %SERVICE_NAME% > nul 2>&1 if %ERRORLEVEL%==0 ( rem Stop the existing service if running @@ -27,10 +27,10 @@ if %ERRORLEVEL%==0 ( ) rem Run the sc command to create/reconfigure the service -sc %SC_CMD% %SERVICE_NAME% binPath= %SERVICE_BIN% start= %SERVICE_START_TYPE% DisplayName= "Sunshine Service" +sc %SC_CMD% %SERVICE_NAME% binPath= %SERVICE_BIN% start= %SERVICE_START_TYPE% DisplayName= "Apollo Service" rem Set the description of the service -sc description %SERVICE_NAME% "Sunshine is a self-hosted game stream host for Moonlight." +sc description %SERVICE_NAME% "Apollo is a self-hosted game stream host for Moonlight." rem Start the new service net start %SERVICE_NAME% diff --git a/src_assets/windows/misc/service/uninstall-service.bat b/src_assets/windows/misc/service/uninstall-service.bat index 451ceb61..cf09b995 100644 --- a/src_assets/windows/misc/service/uninstall-service.bat +++ b/src_assets/windows/misc/service/uninstall-service.bat @@ -4,6 +4,6 @@ rem Stop and delete the legacy SunshineSvc service net stop sunshinesvc sc delete sunshinesvc -rem Stop and delete the new SunshineService service -net stop SunshineService -sc delete SunshineService +rem Stop and delete the new ApolloService service +net stop ApolloService +sc delete ApolloService diff --git a/tools/sunshinesvc.cpp b/tools/sunshinesvc.cpp index da0849e2..bb76f7f0 100644 --- a/tools/sunshinesvc.cpp +++ b/tools/sunshinesvc.cpp @@ -18,7 +18,7 @@ SERVICE_STATUS service_status; HANDLE stop_event; HANDLE session_change_event; -#define SERVICE_NAME "SunshineService" +#define SERVICE_NAME "ApolloService" DWORD WINAPI HandlerEx(DWORD dwControl, DWORD dwEventType, LPVOID lpEventData, LPVOID lpContext) { diff --git a/vite.config.js b/vite.config.js index 8732f1a0..9360af5a 100644 --- a/vite.config.js +++ b/vite.config.js @@ -43,6 +43,7 @@ export default defineConfig({ root: resolve(assetsSrcPath), build: { outDir: resolve(assetsDstPath), + emptyOutDir: true, rollupOptions: { input: { apps: resolve(assetsSrcPath, 'apps.html'),