mirror of
https://github.com/jazir555/GamesDows.git
synced 2025-06-05 07:07:23 +02:00
Compare commits
49 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
bf08fb5546 | ||
![]() |
5fe58bc56a | ||
![]() |
3689b68215 | ||
![]() |
87c64e1313 | ||
![]() |
0dfeccd96d | ||
![]() |
88d9e2972a | ||
![]() |
cb9218a3d0 | ||
![]() |
24a9f0e798 | ||
![]() |
f98ba713bd | ||
![]() |
89f4b71825 | ||
![]() |
785a97b697 | ||
![]() |
9f62c88fc1 | ||
![]() |
56c5b6a91e | ||
![]() |
fafd7a2010 | ||
![]() |
1ca95e4131 | ||
![]() |
d3ee9e4289 | ||
![]() |
dd07d9550c | ||
![]() |
5be5761019 | ||
![]() |
12e28325c8 | ||
![]() |
3220a3b457 | ||
![]() |
3f5e0a43fd | ||
![]() |
009602191a | ||
![]() |
ba9c7779e2 | ||
![]() |
d7d936c495 | ||
![]() |
ea2d0cb5f1 | ||
![]() |
61266d6ffb | ||
![]() |
38892bc2e5 | ||
![]() |
1616abfa47 | ||
![]() |
858653e153 | ||
![]() |
6dd340bbdb | ||
![]() |
a1295739f5 | ||
![]() |
c832862a12 | ||
![]() |
c1a191041e | ||
![]() |
449ce6206e | ||
![]() |
83edbd480d | ||
![]() |
8ac1b1f33a | ||
![]() |
bd73881d7a | ||
![]() |
5c73816ead | ||
![]() |
a401cebb39 | ||
![]() |
4bd7664265 | ||
![]() |
86e9a0171f | ||
![]() |
3b322f4ab3 | ||
![]() |
aa8a0d9f7d | ||
![]() |
e567ed85b5 | ||
![]() |
4129b605b7 | ||
![]() |
1a6122f684 | ||
![]() |
f6ab856467 | ||
![]() |
8c0a43dbac | ||
![]() |
e22ef998ef |
@ -1,89 +0,0 @@
|
||||
@echo off
|
||||
SETLOCAL EnableExtensions EnableDelayedExpansion
|
||||
|
||||
:: Define paths and names
|
||||
SET "STEAM_FOLDER=C:\Program Files (x86)\Steam"
|
||||
SET "SCRIPT_NAME=DelayedExplorerStart.bat"
|
||||
SET "SCRIPT_PATH=%STEAM_FOLDER%\%SCRIPT_NAME%"
|
||||
SET "VBS_NAME=RunBatchSilently.vbs"
|
||||
SET "VBS_PATH=%STEAM_FOLDER%\%VBS_NAME%"
|
||||
SET "XML_NAME=DelayedExplorerStartTask.xml"
|
||||
SET "XML_PATH=%STEAM_FOLDER%\%XML_NAME%"
|
||||
|
||||
echo ================================
|
||||
echo Disabling GamesDows
|
||||
echo ================================
|
||||
|
||||
:: Reset the default shell to Explorer
|
||||
echo [1/5] Resetting default shell to Explorer...
|
||||
REG ADD "HKCU\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v Shell /t REG_SZ /d "C:\Windows\explorer.exe" /f
|
||||
if ERRORLEVEL 1 (
|
||||
echo [ERROR] Failed to reset the default shell.
|
||||
goto end
|
||||
) else (
|
||||
echo [SUCCESS] Default shell reset to Explorer.
|
||||
)
|
||||
|
||||
:: Terminate Steam processes to ensure changes take effect
|
||||
echo [2/5] Terminating Steam processes...
|
||||
taskkill /IM "Steam.exe" /F >nul 2>&1
|
||||
taskkill /IM "SteamService.exe" /F >nul 2>&1
|
||||
echo [INFO] Steam processes terminated.
|
||||
|
||||
:: Delete the DelayedExplorerStart.bat script
|
||||
echo [3/5] Deleting DelayedExplorerStart.bat...
|
||||
IF EXIST "%SCRIPT_PATH%" (
|
||||
DEL /F /Q "%SCRIPT_PATH%"
|
||||
if ERRORLEVEL 1 (
|
||||
echo [WARNING] Could not delete %SCRIPT_NAME%.
|
||||
) else (
|
||||
echo [SUCCESS] %SCRIPT_NAME% deleted.
|
||||
)
|
||||
) else (
|
||||
echo [INFO] %SCRIPT_NAME% does not exist.
|
||||
)
|
||||
|
||||
:: Delete the RunBatchSilently.vbs script
|
||||
echo [4/5] Deleting RunBatchSilently.vbs...
|
||||
IF EXIST "%VBS_PATH%" (
|
||||
DEL /F /Q "%VBS_PATH%"
|
||||
if ERRORLEVEL 1 (
|
||||
echo [WARNING] Could not delete %VBS_NAME%.
|
||||
) else (
|
||||
echo [SUCCESS] %VBS_NAME% deleted.
|
||||
)
|
||||
) else (
|
||||
echo [INFO] %VBS_NAME% does not exist.
|
||||
)
|
||||
|
||||
:: Delete the DelayedExplorerStartTask.xml file
|
||||
echo [5/5] Deleting DelayedExplorerStartTask.xml...
|
||||
IF EXIST "%XML_PATH%" (
|
||||
DEL /F /Q "%XML_PATH%"
|
||||
if ERRORLEVEL 1 (
|
||||
echo [WARNING] Could not delete %XML_NAME%.
|
||||
) else (
|
||||
echo [SUCCESS] %XML_NAME% deleted.
|
||||
)
|
||||
) else (
|
||||
echo [INFO] %XML_NAME% does not exist.
|
||||
)
|
||||
|
||||
:: Delete the scheduled task
|
||||
echo [6/6] Deleting scheduled task 'RunDelayedExplorerStart'...
|
||||
schtasks /delete /tn "RunDelayedExplorerStart" /f >nul 2>&1
|
||||
if ERRORLEVEL 1 (
|
||||
echo [WARNING] Could not delete the scheduled task 'RunDelayedExplorerStart'.
|
||||
) else (
|
||||
echo [SUCCESS] Scheduled task 'RunDelayedExplorerStart' deleted.
|
||||
)
|
||||
|
||||
echo.
|
||||
echo ================================
|
||||
echo GamesDows has been disabled successfully.
|
||||
echo A system restart is recommended for all changes to take effect.
|
||||
echo ================================
|
||||
|
||||
:end
|
||||
ENDLOCAL
|
||||
pause
|
134
Disable Gamesdows V3.bat
Normal file
134
Disable Gamesdows V3.bat
Normal file
@ -0,0 +1,134 @@
|
||||
@echo off
|
||||
SETLOCAL EnableExtensions EnableDelayedExpansion
|
||||
|
||||
:: Paths for Steam
|
||||
SET "STEAM_FOLDER=C:\Program Files (x86)\Steam"
|
||||
SET "STEAM_SCRIPT_NAME=DelayedExplorerStart.bat"
|
||||
SET "STEAM_SCRIPT_PATH=%STEAM_FOLDER%\%STEAM_SCRIPT_NAME%"
|
||||
SET "STEAM_VBS_NAME=RunBatchSilently.vbs"
|
||||
SET "STEAM_VBS_PATH=%STEAM_FOLDER%\%STEAM_VBS_NAME%"
|
||||
SET "STEAM_XML_NAME=DelayedExplorerStartTask.xml"
|
||||
SET "STEAM_XML_PATH=%STEAM_FOLDER%\%STEAM_XML_NAME%"
|
||||
|
||||
:: Paths for Playnite
|
||||
SET "PLAYNITE_FOLDER=%LOCALAPPDATA%\Playnite"
|
||||
SET "PLAYNITE_SCRIPT_NAME=DelayedExplorerStart.bat"
|
||||
SET "PLAYNITE_SCRIPT_PATH=%PLAYNITE_FOLDER%\%PLAYNITE_SCRIPT_NAME%"
|
||||
SET "PLAYNITE_VBS_NAME=RunBatchSilently.vbs"
|
||||
SET "PLAYNITE_VBS_PATH=%PLAYNITE_FOLDER%\%PLAYNITE_VBS_NAME%"
|
||||
SET "PLAYNITE_XML_NAME=DelayedExplorerStartTask.xml"
|
||||
SET "PLAYNITE_XML_PATH=%PLAYNITE_FOLDER%\%PLAYNITE_XML_NAME%"
|
||||
|
||||
echo ================================
|
||||
echo DISABLING GAMESDOWS / REMOVING CUSTOM SHELL
|
||||
echo ================================
|
||||
|
||||
:: 1) Reset the default shell to Explorer
|
||||
echo [1/5] Resetting default shell to Explorer...
|
||||
REG ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" ^
|
||||
/v "Shell" /t REG_SZ /d "C:\Windows\explorer.exe" /f
|
||||
if ERRORLEVEL 1 (
|
||||
echo [ERROR] Failed to reset the default shell.
|
||||
goto end
|
||||
) else (
|
||||
echo [SUCCESS] Default shell reset to Explorer.
|
||||
)
|
||||
|
||||
:: 2) Delete any existing DelayedExplorerStart.bat in Steam folder
|
||||
echo [2/5] Deleting DelayedExplorerStart.bat from Steam folder...
|
||||
IF EXIST "%STEAM_SCRIPT_PATH%" (
|
||||
DEL /F /Q "%STEAM_SCRIPT_PATH%"
|
||||
if ERRORLEVEL 1 (
|
||||
echo [WARNING] Could not delete %STEAM_SCRIPT_NAME%.
|
||||
) else (
|
||||
echo [SUCCESS] %STEAM_SCRIPT_NAME% deleted.
|
||||
)
|
||||
) else (
|
||||
echo [INFO] %STEAM_SCRIPT_NAME% does not exist in Steam folder.
|
||||
)
|
||||
|
||||
:: 2b) Delete any existing DelayedExplorerStart.bat in Playnite folder
|
||||
echo [2b/5] Deleting DelayedExplorerStart.bat from Playnite folder...
|
||||
IF EXIST "%PLAYNITE_SCRIPT_PATH%" (
|
||||
DEL /F /Q "%PLAYNITE_SCRIPT_PATH%"
|
||||
if ERRORLEVEL 1 (
|
||||
echo [WARNING] Could not delete %PLAYNITE_SCRIPT_NAME%.
|
||||
) else (
|
||||
echo [SUCCESS] %PLAYNITE_SCRIPT_NAME% deleted.
|
||||
)
|
||||
) else (
|
||||
echo [INFO] %PLAYNITE_SCRIPT_NAME% does not exist in Playnite folder.
|
||||
)
|
||||
|
||||
:: 3) Delete any existing RunBatchSilently.vbs in Steam folder
|
||||
echo [3/5] Deleting RunBatchSilently.vbs from Steam folder...
|
||||
IF EXIST "%STEAM_VBS_PATH%" (
|
||||
DEL /F /Q "%STEAM_VBS_PATH%"
|
||||
if ERRORLEVEL 1 (
|
||||
echo [WARNING] Could not delete %STEAM_VBS_NAME%.
|
||||
) else (
|
||||
echo [SUCCESS] %STEAM_VBS_NAME% deleted.
|
||||
)
|
||||
) else (
|
||||
echo [INFO] %STEAM_VBS_NAME% does not exist in Steam folder.
|
||||
)
|
||||
|
||||
:: 3b) Delete any existing RunBatchSilently.vbs in Playnite folder
|
||||
echo [3b/5] Deleting RunBatchSilently.vbs from Playnite folder...
|
||||
IF EXIST "%PLAYNITE_VBS_PATH%" (
|
||||
DEL /F /Q "%PLAYNITE_VBS_PATH%"
|
||||
if ERRORLEVEL 1 (
|
||||
echo [WARNING] Could not delete %PLAYNITE_VBS_NAME%.
|
||||
) else (
|
||||
echo [SUCCESS] %PLAYNITE_VBS_NAME% deleted.
|
||||
)
|
||||
) else (
|
||||
echo [INFO] %PLAYNITE_VBS_NAME% does not exist in Playnite folder.
|
||||
)
|
||||
|
||||
:: 4) Delete any existing DelayedExplorerStartTask.xml in Steam folder
|
||||
echo [4/5] Deleting DelayedExplorerStartTask.xml from Steam folder...
|
||||
IF EXIST "%STEAM_XML_PATH%" (
|
||||
DEL /F /Q "%STEAM_XML_PATH%"
|
||||
if ERRORLEVEL 1 (
|
||||
echo [WARNING] Could not delete %STEAM_XML_NAME%.
|
||||
) else (
|
||||
echo [SUCCESS] %STEAM_XML_NAME% deleted.
|
||||
)
|
||||
) else (
|
||||
echo [INFO] %STEAM_XML_NAME% does not exist in Steam folder.
|
||||
)
|
||||
|
||||
:: 4b) Delete any existing DelayedExplorerStartTask.xml in Playnite folder
|
||||
echo [4b/5] Deleting DelayedExplorerStartTask.xml from Playnite folder...
|
||||
IF EXIST "%PLAYNITE_XML_PATH%" (
|
||||
DEL /F /Q "%PLAYNITE_XML_PATH%"
|
||||
if ERRORLEVEL 1 (
|
||||
echo [WARNING] Could not delete %PLAYNITE_XML_NAME%.
|
||||
) else (
|
||||
echo [SUCCESS] %PLAYNITE_XML_NAME% deleted.
|
||||
)
|
||||
) else (
|
||||
echo [INFO] %PLAYNITE_XML_NAME% does not exist in Playnite folder.
|
||||
)
|
||||
|
||||
:: 5) Delete the scheduled task (if it exists)
|
||||
echo [5/5] Deleting scheduled task 'RunDelayedExplorerStart'...
|
||||
schtasks /delete /tn "RunDelayedExplorerStart" /f >nul 2>&1
|
||||
if ERRORLEVEL 1 (
|
||||
echo [WARNING] Could not delete the scheduled task 'RunDelayedExplorerStart'.
|
||||
) else (
|
||||
echo [SUCCESS] Scheduled task 'RunDelayedExplorerStart' deleted.
|
||||
)
|
||||
|
||||
echo.
|
||||
echo ================================
|
||||
echo GamesDows has been disabled successfully.
|
||||
echo All Playnite/Steam scripts removed.
|
||||
echo The default shell is now Explorer.
|
||||
echo A system restart is recommended.
|
||||
echo ================================
|
||||
|
||||
:end
|
||||
ENDLOCAL
|
||||
pause
|
@ -1,9 +1,31 @@
|
||||
@echo off
|
||||
SETLOCAL EnableExtensions EnableDelayedExpansion
|
||||
:: Self-elevating Admin script
|
||||
:: This script will automatically request admin rights if not running as admin
|
||||
|
||||
:: Check for admin rights and self-elevate if needed
|
||||
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
|
||||
if '%errorlevel%' NEQ '0' (
|
||||
echo Requesting administrative privileges...
|
||||
goto UACPrompt
|
||||
) else (
|
||||
goto GotAdmin
|
||||
)
|
||||
|
||||
:UACPrompt
|
||||
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
|
||||
echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"
|
||||
"%temp%\getadmin.vbs"
|
||||
exit /B
|
||||
|
||||
:GotAdmin
|
||||
if exist "%temp%\getadmin.vbs" del "%temp%\getadmin.vbs"
|
||||
pushd "%CD%"
|
||||
CD /D "%~dp0"
|
||||
|
||||
echo Setting Playnite as default shell
|
||||
|
||||
SET "KEY_NAME=HKCU\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon"
|
||||
echo Set Playnite as the default shell
|
||||
SET "KEY_NAME=HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon"
|
||||
SET "VALUE_NAME=Shell"
|
||||
SET "PLAYNITE_FOLDER=%LOCALAPPDATA%\Playnite"
|
||||
SET "PLAYNITE_PATH=%LOCALAPPDATA%\Playnite\Playnite.FullscreenApp.exe"
|
||||
@ -11,8 +33,9 @@ REG ADD "%KEY_NAME%" /v %VALUE_NAME% /t REG_SZ /d "%PLAYNITE_PATH%" /f
|
||||
SET "SCRIPT_NAME=DelayedExplorerStart.bat"
|
||||
SET "SCRIPT_PATH=%PLAYNITE_FOLDER%\%SCRIPT_NAME%"
|
||||
SET "EXPLORER_PATH=C:\Windows\explorer.exe"
|
||||
SET "VBS_NAME=RunBatchSilently.vbs"
|
||||
SET "VBS_PATH=%PLAYNITE_FOLDER%\%VBS_NAME%"
|
||||
|
||||
@echo off
|
||||
SETLOCAL EnableExtensions EnableDelayedExpansion
|
||||
|
||||
echo Creating DelayedExplorerStart.bat script
|
||||
|
||||
@ -23,11 +46,11 @@ echo rem Check if user is logged on
|
||||
echo whoami ^| find /i "%USERNAME%" ^>nul
|
||||
echo if ERRORLEVEL 1 exit
|
||||
echo rem Set Shell back to Explorer
|
||||
echo REG ADD "HKCU\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v Shell /t REG_SZ /d "%EXPLORER_PATH%" /f
|
||||
echo REG ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v Shell /t REG_SZ /d "%EXPLORER_PATH%" /f
|
||||
echo timeout /t 20 /nobreak ^>nul
|
||||
echo start C:\Windows\explorer.exe
|
||||
echo powershell -WindowStyle Hidden -NoProfile -Command "Start-Process explorer.exe"
|
||||
echo timeout /t 10 /nobreak ^>nul
|
||||
echo REG ADD "HKCU\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v Shell /t REG_SZ /d "%PLAYNITE_PATH%" /f
|
||||
echo REG ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v Shell /t REG_SZ /d "%PLAYNITE_PATH%" /f
|
||||
) > "%SCRIPT_PATH%"
|
||||
|
||||
|
||||
@ -35,7 +58,10 @@ echo %VBS_PATH%
|
||||
|
||||
echo Creating RunBatchSilently.vbs script
|
||||
|
||||
rem Create VBScript to run the batch file silently
|
||||
:: Create VBScript to run the batch file silently
|
||||
@echo off
|
||||
SET "VBS_NAME=RunBatchSilently.vbs"
|
||||
SET "VBS_PATH=%PLAYNITE_FOLDER%\%VBS_NAME%"
|
||||
echo Set WshShell = CreateObject("WScript.Shell") > "%VBS_PATH%"
|
||||
echo WshShell.Run chr(34)^&"%SCRIPT_PATH%"^&chr(34), 0, True >> "%VBS_PATH%"
|
||||
echo Set WshShell = Nothing >> "%VBS_PATH%"
|
||||
@ -107,7 +133,7 @@ bcdedit.exe -set {globalsettings} bootuxdisabled on
|
||||
|
||||
echo Disable Logon UI
|
||||
|
||||
reg add "HKCU\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v DisableLogonUI /t REG_DWORD /d 1 /f
|
||||
reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v DisableLogonUI /t REG_DWORD /d 1 /f
|
||||
|
||||
echo Disable Visual Effects
|
||||
reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v VisualEffects /t REG_DWORD /d 3 /f
|
||||
|
@ -1,62 +1,62 @@
|
||||
@echo off
|
||||
SETLOCAL EnableExtensions
|
||||
:: Self-elevating Admin script
|
||||
:: This script will automatically request admin rights if not running as admin
|
||||
|
||||
rem Check for admin rights and self-elevate if needed
|
||||
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
|
||||
if '%errorlevel%' NEQ '0' (
|
||||
echo Requesting administrative privileges...
|
||||
goto UACPrompt
|
||||
) else (
|
||||
goto GotAdmin
|
||||
)
|
||||
|
||||
:UACPrompt
|
||||
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
|
||||
echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"
|
||||
"%temp%\getadmin.vbs"
|
||||
exit /B
|
||||
|
||||
:GotAdmin
|
||||
if exist "%temp%\getadmin.vbs" del "%temp%\getadmin.vbs"
|
||||
pushd "%CD%"
|
||||
CD /D "%~dp0"
|
||||
|
||||
SETLOCAL EnableExtensions EnableDelayedExpansion
|
||||
echo Running with administrative privileges...
|
||||
echo Setting Steam Big Picture as default shell
|
||||
|
||||
|
||||
echo Set Steam Big Picture as the default shell
|
||||
SET "KEY_NAME=HKCU\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon"
|
||||
SET "KEY_NAME=HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon"
|
||||
SET "VALUE_NAME=Shell"
|
||||
SET "STEAM_PATH=C:\Program Files (x86)\Steam\Steam.exe -bigpicture -nobootstrapupdate -skipinitialbootstrap -skipverifyfiles"
|
||||
REG ADD "%KEY_NAME%" /v %VALUE_NAME% /t REG_SZ /d "%STEAM_PATH%" /f
|
||||
|
||||
@echo off
|
||||
SETLOCAL EnableExtensions EnableDelayedExpansion
|
||||
|
||||
echo Define the default Steam folder path and script names
|
||||
SET "STEAM_FOLDER=C:\Program Files (x86)\Steam"
|
||||
SET "SCRIPT_NAME=DelayedExplorerStart.bat"
|
||||
SET "SCRIPT_PATH=%STEAM_FOLDER%\%SCRIPT_NAME%"
|
||||
SET "EXPLORER_PATH=C:\Windows\explorer.exe"
|
||||
SET "MANIFEST_PATH=%STEAM_PATH%.manifest"
|
||||
SET "STEAM_EXE=C:\Program Files (x86)\Steam\Steam.exe"
|
||||
SET "MANIFEST_PATH=%STEAM_EXE%.manifest"
|
||||
|
||||
:: Create the manifest file to force admin privileges for Steam
|
||||
echo Creating manifest file for Steam to run as admin...
|
||||
(
|
||||
echo ^<?xml version="1.0" encoding="UTF-8" standalone="yes"?^>
|
||||
echo ^<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"^>
|
||||
echo ^<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2"^>
|
||||
echo ^<security^>
|
||||
echo ^<requestedPrivileges^>
|
||||
echo ^<requestedExecutionLevel level="requireAdministrator" uiAccess="false"/^>
|
||||
echo ^</requestedPrivileges^>
|
||||
echo ^</security^>
|
||||
echo ^</trustInfo^>
|
||||
echo ^</assembly^>
|
||||
) > "%MANIFEST_PATH%"
|
||||
echo Copying pre-created manifest file...
|
||||
copy "%~dp0steam.manifest" "%MANIFEST_PATH%" >nul 2>&1
|
||||
|
||||
echo Creating DelayedExplorerStart.bat script
|
||||
|
||||
echo Create the DelayedExplorerStart.bat script in the Steam folder
|
||||
(
|
||||
echo @echo off
|
||||
echo rem Check if user is logged on
|
||||
echo whoami ^| find /i "%%USERNAME%%" ^>nul
|
||||
echo Check if user is logged on
|
||||
echo whoami ^| find /i "%USERNAME%" ^>nul
|
||||
echo if ERRORLEVEL 1 exit
|
||||
echo rem Set Shell back to Explorer
|
||||
echo REG ADD "HKCU\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v Shell /t REG_SZ /d "%%EXPLORER_PATH%%" /f
|
||||
echo Set Shell back to Explorer
|
||||
echo REG ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v Shell /t REG_SZ /d "%EXPLORER_PATH%" /f
|
||||
echo timeout /t 20 /nobreak ^>nul
|
||||
|
||||
echo rem Launch Explorer minimized without stealing focus by using a temporary VBScript
|
||||
echo set "TempVBS=%%TEMP%%\LaunchExplorerMinimized.vbs"
|
||||
echo (echo Set WshShell = CreateObject("WScript.Shell"))>"%%TempVBS%%"
|
||||
echo (echo ' 7 = Minimized & no focus) >>"%%TempVBS%%"
|
||||
echo (echo WshShell.Run "explorer.exe", 7, False)>>"%%TempVBS%%"
|
||||
echo (echo Set WshShell = Nothing)>>"%%TempVBS%%"
|
||||
echo cscript //nologo "%%TempVBS%%"
|
||||
echo del "%%TempVBS%%"
|
||||
|
||||
echo powershell -WindowStyle Hidden -NoProfile -Command "Start-Process explorer.exe"
|
||||
echo timeout /t 10 /nobreak ^>nul
|
||||
echo REG ADD "HKCU\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v Shell /t REG_SZ /d "%%STEAM_PATH%%" /f
|
||||
echo REG ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v Shell /t REG_SZ /d "%STEAM_PATH%" /f
|
||||
) > "%SCRIPT_PATH%"
|
||||
|
||||
|
||||
@ -125,7 +125,7 @@ echo ^</Task^>
|
||||
) > "%XML_PATH%"
|
||||
|
||||
echo Delete the existing scheduled task if it exists
|
||||
schtasks /delete /tn "RunDelayedExplorerStart" /f /ru "%USERNAME%"
|
||||
schtasks /delete /tn "RunDelayedExplorerStart" /f
|
||||
|
||||
echo Create the scheduled task using the XML file
|
||||
schtasks /create /tn "RunDelayedExplorerStart" /xml "%XML_PATH%" /ru "%USERNAME%"
|
||||
@ -139,7 +139,7 @@ bcdedit.exe -set {globalsettings} bootuxdisabled on
|
||||
|
||||
echo Disable Logon UI
|
||||
|
||||
reg add "HKCU\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v DisableLogonUI /t REG_DWORD /d 1 /f
|
||||
reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v DisableLogonUI /t REG_DWORD /d 1 /f
|
||||
|
||||
echo Disable Visual Effects
|
||||
reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v VisualEffects /t REG_DWORD /d 3 /f
|
||||
|
38
README.md
38
README.md
@ -1,4 +1,6 @@
|
||||
Transform your Windows Computer into a Video Game console first, PC second!
|
||||
Transform your Windows Computer into a Video Game console first, PC second! GamesDows is intended to emulate Steam OS's "Game Mode" as closely as possible.
|
||||
|
||||
**New: Now with Decky Loader support for Windows!**
|
||||
|
||||
**This script is a WIP. Currently, the main functionality works as intended. Steam Big Picture (or Playnite) launches automatically when the OS boots with high priority set as as the shell, then explorer starts automatically after a delay, which allows you to exit to desktop via the menu without needing to launch a shortcut for Explorer.exe first.**
|
||||
|
||||
@ -69,3 +71,37 @@ What remains to be fixed:
|
||||
I will gladly take PRs to fix the 3 remaining issues if anyone knows how to solve them.
|
||||
|
||||
**Note: If for any reason explorer doesn't start and you get a black screen and cannot view the desktop, it needs to be launched manually via task manager by launching explorer.exe. It needs to be set as the shell first before it is launched from task manager for the desktop to appear when launched a single time, otherwise it will just launch a file browser window. Due to this limitation, you must start explorer.exe twice from task manager to load the Desktop**
|
||||
|
||||
-------------------
|
||||
# Decky Loader for Windows
|
||||
|
||||
https://github.com/ACCESS-DENIIED/Decky-Loader-For-Windows
|
||||
|
||||
ACCESS-DENIIED's Decky Install Scripts are now included with GamesDows! Just run the separate install-decky.bat to get Decky automatically installed and configured for Steam! **Please ensure Python and Steam have already been installed and configured, and make sure to already be signed into Steam before running the install script for Decky!**
|
||||
|
||||
**Please make sure to check the original thread for the caveats described by ACCESS-DENIIED, the author of the Decky install scripts:**
|
||||
|
||||
https://www.reddit.com/r/WindowsOnDeck/comments/1hl40i5/i_created_a_python_script_to_install_decky_loader/
|
||||
|
||||
Below is the description of these scripts from ACCESS-DENIIED's repo:
|
||||
|
||||
A Work-in-progress Python-based installer and build system for Decky Loader on Windows. This tool automates the entire process of building, installing, and configuring Decky Loader - bringing the Steam Deck's popular plugin system to Windows.
|
||||
|
||||
## Features
|
||||
- 🚀 Simple installation and build process
|
||||
- ⚙️ Automatic dependency management (Node.js, npm, pnpm, Python)
|
||||
- 🔧 Configures Steam for plugin development
|
||||
- 🏃♂️ Sets up autostart for PluginLoader
|
||||
- 📁 Creates proper homebrew directory structure
|
||||
- 💻 Builds both console and GUI executables
|
||||
|
||||
## Requirements
|
||||
- Windows 10/11
|
||||
- Steam installation
|
||||
- Internet connection for downloading dependencies
|
||||
|
||||
## Usage
|
||||
Download the files or the zip in the releases section, run the Enable GamesDows script for either Steam or Playnite.
|
||||
|
||||
If you would also like to install Decky Loader, run "install_decky.bat" as administrator and follow the prompts. This script is not necessary for GamesDows to function, it enables the Decky Loader plugin system for Steam. I've included it in this project as it brings Windows one step closer to Steam OS functionality.
|
||||
|
||||
|
BIN
decky/Decky.Loader.Installer.zip
Normal file
BIN
decky/Decky.Loader.Installer.zip
Normal file
Binary file not shown.
830
decky_builder.py
830
decky_builder.py
@ -1,830 +0,0 @@
|
||||
import os
|
||||
import subprocess
|
||||
import shutil
|
||||
import argparse
|
||||
from pathlib import Path
|
||||
import sys
|
||||
import time
|
||||
import PyInstaller
|
||||
import atexit
|
||||
import requests
|
||||
import psutil
|
||||
import re
|
||||
|
||||
class DeckyBuilder:
|
||||
def __init__(self, release: str = None):
|
||||
self.release = release or self.prompt_for_version()
|
||||
self.root_dir = Path(__file__).resolve().parent
|
||||
self.app_dir = self.root_dir / "app"
|
||||
self.src_dir = self.root_dir / "src"
|
||||
self.dist_dir = self.root_dir / "dist"
|
||||
self.homebrew_dir = self.dist_dir / "homebrew"
|
||||
self.temp_files = [] # Track temporary files for cleanup
|
||||
atexit.register(self.cleanup) # Register cleanup on exit
|
||||
|
||||
# Setup user homebrew directory
|
||||
self.user_home = Path.home()
|
||||
self.user_homebrew_dir = self.user_home / "homebrew"
|
||||
self.homebrew_folders = [
|
||||
"data",
|
||||
"logs",
|
||||
"plugins",
|
||||
"services",
|
||||
"settings",
|
||||
"themes"
|
||||
]
|
||||
|
||||
def cleanup(self):
|
||||
"""Clean up temporary files and directories"""
|
||||
try:
|
||||
# Clean up any temporary files we created
|
||||
for temp_file in self.temp_files:
|
||||
if os.path.exists(temp_file):
|
||||
try:
|
||||
if os.path.isfile(temp_file):
|
||||
os.remove(temp_file)
|
||||
elif os.path.isdir(temp_file):
|
||||
shutil.rmtree(temp_file, ignore_errors=True)
|
||||
except Exception as e:
|
||||
print(f"Warning: Failed to remove temporary file {temp_file}: {e}")
|
||||
|
||||
# Clean up PyInstaller temp files
|
||||
for dir_name in ['build', 'dist']:
|
||||
dir_path = self.root_dir / dir_name
|
||||
if dir_path.exists():
|
||||
try:
|
||||
shutil.rmtree(dir_path, ignore_errors=True)
|
||||
except Exception as e:
|
||||
print(f"Warning: Failed to remove {dir_name} directory: {e}")
|
||||
|
||||
# Clean up PyInstaller spec files
|
||||
for spec_file in self.root_dir.glob("*.spec"):
|
||||
try:
|
||||
os.remove(spec_file)
|
||||
except Exception as e:
|
||||
print(f"Warning: Failed to remove spec file {spec_file}: {e}")
|
||||
|
||||
except Exception as e:
|
||||
print(f"Warning: Error during cleanup: {e}")
|
||||
|
||||
def safe_remove_directory(self, path):
|
||||
"""Safely remove a directory with retries for Windows"""
|
||||
max_retries = 3
|
||||
retry_delay = 1 # seconds
|
||||
|
||||
for attempt in range(max_retries):
|
||||
try:
|
||||
if path.exists():
|
||||
# On Windows, sometimes we need to remove .git directory separately
|
||||
git_dir = path / '.git'
|
||||
if git_dir.exists():
|
||||
for item in git_dir.glob('**/*'):
|
||||
if item.is_file():
|
||||
try:
|
||||
item.chmod(0o777) # Give full permissions
|
||||
item.unlink()
|
||||
except:
|
||||
pass
|
||||
|
||||
shutil.rmtree(path, ignore_errors=True)
|
||||
return
|
||||
except Exception as e:
|
||||
print(f"Attempt {attempt + 1} failed to remove {path}: {str(e)}")
|
||||
if attempt < max_retries - 1:
|
||||
time.sleep(retry_delay)
|
||||
continue
|
||||
else:
|
||||
print(f"Warning: Could not fully remove {path}. Continuing anyway...")
|
||||
|
||||
def setup_directories(self):
|
||||
"""Setup directory structure"""
|
||||
print("Setting up directories...")
|
||||
# Clean up any existing directories
|
||||
if self.app_dir.exists():
|
||||
self.safe_remove_directory(self.app_dir)
|
||||
if self.src_dir.exists():
|
||||
self.safe_remove_directory(self.src_dir)
|
||||
if self.homebrew_dir.exists():
|
||||
self.safe_remove_directory(self.homebrew_dir)
|
||||
|
||||
# Create fresh directories
|
||||
self.src_dir.mkdir(parents=True, exist_ok=True)
|
||||
self.homebrew_dir.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
def setup_homebrew(self):
|
||||
"""Setup homebrew directory structure"""
|
||||
print("Setting up homebrew directory structure...")
|
||||
# Create dist directory
|
||||
(self.homebrew_dir / "dist").mkdir(parents=True, exist_ok=True)
|
||||
|
||||
# Setup homebrew directory structure for both temp and user directories
|
||||
print("Setting up homebrew directory structure...")
|
||||
for directory in [self.homebrew_dir, self.user_homebrew_dir]:
|
||||
if not directory.exists():
|
||||
directory.mkdir(parents=True)
|
||||
|
||||
for folder in self.homebrew_folders:
|
||||
folder_path = directory / folder
|
||||
if not folder_path.exists():
|
||||
folder_path.mkdir(parents=True)
|
||||
|
||||
def clone_repository(self):
|
||||
"""Clone Decky Loader repository and checkout specific version"""
|
||||
print(f"\nCloning Decky Loader repository version: {self.release}")
|
||||
|
||||
# Clean up existing directory
|
||||
if os.path.exists(self.app_dir):
|
||||
print("Removing existing repository...")
|
||||
self.safe_remove_directory(self.app_dir)
|
||||
|
||||
try:
|
||||
# Clone the repository
|
||||
subprocess.run([
|
||||
'git', 'clone', '--no-checkout', # Don't checkout anything yet
|
||||
'https://github.com/SteamDeckHomebrew/decky-loader.git',
|
||||
str(self.app_dir)
|
||||
], check=True)
|
||||
|
||||
os.chdir(self.app_dir)
|
||||
|
||||
# Fetch all refs
|
||||
subprocess.run(['git', 'fetch', '--all', '--tags'], check=True)
|
||||
|
||||
# Try to checkout the exact version first
|
||||
try:
|
||||
subprocess.run(['git', 'checkout', self.release], check=True)
|
||||
except subprocess.CalledProcessError:
|
||||
# If exact version fails, try to find the commit for pre-releases
|
||||
if '-pre' in self.release:
|
||||
# Get all tags and their commit hashes
|
||||
result = subprocess.run(
|
||||
['git', 'ls-remote', '--tags', 'origin'],
|
||||
capture_output=True, text=True, check=True
|
||||
)
|
||||
|
||||
# Find the commit hash for our version
|
||||
for line in result.stdout.splitlines():
|
||||
commit_hash, ref = line.split('\t')
|
||||
ref = ref.replace('refs/tags/', '')
|
||||
ref = ref.replace('^{}', '') # Remove annotated tag suffix
|
||||
if ref == self.release:
|
||||
print(f"Found commit {commit_hash} for version {self.release}")
|
||||
subprocess.run(['git', 'checkout', commit_hash], check=True)
|
||||
break
|
||||
else:
|
||||
raise Exception(f"Could not find commit for version {self.release}")
|
||||
else:
|
||||
raise
|
||||
|
||||
print(f"Successfully checked out version: {self.release}")
|
||||
|
||||
# Create version files in key locations with the requested version
|
||||
version_files = [
|
||||
'.loader.version',
|
||||
'frontend/.loader.version',
|
||||
'backend/.loader.version',
|
||||
'backend/decky_loader/.loader.version'
|
||||
]
|
||||
|
||||
for version_file in version_files:
|
||||
file_path = os.path.join(self.app_dir, version_file)
|
||||
os.makedirs(os.path.dirname(file_path), exist_ok=True)
|
||||
with open(file_path, 'w') as f:
|
||||
f.write(self.release) # Use the requested version
|
||||
|
||||
except subprocess.CalledProcessError as e:
|
||||
raise Exception(f"Failed to clone/checkout repository: {str(e)}")
|
||||
finally:
|
||||
os.chdir(self.root_dir)
|
||||
|
||||
def build_frontend(self):
|
||||
"""Build frontend files"""
|
||||
print("Building frontend...")
|
||||
batch_file = None
|
||||
original_dir = os.getcwd()
|
||||
|
||||
try:
|
||||
frontend_dir = self.app_dir / "frontend"
|
||||
if not frontend_dir.exists():
|
||||
raise Exception(f"Frontend directory not found at {frontend_dir}")
|
||||
|
||||
print(f"Changing to frontend directory: {frontend_dir}")
|
||||
os.chdir(frontend_dir)
|
||||
|
||||
# Create .loader.version file with the release tag
|
||||
version_file = frontend_dir / ".loader.version"
|
||||
with open(version_file, "w") as f:
|
||||
f.write(self.release)
|
||||
self.temp_files.append(str(version_file))
|
||||
|
||||
# Create a batch file to run the commands
|
||||
batch_file = frontend_dir / "build_frontend.bat"
|
||||
with open(batch_file, "w") as f:
|
||||
f.write("@echo off\n")
|
||||
f.write("call pnpm install\n")
|
||||
f.write("if %errorlevel% neq 0 exit /b %errorlevel%\n")
|
||||
f.write("call pnpm run build\n")
|
||||
f.write("if %errorlevel% neq 0 exit /b %errorlevel%\n")
|
||||
self.temp_files.append(str(batch_file))
|
||||
|
||||
print("Running build commands...")
|
||||
result = subprocess.run([str(batch_file)], check=True, capture_output=True, text=True, shell=True)
|
||||
print(result.stdout)
|
||||
|
||||
except subprocess.CalledProcessError as e:
|
||||
print(f"Command failed: {e.cmd}")
|
||||
print(f"Output: {e.output}")
|
||||
print(f"Error: {e.stderr}")
|
||||
raise Exception(f"Error building frontend: Command failed - {str(e)}")
|
||||
except Exception as e:
|
||||
print(f"Error building frontend: {str(e)}")
|
||||
raise
|
||||
finally:
|
||||
# Always return to original directory
|
||||
os.chdir(original_dir)
|
||||
|
||||
def prepare_backend(self):
|
||||
"""Prepare backend files for building."""
|
||||
print("Preparing backend files...")
|
||||
print("Copying files according to Dockerfile structure...")
|
||||
|
||||
# Create src directory if it doesn't exist
|
||||
os.makedirs(self.src_dir, exist_ok=True)
|
||||
|
||||
# Copy backend files from app/backend/decky_loader to src/decky_loader
|
||||
print("Copying backend files...")
|
||||
shutil.copytree(os.path.join(self.app_dir, "backend", "decky_loader"),
|
||||
os.path.join(self.src_dir, "decky_loader"),
|
||||
dirs_exist_ok=True)
|
||||
|
||||
# Copy static, locales, and plugin directories to maintain decky_loader structure
|
||||
os.makedirs(os.path.join(self.src_dir, "decky_loader"), exist_ok=True)
|
||||
shutil.copytree(os.path.join(self.app_dir, "backend", "decky_loader", "static"),
|
||||
os.path.join(self.src_dir, "decky_loader", "static"),
|
||||
dirs_exist_ok=True)
|
||||
shutil.copytree(os.path.join(self.app_dir, "backend", "decky_loader", "locales"),
|
||||
os.path.join(self.src_dir, "decky_loader", "locales"),
|
||||
dirs_exist_ok=True)
|
||||
shutil.copytree(os.path.join(self.app_dir, "backend", "decky_loader", "plugin"),
|
||||
os.path.join(self.src_dir, "decky_loader", "plugin"),
|
||||
dirs_exist_ok=True)
|
||||
|
||||
# Create legacy directory
|
||||
os.makedirs(os.path.join(self.src_dir, "src", "legacy"), exist_ok=True)
|
||||
|
||||
# Copy main.py to src directory
|
||||
shutil.copy2(os.path.join(self.app_dir, "backend", "main.py"),
|
||||
os.path.join(self.src_dir, "main.py"))
|
||||
|
||||
# Create version file in the src directory
|
||||
version_file = os.path.join(self.src_dir, ".loader.version")
|
||||
with open(version_file, "w") as f:
|
||||
f.write(self.release)
|
||||
|
||||
print("Backend preparation completed successfully!")
|
||||
return True
|
||||
|
||||
def install_requirements(self):
|
||||
"""Install Python requirements"""
|
||||
print("Installing Python requirements...")
|
||||
try:
|
||||
# Try both requirements.txt and pyproject.toml
|
||||
requirements_file = self.app_dir / "backend" / "requirements.txt"
|
||||
pyproject_file = self.app_dir / "backend" / "pyproject.toml"
|
||||
|
||||
if requirements_file.exists():
|
||||
subprocess.run([
|
||||
sys.executable, "-m", "pip", "install", "--user", "-r", str(requirements_file)
|
||||
], check=True)
|
||||
elif pyproject_file.exists():
|
||||
# Install core dependencies directly instead of using poetry
|
||||
dependencies = [
|
||||
"aiohttp>=3.8.1",
|
||||
"psutil>=5.9.0",
|
||||
"fastapi>=0.78.0",
|
||||
"uvicorn>=0.17.6",
|
||||
"python-multipart>=0.0.5",
|
||||
"watchdog>=2.1.7",
|
||||
"requests>=2.27.1",
|
||||
"setuptools>=60.0.0",
|
||||
"wheel>=0.37.1",
|
||||
"winregistry>=1.1.1; platform_system == 'Windows'",
|
||||
"pywin32>=303; platform_system == 'Windows'"
|
||||
]
|
||||
|
||||
# Install each dependency
|
||||
for dep in dependencies:
|
||||
try:
|
||||
subprocess.run([
|
||||
sys.executable, "-m", "pip", "install", "--user", dep
|
||||
], check=True)
|
||||
except subprocess.CalledProcessError as e:
|
||||
print(f"Warning: Failed to install {dep}: {str(e)}")
|
||||
continue
|
||||
else:
|
||||
print("Warning: No requirements.txt or pyproject.toml found")
|
||||
except Exception as e:
|
||||
print(f"Error installing requirements: {str(e)}")
|
||||
raise
|
||||
|
||||
def add_defender_exclusion(self, path):
|
||||
"""Add Windows Defender exclusion for a path"""
|
||||
try:
|
||||
subprocess.run([
|
||||
"powershell",
|
||||
"-Command",
|
||||
f"Add-MpPreference -ExclusionPath '{path}'"
|
||||
], check=True, capture_output=True)
|
||||
return True
|
||||
except:
|
||||
print("Warning: Could not add Windows Defender exclusion. You may need to run as administrator or manually add an exclusion.")
|
||||
return False
|
||||
|
||||
def remove_defender_exclusion(self, path):
|
||||
"""Remove Windows Defender exclusion for a path"""
|
||||
try:
|
||||
subprocess.run([
|
||||
"powershell",
|
||||
"-Command",
|
||||
f"Remove-MpPreference -ExclusionPath '{path}'"
|
||||
], check=True, capture_output=True)
|
||||
except:
|
||||
print("Warning: Could not remove Windows Defender exclusion.")
|
||||
|
||||
def build_executables(self):
|
||||
"""Build executables using PyInstaller"""
|
||||
print("\nBuilding executables...")
|
||||
|
||||
# Read version from .loader.version
|
||||
version_file = os.path.join(self.app_dir, '.loader.version')
|
||||
if not os.path.exists(version_file):
|
||||
raise Exception("Version file not found. Run clone_repository first.")
|
||||
|
||||
with open(version_file, 'r') as f:
|
||||
version = f.read().strip()
|
||||
|
||||
# Normalize version for Python packaging
|
||||
# Convert v3.0.5-pre1 to 3.0.5rc1
|
||||
py_version = version.lstrip('v') # Remove v prefix
|
||||
if '-pre' in py_version:
|
||||
py_version = py_version.replace('-pre', 'rc')
|
||||
|
||||
print(f"Building version: {version} (Python package version: {py_version})")
|
||||
|
||||
original_dir = os.getcwd()
|
||||
backend_dir = os.path.join(self.app_dir, "backend")
|
||||
dist_dir = os.path.join(backend_dir, "dist")
|
||||
|
||||
# Add Windows Defender exclusion for build directories
|
||||
added_exclusion = self.add_defender_exclusion(backend_dir)
|
||||
|
||||
try:
|
||||
os.chdir(backend_dir)
|
||||
|
||||
# Create setup.py with the correct version
|
||||
setup_py = """
|
||||
from setuptools import setup, find_packages
|
||||
|
||||
setup(
|
||||
name="decky_loader",
|
||||
version="%s",
|
||||
packages=find_packages(),
|
||||
package_data={
|
||||
'decky_loader': [
|
||||
'locales/*',
|
||||
'static/*',
|
||||
'.loader.version'
|
||||
],
|
||||
},
|
||||
install_requires=[
|
||||
'aiohttp>=3.8.1',
|
||||
'certifi>=2022.6.15',
|
||||
'packaging>=21.3',
|
||||
'psutil>=5.9.1',
|
||||
'requests>=2.28.1',
|
||||
],
|
||||
)
|
||||
""" % py_version
|
||||
|
||||
with open("setup.py", "w") as f:
|
||||
f.write(setup_py)
|
||||
|
||||
# Install the package in development mode
|
||||
subprocess.run([sys.executable, "-m", "pip", "install", "-e", "."], check=True)
|
||||
|
||||
# Common PyInstaller arguments
|
||||
pyinstaller_args = [
|
||||
sys.executable,
|
||||
"-m",
|
||||
"PyInstaller",
|
||||
"--clean",
|
||||
"--noconfirm",
|
||||
"pyinstaller.spec"
|
||||
]
|
||||
|
||||
# First build console version
|
||||
print("Building PluginLoader.exe (console version)...")
|
||||
os.environ.pop('DECKY_NOCONSOLE', None) # Ensure env var is not set
|
||||
subprocess.run(pyinstaller_args, check=True)
|
||||
|
||||
# Then build no-console version
|
||||
print("Building PluginLoader_noconsole.exe...")
|
||||
os.environ['DECKY_NOCONSOLE'] = '1'
|
||||
subprocess.run(pyinstaller_args, check=True)
|
||||
|
||||
# Clean up environment
|
||||
os.environ.pop('DECKY_NOCONSOLE', None)
|
||||
|
||||
# Copy the built executables to dist
|
||||
os.makedirs(os.path.join(self.root_dir, "dist"), exist_ok=True)
|
||||
if os.path.exists(os.path.join("dist", "PluginLoader.exe")):
|
||||
shutil.copy2(
|
||||
os.path.join("dist", "PluginLoader.exe"),
|
||||
os.path.join(self.root_dir, "dist", "PluginLoader.exe")
|
||||
)
|
||||
else:
|
||||
raise Exception("PluginLoader.exe not found after build")
|
||||
|
||||
if os.path.exists(os.path.join("dist", "PluginLoader_noconsole.exe")):
|
||||
shutil.copy2(
|
||||
os.path.join("dist", "PluginLoader_noconsole.exe"),
|
||||
os.path.join(self.root_dir, "dist", "PluginLoader_noconsole.exe")
|
||||
)
|
||||
else:
|
||||
raise Exception("PluginLoader_noconsole.exe not found after build")
|
||||
|
||||
print("Successfully built executables")
|
||||
|
||||
except subprocess.CalledProcessError as e:
|
||||
raise Exception(f"Failed to build executables: {str(e)}")
|
||||
finally:
|
||||
if added_exclusion:
|
||||
self.remove_defender_exclusion(backend_dir)
|
||||
os.chdir(original_dir)
|
||||
|
||||
def install_files(self):
|
||||
"""Install files to homebrew directory"""
|
||||
print("\nInstalling files to homebrew directory...")
|
||||
|
||||
# Create homebrew directory if it doesn't exist
|
||||
homebrew_dir = os.path.join(os.path.expanduser("~"), "homebrew")
|
||||
services_dir = os.path.join(homebrew_dir, "services")
|
||||
os.makedirs(services_dir, exist_ok=True)
|
||||
|
||||
try:
|
||||
# Copy PluginLoader.exe and PluginLoader_noconsole.exe
|
||||
for exe_name in ["PluginLoader.exe", "PluginLoader_noconsole.exe"]:
|
||||
exe_source = os.path.join(self.root_dir, "dist", exe_name)
|
||||
exe_dest = os.path.join(services_dir, exe_name)
|
||||
if not os.path.exists(exe_source):
|
||||
raise Exception(f"{exe_name} not found at {exe_source}")
|
||||
shutil.copy2(exe_source, exe_dest)
|
||||
|
||||
# Create .loader.version file
|
||||
version_file = os.path.join(services_dir, ".loader.version")
|
||||
with open(version_file, "w") as f:
|
||||
f.write(self.release)
|
||||
|
||||
print("Successfully installed files")
|
||||
|
||||
except Exception as e:
|
||||
raise Exception(f"Failed to copy files to homebrew: {str(e)}")
|
||||
|
||||
def install_nodejs(self):
|
||||
"""Install Node.js v18.18.0 with npm"""
|
||||
print("Installing Node.js v18.18.0...")
|
||||
try:
|
||||
# First check if Node.js v18.18.0 is already installed in common locations
|
||||
nodejs_paths = [
|
||||
r"C:\Program Files\nodejs\node.exe",
|
||||
r"C:\Program Files (x86)\nodejs\node.exe",
|
||||
os.path.expandvars(r"%APPDATA%\Local\Programs\nodejs\node.exe")
|
||||
]
|
||||
|
||||
# Try to use existing Node.js 18.18.0 first
|
||||
for node_path in nodejs_paths:
|
||||
if os.path.exists(node_path):
|
||||
try:
|
||||
version = subprocess.run([node_path, "--version"], capture_output=True, text=True).stdout.strip()
|
||||
if version.startswith("v18.18.0"):
|
||||
print(f"Found Node.js {version} at {node_path}")
|
||||
node_dir = os.path.dirname(node_path)
|
||||
if node_dir not in os.environ["PATH"]:
|
||||
os.environ["PATH"] = node_dir + os.pathsep + os.environ["PATH"]
|
||||
return True
|
||||
except:
|
||||
continue
|
||||
|
||||
# If we get here, we need to install Node.js 18.18.0
|
||||
print("Installing Node.js v18.18.0...")
|
||||
|
||||
# Create temp directory for downloads
|
||||
temp_dir = self.root_dir / "temp"
|
||||
temp_dir.mkdir(exist_ok=True)
|
||||
|
||||
# Download Node.js installer
|
||||
node_installer = temp_dir / "node-v18.18.0-x64.msi"
|
||||
if not node_installer.exists():
|
||||
print("Downloading Node.js installer...")
|
||||
try:
|
||||
import urllib.request
|
||||
urllib.request.urlretrieve(
|
||||
"https://nodejs.org/dist/v18.18.0/node-v18.18.0-x64.msi",
|
||||
node_installer
|
||||
)
|
||||
except Exception as e:
|
||||
print(f"Error downloading Node.js installer: {str(e)}")
|
||||
raise
|
||||
|
||||
# Install Node.js silently
|
||||
print("Installing Node.js (this may take a few minutes)...")
|
||||
try:
|
||||
# First try to uninstall any existing Node.js using PowerShell
|
||||
uninstall_cmd = 'Get-WmiObject -Class Win32_Product | Where-Object { $_.Name -like "*Node.js*" } | ForEach-Object { $_.Uninstall() }'
|
||||
subprocess.run(["powershell", "-Command", uninstall_cmd], capture_output=True, timeout=60)
|
||||
|
||||
# Wait a bit for uninstallation to complete
|
||||
time.sleep(5)
|
||||
|
||||
# Now install Node.js 18.18.0
|
||||
subprocess.run(
|
||||
["msiexec", "/i", str(node_installer), "/qn", "ADDLOCAL=ALL"],
|
||||
check=True,
|
||||
timeout=300 # 5 minute timeout
|
||||
)
|
||||
|
||||
print("Waiting for Node.js installation to complete...")
|
||||
time.sleep(10)
|
||||
|
||||
# Add to PATH
|
||||
nodejs_path = r"C:\Program Files\nodejs"
|
||||
npm_path = os.path.join(os.environ["APPDATA"], "npm")
|
||||
|
||||
# Update PATH for current process
|
||||
if nodejs_path not in os.environ["PATH"]:
|
||||
os.environ["PATH"] = nodejs_path + os.pathsep + os.environ["PATH"]
|
||||
if npm_path not in os.environ["PATH"]:
|
||||
os.environ["PATH"] = npm_path + os.pathsep + os.environ["PATH"]
|
||||
|
||||
# Verify installation
|
||||
node_version = subprocess.run(["node", "--version"], capture_output=True, text=True, check=True).stdout.strip()
|
||||
if not node_version.startswith("v18.18.0"):
|
||||
raise Exception(f"Wrong Node.js version installed: {node_version}")
|
||||
|
||||
npm_version = subprocess.run(["npm", "--version"], capture_output=True, text=True, check=True).stdout.strip()
|
||||
print(f"Successfully installed Node.js {node_version} with npm {npm_version}")
|
||||
|
||||
# Clean up
|
||||
self.safe_remove_directory(temp_dir)
|
||||
return True
|
||||
|
||||
except subprocess.TimeoutExpired:
|
||||
print("Installation timed out. Please try installing Node.js v18.18.0 manually.")
|
||||
raise
|
||||
except Exception as e:
|
||||
print(f"Installation failed: {str(e)}")
|
||||
raise
|
||||
|
||||
except Exception as e:
|
||||
print(f"Error installing Node.js: {str(e)}")
|
||||
raise
|
||||
|
||||
def setup_steam_config(self):
|
||||
"""Configure Steam for Decky Loader"""
|
||||
print("Configuring Steam...")
|
||||
try:
|
||||
# Add -dev argument to Steam shortcut
|
||||
import winreg
|
||||
steam_path = None
|
||||
|
||||
# Try to find Steam installation path from registry
|
||||
try:
|
||||
with winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, r"SOFTWARE\WOW6432Node\Valve\Steam") as key:
|
||||
steam_path = winreg.QueryValueEx(key, "InstallPath")[0]
|
||||
except:
|
||||
try:
|
||||
with winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, r"SOFTWARE\Valve\Steam") as key:
|
||||
steam_path = winreg.QueryValueEx(key, "InstallPath")[0]
|
||||
except:
|
||||
print("Steam installation not found in registry")
|
||||
|
||||
if steam_path:
|
||||
steam_exe = Path(steam_path) / "steam.exe"
|
||||
if steam_exe.exists():
|
||||
# Create .cef-enable-remote-debugging file
|
||||
debug_file = Path(steam_path) / ".cef-enable-remote-debugging"
|
||||
debug_file.touch()
|
||||
print("Created .cef-enable-remote-debugging file")
|
||||
|
||||
# Create/modify Steam shortcut
|
||||
desktop = Path.home() / "Desktop"
|
||||
shortcut_path = desktop / "Steam.lnk"
|
||||
|
||||
import pythoncom
|
||||
from win32com.client import Dispatch
|
||||
|
||||
shell = Dispatch("WScript.Shell")
|
||||
shortcut = shell.CreateShortCut(str(shortcut_path))
|
||||
shortcut.Targetpath = str(steam_exe)
|
||||
shortcut.Arguments = "-dev"
|
||||
shortcut.save()
|
||||
print("Created Steam shortcut with -dev argument")
|
||||
|
||||
except Exception as e:
|
||||
print(f"Error configuring Steam: {str(e)}")
|
||||
raise
|
||||
|
||||
def setup_autostart(self):
|
||||
"""Setup PluginLoader to run at startup"""
|
||||
print("Setting up autostart...")
|
||||
try:
|
||||
# Get the path to the no-console executable
|
||||
services_dir = os.path.join(os.path.expanduser("~"), "homebrew", "services")
|
||||
plugin_loader = os.path.join(services_dir, "PluginLoader_noconsole.exe")
|
||||
|
||||
# Get the Windows Startup folder path
|
||||
startup_folder = os.path.join(os.environ["APPDATA"], "Microsoft", "Windows", "Start Menu", "Programs", "Startup")
|
||||
|
||||
# Create a batch file in the startup folder
|
||||
startup_bat = os.path.join(startup_folder, "start_decky.bat")
|
||||
|
||||
# Write the batch file with proper path escaping
|
||||
with open(startup_bat, "w") as f:
|
||||
f.write(f'@echo off\n"{plugin_loader}"')
|
||||
|
||||
print(f"Created startup script at: {startup_bat}")
|
||||
return True
|
||||
|
||||
except Exception as e:
|
||||
print(f"Error setting up autostart: {str(e)}")
|
||||
return False
|
||||
|
||||
def check_python_version(self):
|
||||
"""Check if correct Python version is being used"""
|
||||
print("Checking Python version...")
|
||||
if sys.version_info.major != 3 or sys.version_info.minor != 11:
|
||||
raise Exception("This script requires Python 3.11. Please run using decky_builder.bat")
|
||||
|
||||
def check_dependencies(self):
|
||||
"""Check and install required dependencies"""
|
||||
print("Checking dependencies...")
|
||||
try:
|
||||
# Check Node.js and npm first
|
||||
try:
|
||||
# Use shell=True to find node in PATH
|
||||
node_version = subprocess.run("node --version", shell=True, check=True, capture_output=True, text=True).stdout.strip()
|
||||
npm_version = subprocess.run("npm --version", shell=True, check=True, capture_output=True, text=True).stdout.strip()
|
||||
|
||||
# Check if version meets requirements
|
||||
if not node_version.startswith("v18."):
|
||||
print(f"Node.js {node_version} found, but v18.18.0 is required")
|
||||
self.install_nodejs()
|
||||
else:
|
||||
print(f"Node.js {node_version} with npm {npm_version} is installed")
|
||||
|
||||
except Exception as e:
|
||||
print(f"Node.js/npm not found or error: {str(e)}")
|
||||
self.install_nodejs()
|
||||
|
||||
# Install pnpm globally if not present
|
||||
try:
|
||||
pnpm_version = subprocess.run("pnpm --version", shell=True, check=True, capture_output=True, text=True).stdout.strip()
|
||||
print(f"pnpm version {pnpm_version} is installed")
|
||||
except:
|
||||
print("Installing pnpm globally...")
|
||||
subprocess.run("npm i -g pnpm", shell=True, check=True)
|
||||
pnpm_version = subprocess.run("pnpm --version", shell=True, check=True, capture_output=True, text=True).stdout.strip()
|
||||
print(f"Installed pnpm version {pnpm_version}")
|
||||
|
||||
# Check git
|
||||
try:
|
||||
git_version = subprocess.run("git --version", shell=True, check=True, capture_output=True, text=True).stdout.strip()
|
||||
print(f"{git_version} is installed")
|
||||
except:
|
||||
raise Exception("git is not installed. Please install git from https://git-scm.com/downloads")
|
||||
|
||||
print("All dependencies are satisfied")
|
||||
except Exception as e:
|
||||
print(f"Error checking dependencies: {str(e)}")
|
||||
raise
|
||||
|
||||
def get_release_versions(self):
|
||||
"""Get list of available release versions"""
|
||||
print("Fetching available versions...")
|
||||
try:
|
||||
response = requests.get(
|
||||
"https://api.github.com/repos/SteamDeckHomebrew/decky-loader/releases"
|
||||
)
|
||||
response.raise_for_status()
|
||||
releases = response.json()
|
||||
|
||||
# Split releases into stable and pre-release
|
||||
stable_releases = []
|
||||
pre_releases = []
|
||||
|
||||
for release in releases:
|
||||
version = release['tag_name']
|
||||
if release['prerelease']:
|
||||
pre_releases.append(version)
|
||||
else:
|
||||
stable_releases.append(version)
|
||||
|
||||
# Sort versions and take only the latest 3 of each
|
||||
stable_releases.sort(reverse=True)
|
||||
pre_releases.sort(reverse=True)
|
||||
|
||||
stable_releases = stable_releases[:3]
|
||||
pre_releases = pre_releases[:3]
|
||||
|
||||
# Combine and sort all versions
|
||||
all_versions = stable_releases + pre_releases
|
||||
all_versions.sort(reverse=True)
|
||||
|
||||
return all_versions
|
||||
|
||||
except requests.RequestException as e:
|
||||
raise Exception(f"Failed to fetch release versions: {str(e)}")
|
||||
|
||||
def prompt_for_version(self):
|
||||
"""Prompt the user to select a version to install."""
|
||||
versions = self.get_release_versions()
|
||||
|
||||
print("\nAvailable versions:")
|
||||
print("Stable versions:")
|
||||
stable_count = 0
|
||||
for i, version in enumerate(versions):
|
||||
if '-pre' not in version:
|
||||
print(f"{i+1}. {version}")
|
||||
stable_count += 1
|
||||
|
||||
print("\nPre-release versions:")
|
||||
for i, version in enumerate(versions):
|
||||
if '-pre' in version:
|
||||
print(f"{i+1}. {version}")
|
||||
|
||||
while True:
|
||||
try:
|
||||
choice = input("\nSelect a version (1-{}): ".format(len(versions)))
|
||||
index = int(choice) - 1
|
||||
if 0 <= index < len(versions):
|
||||
return versions[index]
|
||||
print("Invalid selection, please try again.")
|
||||
except ValueError:
|
||||
print("Invalid input, please enter a number.")
|
||||
|
||||
def terminate_processes(self):
|
||||
"""Terminate running instances of executables that may interfere with the build."""
|
||||
for proc in psutil.process_iter(['pid', 'name', 'exe']):
|
||||
if proc.info['name'] in ['PluginLoader.exe', 'PluginLoader_noconsole.exe']:
|
||||
try:
|
||||
proc.terminate()
|
||||
proc.wait()
|
||||
except (psutil.NoSuchProcess, psutil.AccessDenied, psutil.ZombieProcess):
|
||||
pass
|
||||
|
||||
def run(self):
|
||||
"""Run the build and installation process."""
|
||||
# Terminate interfering processes
|
||||
self.terminate_processes()
|
||||
try:
|
||||
print("Starting Decky Loader build process...")
|
||||
self.check_python_version()
|
||||
self.check_dependencies()
|
||||
self.setup_directories()
|
||||
self.clone_repository()
|
||||
self.setup_homebrew()
|
||||
self.build_frontend()
|
||||
self.prepare_backend()
|
||||
self.install_requirements()
|
||||
self.build_executables()
|
||||
self.install_files()
|
||||
self.setup_steam_config()
|
||||
self.setup_autostart()
|
||||
print("\nBuild process completed successfully!")
|
||||
print("\nNext steps:")
|
||||
print("1. Close Steam if it's running")
|
||||
print("2. Launch Steam using the new shortcut on your desktop")
|
||||
print("3. Enter Big Picture Mode")
|
||||
print("4. Hold the STEAM button and press A to access the Decky menu")
|
||||
except Exception as e:
|
||||
print(f"Error during build process: {str(e)}")
|
||||
raise
|
||||
finally:
|
||||
self.cleanup()
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description='Build and Install Decky Loader for Windows')
|
||||
parser.add_argument('--release', required=False, default=None,
|
||||
help='Release version/branch to build (if not specified, will prompt for version)')
|
||||
args = parser.parse_args()
|
||||
|
||||
try:
|
||||
builder = DeckyBuilder(args.release)
|
||||
builder.run()
|
||||
print(f"\nDecky Loader has been installed to: {builder.user_homebrew_dir}")
|
||||
except Exception as e:
|
||||
print(f"Error during build process: {str(e)}")
|
||||
sys.exit(1)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
@ -1,90 +0,0 @@
|
||||
@echo off
|
||||
setlocal EnableDelayedExpansion
|
||||
|
||||
:: Check for admin privileges
|
||||
net session >nul 2>&1
|
||||
if %errorlevel% neq 0 (
|
||||
echo This script requires administrator privileges.
|
||||
echo Please run this script as administrator.
|
||||
pause
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
:: Check Python version
|
||||
echo Checking Python version...
|
||||
where python >nul 2>nul
|
||||
if %errorlevel% neq 0 (
|
||||
echo Python is not installed or not in PATH
|
||||
echo Please install Python and try again
|
||||
pause
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
for /f "tokens=*" %%i in ('python -c "import sys; print(sys.executable)"') do set PYTHON_PATH=%%i
|
||||
|
||||
:: Check dependencies
|
||||
echo Checking dependencies...
|
||||
|
||||
:: Check Node.js and npm
|
||||
where node >nul 2>nul
|
||||
if %errorlevel% neq 0 (
|
||||
echo Node.js is not installed or not in PATH
|
||||
echo Please install Node.js and try again
|
||||
pause
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
for /f "tokens=*" %%i in ('node -v') do set NODE_VERSION=%%i
|
||||
for /f "tokens=*" %%i in ('npm -v') do set NPM_VERSION=%%i
|
||||
echo Node.js !NODE_VERSION! with npm !NPM_VERSION! is installed
|
||||
|
||||
:: Add npm global path to PATH
|
||||
for /f "tokens=*" %%i in ('npm config get prefix') do set NPM_PREFIX=%%i
|
||||
set "PATH=%NPM_PREFIX%;%PATH%"
|
||||
|
||||
:: Ensure pnpm is installed globally
|
||||
where pnpm >nul 2>nul
|
||||
if %errorlevel% neq 0 (
|
||||
echo Installing pnpm globally...
|
||||
npm install -g pnpm
|
||||
)
|
||||
|
||||
:: Get pnpm version
|
||||
for /f "tokens=*" %%i in ('pnpm -v') do set PNPM_VERSION=%%i
|
||||
echo pnpm version !PNPM_VERSION! is installed
|
||||
|
||||
:: Check git
|
||||
where git >nul 2>nul
|
||||
if %errorlevel% neq 0 (
|
||||
echo git is not installed or not in PATH
|
||||
echo Please install git and try again
|
||||
pause
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
for /f "tokens=*" %%i in ('git --version') do set GIT_VERSION=%%i
|
||||
echo !GIT_VERSION! is installed
|
||||
|
||||
echo All dependencies are satisfied
|
||||
|
||||
:: Get the directory of this batch file
|
||||
set "SCRIPT_DIR=%~dp0"
|
||||
|
||||
:: Run the Python script with full environment
|
||||
echo Running Decky Loader installer...
|
||||
"%PYTHON_PATH%" "%SCRIPT_DIR%decky_builder.py"
|
||||
|
||||
if errorlevel 1 (
|
||||
echo Error during build process: %ERRORLEVEL%
|
||||
:: Clean up any remaining processes
|
||||
taskkill /F /IM python.exe /T >nul 2>&1
|
||||
taskkill /F /IM node.exe /T >nul 2>&1
|
||||
exit /b %ERRORLEVEL%
|
||||
)
|
||||
|
||||
:: Clean up any remaining processes
|
||||
taskkill /F /IM python.exe /T >nul 2>&1
|
||||
taskkill /F /IM node.exe /T >nul 2>&1
|
||||
|
||||
echo Build completed successfully.
|
||||
pause
|
10
steam.manifest
Normal file
10
steam.manifest
Normal file
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
|
||||
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
|
||||
<security>
|
||||
<requestedPrivileges>
|
||||
<requestedExecutionLevel level="requireAdministrator" uiAccess="false"/>
|
||||
</requestedPrivileges>
|
||||
</security>
|
||||
</trustInfo>
|
||||
</assembly>
|
Loading…
x
Reference in New Issue
Block a user