diff --git a/.codeql-prebuild-cpp-macOS.sh b/.codeql-prebuild-cpp-macOS.sh index 7fbc090a..1a6be508 100644 --- a/.codeql-prebuild-cpp-macOS.sh +++ b/.codeql-prebuild-cpp-macOS.sh @@ -1,6 +1,10 @@ # install dependencies for C++ analysis set -e +# setup homebrew for x86_64 +/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" +eval "$(/usr/local/bin/brew shellenv)" + # install dependencies dependencies=( "boost" diff --git a/cmake/packaging/windows.cmake b/cmake/packaging/windows.cmake index 5c1b77d0..e4d0a34a 100644 --- a/cmake/packaging/windows.cmake +++ b/cmake/packaging/windows.cmake @@ -25,6 +25,9 @@ install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/windows/misc/service/" install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/windows/misc/migration/" DESTINATION "scripts" COMPONENT assets) +install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/windows/misc/path/" + DESTINATION "scripts" + COMPONENT assets) # Configurable options for the service install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/windows/misc/autostart/" @@ -69,6 +72,7 @@ SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS IfSilent +2 0 # ExecShell 'open' 'https://docs.lizardbyte.dev/projects/sunshine' nsExec::ExecToLog 'icacls \\\"$INSTDIR\\\" /reset' + nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\update-path.bat\\\" add' nsExec::ExecToLog '\\\"$INSTDIR\\\\drivers\\\\sudovda\\\\install.bat\\\"' nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\migrate-config.bat\\\"' nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\add-firewall-rule.bat\\\"' @@ -99,16 +103,18 @@ set(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS 'Do you want to remove $INSTDIR (this includes the configuration, cover images, and settings)?' \ /SD IDNO IDNO NoDelete RMDir /r \\\"$INSTDIR\\\"; skipped if no + nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\update-path.bat\\\" remove' NoDelete: ") # Adding an option for the start menu -set(CPACK_NSIS_MODIFY_PATH "OFF") +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 "sunshine.exe") set(CPACK_NSIS_CREATE_ICONS_EXTRA "${CPACK_NSIS_CREATE_ICONS_EXTRA} + SetOutPath '\$INSTDIR' CreateShortCut '\$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\${CMAKE_PROJECT_NAME}.lnk' \ '\$INSTDIR\\\\sunshine.exe' '--shortcut' ") diff --git a/docs/getting_started.md b/docs/getting_started.md index 7d915761..554db9db 100644 --- a/docs/getting_started.md +++ b/docs/getting_started.md @@ -335,8 +335,6 @@ recommended for most users. No support will be provided!} scripts/uninstall-service.bat ``` -To uninstall, delete the extracted directory which contains the `sunshine.exe` file. - ## Initial Setup After installation, some initial setup is required. diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md index 1ba8d6e0..8bd22eed 100644 --- a/docs/troubleshooting.md +++ b/docs/troubleshooting.md @@ -118,6 +118,16 @@ system. You may also want to enable decoders, however that is not required for S ``` } +### Input not working +After installation, the `udev` rules need to be reloaded. Our post-install script tries to do this for you +automatically, but if it fails you may need to restart your system. + +If the input is still not working, you may need to add your user to the `input` group. + +```bash +sudo usermod -aG input $USER +``` + @note{Other build options are listed in the [meson options](https://gitlab.freedesktop.org/mesa/mesa/-/blob/main/meson_options.txt) file.} diff --git a/gh-pages-template/index.html b/gh-pages-template/index.html index 5d6ebd32..24a97352 100644 --- a/gh-pages-template/index.html +++ b/gh-pages-template/index.html @@ -538,11 +538,11 @@ ext-js:
- - + +
diff --git a/src_assets/linux/misc/60-sunshine.rules b/src_assets/linux/misc/60-sunshine.rules index 5d4445c7..52e53345 100644 --- a/src_assets/linux/misc/60-sunshine.rules +++ b/src_assets/linux/misc/60-sunshine.rules @@ -1,2 +1,11 @@ +# Allows Sunshine to acces /dev/uinput KERNEL=="uinput", SUBSYSTEM=="misc", OPTIONS+="static_node=uinput", TAG+="uaccess" + +# Allows Sunshine to access /dev/uhid KERNEL=="uhid", TAG+="uaccess" + +# Joypads +KERNEL=="hidraw*" ATTRS{name}=="Sunshine PS5 (virtual) pad" MODE="0660", TAG+="uaccess" +SUBSYSTEMS=="input", ATTRS{name}=="Sunshine X-Box One (virtual) pad", MODE="0660", TAG+="uaccess" +SUBSYSTEMS=="input", ATTRS{name}=="Sunshine gamepad (virtual) motion sensors", MODE="0660", TAG+="uaccess" +SUBSYSTEMS=="input", ATTRS{name}=="Sunshine Nintendo (virtual) pad", MODE="0660", TAG+="uaccess" diff --git a/src_assets/windows/misc/gamepad/install-gamepad.bat b/src_assets/windows/misc/gamepad/install-gamepad.bat index a31babb9..47c771db 100644 --- a/src_assets/windows/misc/gamepad/install-gamepad.bat +++ b/src_assets/windows/misc/gamepad/install-gamepad.bat @@ -7,17 +7,12 @@ rem Note: We use exit code 2 to indicate success because either 0 or 1 may be re rem based on the PowerShell version if an exception occurs. powershell -c Exit $(if ((Get-Item "$env:SystemRoot\System32\drivers\ViGEmBus.sys").VersionInfo.FileVersion -ge [System.Version]"1.17") { 2 } Else { 1 }) if %ERRORLEVEL% EQU 2 ( - goto skip + echo "The installed version is 1.17 or later, no update needed. Exiting." + exit /b 0 ) -goto continue -:skip -echo "The installed version is 1.17 or later, no update needed. Exiting." -exit /b 0 - -:continue rem Get temp directory -set temp_dir=%temp%/Sunshine +set temp_dir=%temp%/Apollo rem Create temp directory if it doesn't exist if not exist "%temp_dir%" mkdir "%temp_dir%" diff --git a/src_assets/windows/misc/path/update-path.bat b/src_assets/windows/misc/path/update-path.bat new file mode 100644 index 00000000..cbe86496 --- /dev/null +++ b/src_assets/windows/misc/path/update-path.bat @@ -0,0 +1,111 @@ +@echo off +setlocal EnableDelayedExpansion + +rem Check if parameter is provided +if "%~1"=="" ( + echo Usage: %0 [add^|remove] + echo add - Adds Apollo directories to system PATH + echo remove - Removes Apollo directories from system PATH + exit /b 1 +) + +rem Get Apollo root directory +for %%I in ("%~dp0\..") do set "ROOT_DIR=%%~fI" +echo Apollo root directory: !ROOT_DIR! + +rem Define directories to add to path +set "PATHS_TO_MANAGE[0]=!ROOT_DIR!" +set "PATHS_TO_MANAGE[1]=!ROOT_DIR!\tools" + +rem System path registry location +set "KEY_NAME=HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" +set "VALUE_NAME=Path" + +rem Get the current path +for /f "tokens=2*" %%A in ('reg query "%KEY_NAME%" /v "%VALUE_NAME%"') do set "CURRENT_PATH=%%B" +echo Current path: !CURRENT_PATH! + +rem Check if adding to path +if /i "%~1"=="add" ( + set "NEW_PATH=!CURRENT_PATH!" + + rem Process each directory to add + for /L %%i in (0,1,1) do ( + set "DIR_TO_ADD=!PATHS_TO_MANAGE[%%i]!" + + rem Check if path already contains this directory + echo "!CURRENT_PATH!" | findstr /i /c:"!DIR_TO_ADD!" > nul + if !ERRORLEVEL!==0 ( + echo !DIR_TO_ADD! already in path + ) else ( + echo Adding to path: !DIR_TO_ADD! + set "NEW_PATH=!NEW_PATH!;!DIR_TO_ADD!" + ) + ) + + rem Only update if path was changed + if "!NEW_PATH!" neq "!CURRENT_PATH!" ( + rem Set the new path in the registry + reg add "%KEY_NAME%" /v "%VALUE_NAME%" /t REG_EXPAND_SZ /d "!NEW_PATH!" /f + if !ERRORLEVEL!==0 ( + echo Successfully added Apollo directories to PATH + ) else ( + echo Failed to add Apollo directories to PATH + ) + ) else ( + echo No changes needed to PATH + ) + exit /b !ERRORLEVEL! +) + +rem Check if removing from path +if /i "%~1"=="remove" ( + set "CHANGES_MADE=0" + + rem Process each directory to remove + for /L %%i in (0,1,1) do ( + set "DIR_TO_REMOVE=!PATHS_TO_MANAGE[%%i]!" + + rem Check if path contains this directory + echo "!CURRENT_PATH!" | findstr /i /c:"!DIR_TO_REMOVE!" > nul + if !ERRORLEVEL!==0 ( + echo Removing from path: !DIR_TO_REMOVE! + + rem Build a new path by parsing and filtering the current path + set "NEW_PATH=" + for %%p in ("!CURRENT_PATH:;=" "!") do ( + set "PART=%%~p" + if /i "!PART!" NEQ "!DIR_TO_REMOVE!" ( + if defined NEW_PATH ( + set "NEW_PATH=!NEW_PATH!;!PART!" + ) else ( + set "NEW_PATH=!PART!" + ) + ) + ) + + set "CURRENT_PATH=!NEW_PATH!" + set "CHANGES_MADE=1" + ) else ( + echo !DIR_TO_REMOVE! not found in path + ) + ) + + rem Only update if path was changed + if "!CHANGES_MADE!"=="1" ( + rem Set the new path in the registry + reg add "%KEY_NAME%" /v "%VALUE_NAME%" /t REG_EXPAND_SZ /d "!CURRENT_PATH!" /f + if !ERRORLEVEL!==0 ( + echo Successfully removed Apollo directories from PATH + ) else ( + echo Failed to remove Apollo directories from PATH + ) + ) else ( + echo No changes needed to PATH + ) + exit /b !ERRORLEVEL! +) + +echo Unknown parameter: %~1 +echo Usage: %0 [add^|remove] +exit /b 1 diff --git a/third-party/build-deps b/third-party/build-deps index 0f8f2af9..b567d3c4 160000 --- a/third-party/build-deps +++ b/third-party/build-deps @@ -1 +1 @@ -Subproject commit 0f8f2af955f583c986c634d37ce7655fbff7180a +Subproject commit b567d3c47927c42c33ca86e87892269c354abc02 diff --git a/third-party/inputtino b/third-party/inputtino index 1170b1e4..fd136cfe 160000 --- a/third-party/inputtino +++ b/third-party/inputtino @@ -1 +1 @@ -Subproject commit 1170b1e4ad0f987b24dc94b20c0e866e8350b741 +Subproject commit fd136cfe492b4375b4507718bcca1f044588fc6f diff --git a/third-party/moonlight-common-c b/third-party/moonlight-common-c index 40bec19c..40a4e687 160000 --- a/third-party/moonlight-common-c +++ b/third-party/moonlight-common-c @@ -1 +1 @@ -Subproject commit 40bec19cc1b2fd0a2fcc413e28d5a09377af846d +Subproject commit 40a4e6878714a3eb61f71a30a04effcf2dfadd32