This repository was archived by the owner on Feb 15, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbuild.bat
More file actions
108 lines (98 loc) · 2.4 KB
/
build.bat
File metadata and controls
108 lines (98 loc) · 2.4 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
@echo off
title StudentMain Manager build
echo StudentMain Manager builder
echo ===========================
echo.
echo Please choose if you want a console for debugging.
echo 1: Console mode
echo 2: Window mode
echo.
choice /c 12 /m "Press 1 or 2 on the keyboard..."
if %errorlevel%==1 goto consolebuild
if %errorlevel%==2 goto windowbuild
:consolebuild
echo.
echo Starting console build.
echo Copying source files.
mkdir build
copy main.py .\build
copy utils.py .\build
echo.
echo Would you like UPX compressing?
echo Y. Yes
echo N. No
choice /c YN /m "Press Y or N on the keyboard..."
if %errorlevel%==1 goto consoleupxbuild
if %errorlevel%==2 goto consolenoupxbuild
:consoleupxbuild
echo.
set /p upxPath=Please specify the path to the UPX binary:
cd build
echo.
echo Building with PyInstaller...
echo.
pyinstaller --onefile --upx-dir="%upxPath%" -c --icon ..\image-res\StudentMainManager.ico main.py
echo.
goto mkrelease
:consolenoupxbuild
echo.
cd build
echo.
echo Building with PyInstaller...
echo.
pyinstaller --onefile -c --icon ..\image-res\StudentMainManager.ico main.py
echo.
goto mkrelease
:windowbuild
echo.
echo Starting window build.
echo Copying source files.
mkdir build
copy main.py .\build
copy utils.py .\build
echo.
echo Would you like UPX compressing?
echo Y. Yes
echo N. No
choice /c YN /m "Press Y or N on the keyboard..."
if %errorlevel%==1 goto windowupxbuild
if %errorlevel%==2 goto windownoupxbuild
:windowupxbuild
echo.
set /p upxPath=Please specify the path to the UPX binary:
cd build
echo.
echo Building with PyInstaller...
echo.
pyinstaller --onefile --upx-dir="%upxPath%" -w --icon ..\image-res\StudentMainManager.ico main.py
echo.
goto mkrelease
:windownoupxbuild
echo.
cd build
echo.
echo Building with PyInstaller...
echo.
pyinstaller --onefile -w --icon ..\image-res\StudentMainManager.ico main.py
echo.
goto mkrelease
:mkrelease
echo Making release.
echo Copying files.
mkdir release
copy .\dist\main.exe .\release\StudentMainManager.exe
copy ..\config.ini .\release\config.ini
echo Please manually press D twice below.
xcopy /e ..\binaries .\release\binaries
xcopy /e ..\image-res .\release\image-res
echo.
echo Release build complete. Removing rubbish files...
echo.
rmdir .\build /s /q
rmdir .\dist /s /q
rmdir .\__pycache__ /s /q
del .\main.py /f /q
del .\main.spec /f /q
del .\utils.py /f /q
echo Build complete. The builded release can be found under .\build\release. Press any key to exit.
pause >nul