File size: 986 Bytes
f61cde8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
@echo off
setlocal ENABLEDELAYEDEXPANSION

cd /d "%~dp0"

echo.
echo [1/6] Checking Python...
where py >nul 2>nul && set PY=py || where python >nul 2>nul && set PY=python
if not defined PY (
  echo ERROR: Python not found.
  pause & exit /b 1
)

echo Using: %PY%
echo.

echo [2/6] Creating virtual environment...
if not exist ".venv" %PY% -m venv .venv
call .venv\Scripts\activate.bat || (echo Failed to activate venv & pause & exit /b 1)

echo.
echo [3/6] Upgrading pip...
python -m pip install --upgrade pip

echo.
echo [4/6] Installing requirements...
pip install -r requirements.txt
pip install pyinstaller

echo.
echo [5/6] CLEANING OLD BUILDS...
rmdir /s /q build dist 2>nul
:: DO NOT DELETE DIRT.spec

echo.
echo [6/6] BUILDING DIRT.EXE...
pyinstaller DIRT.spec --log-level=INFO
if %ERRORLEVEL% neq 0 (
  echo.
  echo BUILD FAILED
  pause & exit /b 1
)

echo.
echo SUCCESS! Opening folder...
explorer.exe "dist\DIRT"

echo.
echo Double-click DIRT.exe to run.
echo.
pause
endlocal