-
-
Notifications
You must be signed in to change notification settings - Fork 49
Expand file tree
/
Copy pathlaunch.bat
More file actions
61 lines (51 loc) · 2.12 KB
/
Copy pathlaunch.bat
File metadata and controls
61 lines (51 loc) · 2.12 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
@echo off
REM FunGen launcher (Windows). Self-heals: if .venv is missing or broken,
REM bootstraps uv and runs install.py before launching.
setlocal
cd /d "%~dp0"
set PYTHONNOUSERSITE=1
set KMP_DUPLICATE_LIB_OK=TRUE
set YOLO_TELEMETRY=False
set YOLO_OFFLINE=True
set YOLO_CONFIG_DIR=%cd%\config\ultralytics
REM Drop any active conda env vars so nothing leaks into our venv interpreter
set CONDA_PREFIX=
set CONDA_DEFAULT_ENV=
set CONDA_PROMPT_MODIFIER=
set CONDA_SHLVL=
REM Put venv's Scripts dir on PATH so subprocesses (ultralytics AutoUpdate,
REM plugin installs) that call bare "pip" / "python" find the venv's copy.
set PATH=%cd%\.venv\Scripts;%PATH%
REM winget installs git but new sessions don't always inherit the updated PATH.
if exist "C:\Program Files\Git\cmd\git.exe" set "PATH=C:\Program Files\Git\cmd;%PATH%"
if exist "C:\Program Files (x86)\Git\cmd\git.exe" set "PATH=C:\Program Files (x86)\Git\cmd;%PATH%"
set VENV_PY=.venv\Scripts\python.exe
if not exist "%VENV_PY%" (
echo FunGen environment missing, running installer ^(one-time, ~2 min^)...
REM Bootstrap uv if needed. We never trust system Python on Windows
REM because the Microsoft Store python alias makes "where python" lie.
where uv >nul 2>nul
if errorlevel 1 (
powershell -NoProfile -ExecutionPolicy Bypass -Command "irm https://astral.sh/uv/install.ps1 | iex"
set "PATH=%USERPROFILE%\.local\bin;%USERPROFILE%\.cargo\bin;%PATH%"
)
where uv >nul 2>nul
if errorlevel 1 (
echo.
echo Could not install uv. Run install.bat manually and report the issue.
pause
exit /b 1
)
uv run --no-project --isolated --python 3.11 -- python install.py
)
if not exist "%VENV_PY%" (
echo.
echo Install failed. See output above. Run install.bat and report the issue.
pause
exit /b 1
)
REM Re-check git path after install.py (may have just installed git via winget).
if exist "C:\Program Files\Git\cmd\git.exe" set "PATH=C:\Program Files\Git\cmd;%PATH%"
if exist "C:\Program Files (x86)\Git\cmd\git.exe" set "PATH=C:\Program Files (x86)\Git\cmd;%PATH%"
"%VENV_PY%" main.py %*
if errorlevel 1 pause