-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.bat
More file actions
80 lines (73 loc) · 2.05 KB
/
build.bat
File metadata and controls
80 lines (73 loc) · 2.05 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
76
77
78
79
80
@echo off
REM Circuit Repair Game - Build Script (Windows)
REM 电路修复游戏 - 构建脚本 (Windows)
echo ========================================
echo Circuit Repair Game - Build Script
echo 电路修复游戏 - 构建脚本
echo ========================================
echo.
REM Activate conda environment
echo [1/5] Activating conda environment...
call conda activate Game
if errorlevel 1 (
echo ERROR: Failed to activate conda environment 'Game'
echo Please ensure conda is installed and the 'Game' environment exists
pause
exit /b 1
)
echo OK: Conda environment activated
echo.
REM Check if PyInstaller is installed
echo [2/5] Checking PyInstaller installation...
python -c "import PyInstaller" 2>nul
if errorlevel 1 (
echo PyInstaller not found. Installing...
pip install pyinstaller
if errorlevel 1 (
echo ERROR: Failed to install PyInstaller
pause
exit /b 1
)
)
echo OK: PyInstaller is installed
echo.
REM Clean previous build
echo [3/5] Cleaning previous build...
if exist build rmdir /s /q build
if exist dist rmdir /s /q dist
echo OK: Previous build cleaned
echo.
REM Build the executable
echo [4/5] Building executable...
echo This may take several minutes...
pyinstaller circuit_repair_game.spec
if errorlevel 1 (
echo ERROR: Build failed
pause
exit /b 1
)
echo OK: Build completed successfully
echo.
REM Verify the build
echo [5/5] Verifying build...
if exist "dist\CircuitRepairGame\CircuitRepairGame.exe" (
echo OK: Executable created successfully
echo.
echo ========================================
echo Build completed!
echo ========================================
echo.
echo Output location: dist\CircuitRepairGame\
echo Executable: dist\CircuitRepairGame\CircuitRepairGame.exe
echo.
echo You can now:
echo 1. Test the executable: cd dist\CircuitRepairGame ^&^& CircuitRepairGame.exe
echo 2. Create a zip file for distribution
echo.
) else (
echo ERROR: Executable not found
echo Build may have failed
pause
exit /b 1
)
pause