-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.bat
More file actions
73 lines (67 loc) · 1.78 KB
/
build.bat
File metadata and controls
73 lines (67 loc) · 1.78 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
@echo off
REM Build a standalone qtpyrc distribution using PyInstaller.
REM Output goes to dist\qtpyrc\ — zip that directory to distribute.
REM
REM Prerequisites:
REM pip install pyinstaller
REM
REM Usage:
REM build.bat (build normally)
REM build.bat clean (remove build artifacts)
if "%1"=="clean" (
echo Cleaning build artifacts...
rmdir /s /q build 2>nul
rmdir /s /q dist 2>nul
del /q qtpyrc.spec 2>nul
echo Done.
exit /b 0
)
echo Checking for PyInstaller...
pip show pyinstaller >nul 2>&1
if errorlevel 1 (
echo PyInstaller not found. Installing...
pip install pyinstaller
)
echo Building qtpyrc...
pyinstaller ^
--name qtpyrc ^
--noconfirm ^
--windowed ^
--add-data "defaults;defaults" ^
--add-data "icons;icons" ^
--add-data "plugins;plugins" ^
--add-data "settings;settings" ^
--add-data "docs;docs" ^
--hidden-import qasync ^
--hidden-import ruamel.yaml ^
--hidden-import ruamel.yaml.clib ^
--collect-submodules ruamel.yaml ^
--exclude PyQt6 ^
--exclude PyQt5 ^
qtpyrc.py
if errorlevel 1 (
echo Build FAILED.
exit /b 1
)
echo.
echo Creating zip file...
pushd dist
if exist qtpyrc.zip del /q qtpyrc.zip
powershell -Command "Compress-Archive -Path 'qtpyrc' -DestinationPath 'qtpyrc.zip'"
popd
if exist dist\qtpyrc.zip (
echo.
echo Build complete!
echo Directory: dist\qtpyrc\
echo Zip file: dist\qtpyrc.zip
) else (
echo.
echo Build complete! (zip creation failed, but directory is ready)
echo Directory: dist\qtpyrc\
)
echo.
echo To use:
echo 1. Unzip dist\qtpyrc.zip (or copy dist\qtpyrc\) wherever you want
echo 2. Run: qtpyrc\qtpyrc.exe --init myconfig
echo 3. Edit myconfig\config.yaml
echo 4. Run: qtpyrc\qtpyrc.exe -c myconfig\config.yaml