Files
Mira_Firmware_Loader/build_windows.bat
2026-03-07 07:25:33 +07:00

63 lines
1.5 KiB
Batchfile

@echo off
REM ============================================
REM IoT Firmware Loader - Windows Build Script
REM Tao file .exe khong can cai Python
REM ============================================
echo ========================================
echo MiraV3 Firmware Loader - Build for Windows
echo ========================================
echo.
cd /d "%~dp0"
REM 1. Tao venv neu chua co
if not exist "venv" (
echo [1/4] Creating virtual environment...
python -m venv venv
)
REM 2. Activate venv
call venv\Scripts\activate.bat
REM 3. Cai dependencies + PyInstaller
echo [2/4] Installing dependencies...
pip install PyQt6 scapy requests pyinstaller --quiet
REM 4. Build .exe
echo [3/4] Building executable...
pyinstaller ^
--name "MiraV3_Firmware_Loader" ^
--icon "icon.ico" ^
--add-data "icon.ico;." ^
--onefile ^
--windowed ^
--noconfirm ^
--clean ^
--hidden-import "scapy.all" ^
--hidden-import "scapy.layers.l2" ^
--hidden-import "scapy.arch.windows" ^
--hidden-import "PyQt6.QtWidgets" ^
--hidden-import "PyQt6.QtCore" ^
--hidden-import "PyQt6.QtGui" ^
main.py
echo.
echo [4/4] Build complete!
echo.
if exist "dist\MiraV3_Firmware_Loader.exe" (
echo ✅ SUCCESS: dist\MiraV3_Firmware_Loader.exe
echo.
echo File size:
for %%A in ("dist\MiraV3_Firmware_Loader.exe") do echo %%~zA bytes
echo.
echo Ban co the copy file .exe nay sang may khac va chay truc tiep.
) else (
echo ❌ BUILD FAILED. Check errors above.
)
echo.
pause