forked from HamzaYslmn/Forza-Horizon-DualSense-Python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwin_start.bat
More file actions
75 lines (61 loc) · 1.88 KB
/
Copy pathwin_start.bat
File metadata and controls
75 lines (61 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
@echo off
REM FH DualSense - Windows launcher (zuv).
REM Bundle lives in app/. Auto-downloads from GitHub Releases if missing.
REM Set PRERELEASE=true to track rolling test builds (v999.0.0 tag).
setlocal EnableDelayedExpansion
set "PRERELEASE=false"
set "DIR=%~dp0"
set "APP=%DIR%app"
set "BUNDLE=%APP%\fhds.zuv.py"
set "REPO=HamzaYslmn/Forza-Horizon-DualSense-Python"
if /i "%PRERELEASE%"=="true" (
set "URL=https://github.com/%REPO%/releases/download/v999.0.0/fhds.zuv.py"
set "FLAGS=--prerelease"
) else (
set "URL=https://github.com/%REPO%/releases/latest/download/fhds.zuv.py"
set "FLAGS="
)
REM Args starting with -- forward to bundle; rest = Steam wrapper game cmd.
set "GAME="
:argloop
if "%~1"=="" goto ready
set "a=%~1"
if "!a:~0,2!"=="--" goto flag_arg
if defined GAME goto append_game
set "GAME=%1"
goto next_arg
:append_game
set "GAME=!GAME! %1"
goto next_arg
:flag_arg
set "FLAGS=!FLAGS! %1"
:next_arg
shift
goto argloop
:ready
if not exist "%APP%" mkdir "%APP%"
if not exist "%BUNDLE%" (
echo Downloading fhds.zuv.py...
curl.exe -L --fail -o "%BUNDLE%" "%URL%" || (
echo Download failed. Get it manually from https://github.com/%REPO%/releases
pause & exit /b 1
)
)
where uv >nul 2>nul
if errorlevel 1 (
echo Installing uv...
powershell -NoProfile -Command "irm https://astral.sh/uv/install.ps1 | iex"
set "PATH=%USERPROFILE%\.local\bin;%PATH%"
where uv >nul 2>nul || (echo uv not on PATH - restart terminal. & pause & exit /b 1)
)
REM Optional Steam wrapper: pass game cmd (e.g. start "" steam://rungameid/1551360)
if defined GAME start "" %GAME%
REM Don't let host Python env leak into the bundled venv.
set "PYTHONHOME="
set "PYTHONPATH="
set "PYTHONNOUSERSITE=1"
REM Force uv to use its own managed Python (python-build-standalone) instead
set "UV_PYTHON_PREFERENCE=only-managed"
uv run "%BUNDLE%" %FLAGS%
endlocal
exit /b %ERRORLEVEL%