-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.bat
More file actions
38 lines (33 loc) · 1.18 KB
/
Copy pathbuild.bat
File metadata and controls
38 lines (33 loc) · 1.18 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
@echo off
rem Builds dist\ScreenTuner\ScreenTuner.exe
rem --onedir, not --onefile: onefile unpacks ~25 MB into %TEMP% on every launch,
rem which costs half a second of startup, trips antivirus heuristics, and leaves
rem the folder behind whenever the process is killed rather than closed.
setlocal
cd /d "%~dp0"
if not exist ".build\venv\Scripts\python.exe" (
echo Creating build environment...
python -m venv ".build\venv" || goto :fail
".build\venv\Scripts\python.exe" -m pip install --upgrade pip --quiet || goto :fail
".build\venv\Scripts\python.exe" -m pip install pyinstaller --quiet || goto :fail
)
echo Generating icon...
python src\make_icon.py || goto :fail
echo Building...
".build\venv\Scripts\python.exe" -m PyInstaller --noconfirm --clean ^
--onedir --windowed ^
--name ScreenTuner ^
--icon "%~dp0icon.ico" ^
--add-data "%~dp0icon.ico;." ^
--hidden-import configui ^
--paths src ^
--distpath dist --workpath ".build\work" --specpath ".build" ^
src\screentuner.py || goto :fail
echo.
echo Done: %~dp0dist\ScreenTuner\ScreenTuner.exe
echo Run it with --install to put it in %%LOCALAPPDATA%%\Programs\ScreenTuner.
goto :eof
:fail
echo.
echo BUILD FAILED
exit /b 1