48 lines
1.1 KiB
Batchfile
48 lines
1.1 KiB
Batchfile
@echo off
|
|
REM Simple frontend build script (ASCII only, avoid encoding issues)
|
|
|
|
cd /d "%~dp0"
|
|
|
|
echo ========================================
|
|
echo Building wrench_gui with PyInstaller...
|
|
echo ========================================
|
|
|
|
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. Please run: pip install pyinstaller
|
|
pause
|
|
exit /b 1
|
|
)
|
|
)
|
|
|
|
echo Cleaning old build/dist...
|
|
if exist build rmdir /s /q build
|
|
if exist dist rmdir /s /q dist
|
|
|
|
echo Running PyInstaller...
|
|
python -m PyInstaller wrench_gui.spec
|
|
|
|
if errorlevel 1 (
|
|
echo Build failed!
|
|
pause
|
|
exit /b 1
|
|
)
|
|
|
|
echo.
|
|
echo Build success!
|
|
echo Executable: dist\wrench_gui\wrench_gui.exe
|
|
echo.
|
|
echo Next steps:
|
|
echo 1. Copy config.json to executable directory:
|
|
echo copy ..\config.json dist\wrench_gui\config.json
|
|
echo.
|
|
echo 2. Make sure backend API is running (http://localhost:5000)
|
|
echo.
|
|
echo 3. Run the program:
|
|
echo dist\wrench_gui\wrench_gui.exe
|
|
echo.
|
|
pause
|