-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.bat
More file actions
64 lines (56 loc) · 1.89 KB
/
Copy pathsetup.bat
File metadata and controls
64 lines (56 loc) · 1.89 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
@echo off
REM ============================================================
REM OpenKyrozen — Windows Setup
REM Creates a Python virtual environment and installs dependencies.
REM ============================================================
setlocal enabledelayedexpansion
echo ============================================================
echo OpenKyrozen Windows Setup
echo ============================================================
echo.
REM --- Find a working Python 3.12 (preferred) or 3.13 ---
set PYTHON=
for /f "tokens=*" %%v in ('py -3.12 --version 2^>nul') do set "PYTHON=py -3.12"
if "!PYTHON!"=="" (
for %%p in (python3.12 python3 python) do (
call :try_python %%p
if "!PYTHON!" neq "" goto :found
)
)
echo [ERROR] No working Python found. Install Python 3.12 or 3.13 from https://python.org
echo Make sure "Add Python to PATH" is checked during install.
pause
exit /b 1
:found
echo [INFO] Using Python: !PYTHON!
echo.
REM --- Create virtual environment ---
echo [INFO] Creating virtual environment...
rmdir /s /q venv 2>nul
!PYTHON! -m venv venv
if errorlevel 1 (
echo [ERROR] Failed to create virtual environment.
pause
exit /b 1
)
REM --- Activate and install ---
call venv\Scripts\activate.bat
echo [INFO] Upgrading pip...
python -m pip install --upgrade pip -q
echo [INFO] Installing requirements...
pip install -r requirements.txt -q
echo.
echo ============================================================
echo Setup complete. Run 'run.bat' to start OpenKyrozen.
echo ============================================================
pause
exit /b 0
REM --- Subroutine: test if a Python command works ---
:try_python
set CMD=%*
set VER=
for /f "tokens=*" %%v in ('%CMD% --version 2^>nul') do set VER=%%v
if "%VER%"=="" exit /b
echo %VER% | findstr /c:"3.12" >nul && set PYTHON=%CMD% && exit /b
echo %VER% | findstr /c:"3.13" >nul && set PYTHON=%CMD% && exit /b
exit /b