Add Windows build script and update README with build instructions

This commit is contained in:
hyyz17200
2026-05-08 12:42:37 +08:00
parent 4ba654ca3f
commit 6ac5331932
5 changed files with 251 additions and 4 deletions
+43
View File
@@ -0,0 +1,43 @@
@echo off
chcp 65001 >nul
setlocal
set "PY=.venv\Scripts\python.exe"
set "DIST=build\onefile"
if not exist "%DIST%" mkdir "%DIST%"
"%PY%" -m nuitka ^
--mode=onefile ^
--msvc=latest ^
--enable-plugin=pyside6 ^
--include-qt-plugins=platforms,imageformats,styles,iconengines ^
--windows-console-mode=disable ^
--output-dir="%DIST%" ^
--output-filename=a1packer.exe ^
--remove-output ^
run_gui.py
if errorlevel 1 exit /b %ERRORLEVEL%
echo.
echo GUI build done.
echo Next step is building CLI.
"%PY%" -m nuitka ^
--mode=onefile ^
--msvc=latest ^
--output-dir="%DIST%" ^
--output-filename=a1packer-cli.exe ^
--remove-output ^
run_cli.py
if errorlevel 1 exit /b %ERRORLEVEL%
robocopy "swap_gcode" "%DIST%\swap_gcode" /E
if %ERRORLEVEL% GEQ 8 exit /b %ERRORLEVEL%
copy /Y "gcode_patches.ini" "%DIST%\gcode_patches.ini" >nul
if errorlevel 1 exit /b %ERRORLEVEL%
echo.
echo Build done: %DIST%
exit /b 0