-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.bat
More file actions
67 lines (60 loc) · 1.69 KB
/
build.bat
File metadata and controls
67 lines (60 loc) · 1.69 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
@echo off
REM Build script for Path of Python
REM This script builds the game into a standalone Windows executable
echo ========================================
echo Path of Python - Build Script
echo ========================================
echo.
REM Remove obsolete pathlib backport if it exists (causes PyInstaller conflicts)
python -c "import pathlib; import sys; sys.exit(0 if pathlib.__file__.endswith('site-packages\\pathlib.py') else 1)" 2>nul
if not errorlevel 1 (
echo Removing obsolete pathlib backport...
pip uninstall pathlib -y
echo.
)
REM Check if PyInstaller is installed
python -c "import PyInstaller" 2>nul
if errorlevel 1 (
echo PyInstaller not found. Installing...
pip install pyinstaller
if errorlevel 1 (
echo Failed to install PyInstaller!
pause
exit /b 1
)
)
echo Cleaning previous build...
if exist "dist" (
rmdir /s /q "dist" 2>nul
if exist "dist" (
echo WARNING: Could not delete dist folder ^(file locked^). Renaming instead...
move dist dist_old_%RANDOM% 2>nul
)
)
if exist "build" rmdir /s /q "build" 2>nul
echo.
echo Building executable...
echo This may take a few minutes...
echo.
pyinstaller path_of_python.spec
if errorlevel 1 (
echo.
echo ========================================
echo Build FAILED!
echo Check the error messages above.
echo ========================================
pause
exit /b 1
)
echo.
echo ========================================
echo Build SUCCESSFUL!
echo ========================================
echo.
echo Your executable is located at:
echo dist\PathOfPython.exe
echo.
echo File size:
for %%A in ("dist\PathOfPython.exe") do echo %%~zA bytes
echo.
pause