Merge remote-tracking branch 'sunshine/master'
This commit is contained in:
@@ -94,8 +94,8 @@
|
||||
<b>{{ $t('_common.success') }}</b> {{ $t('config.restart_note') }}
|
||||
</div>
|
||||
<div class="mb-3 buttons">
|
||||
<button class="btn btn-primary" @click="save">{{ $t('_common.save') }}</button>
|
||||
<button class="btn btn-success mx-2" @click="apply" v-if="saved && !restarted">{{ $t('_common.apply') }}</button>
|
||||
<button class="btn btn-primary mr-3" @click="save">{{ $t('_common.save') }}</button>
|
||||
<button class="btn btn-success" @click="apply" v-if="saved && !restarted">{{ $t('_common.apply') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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%"
|
||||
|
||||
111
src_assets/windows/misc/path/update-path.bat
Normal file
111
src_assets/windows/misc/path/update-path.bat
Normal file
@@ -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
|
||||
Reference in New Issue
Block a user