test/freetest/up/build.bat

38 lines
972 B
Batchfile

@echo off
setlocal enabledelayedexpansion
echo ================================================
echo CAN.py IAP Upgrade Tool - Build Script
echo Output: dist\CAN_IAP_Tool.exe (single file)
echo ================================================
cd /d %~dp0
echo.
echo [1/3] Check PyInstaller ...
python -m PyInstaller --version >nul 2>&1
if errorlevel 1 (
echo PyInstaller not found, installing ...
pip install pyinstaller
if errorlevel 1 (
echo [ERROR] PyInstaller install failed. Check Python/pip.
pause
exit /b 1
)
) else (
echo PyInstaller OK
)
echo.
echo [2/3] Building (embed ControlCAN.dll, no console window) ...
pyinstaller -F -w -n CAN_IAP_Tool CAN.py --add-binary "ControlCAN.dll;." --clean
if errorlevel 1 (
echo [ERROR] Build failed.
pause
exit /b 1
)
echo.
echo [3/3] Done!
echo exe: dist\CAN_IAP_Tool.exe
echo Note: config.ini auto-created next to exe on first run.
pause