Files
G-Launcher/build.bat
T

45 lines
1.4 KiB
Batchfile

@echo off
chcp 65001 >nul
title 🔧 G-Launcher Build Script
cd /d "%~dp0"
echo ============================================
echo 🔧 เริ่มต้น Build โปรเจกต์ G-Launcher...
echo ============================================
where wails3 >nul 2>nul
if %errorlevel% neq 0 (
echo [INFO] ตรวจไม่พบ Wails3 ในระบบ กำลังเรียกใช้ระบบ Bootstrap อัตโนมัติ...
powershell -NoProfile -ExecutionPolicy Bypass -File "%~dp0scripts\bootstrap.ps1" -NoLaunch
goto done
)
call wails3 build
if %errorlevel% neq 0 (
echo.
echo ❌ Wails3 build ไม่สำเร็จ กำลังสลับไปใช้ระบบ Bootstrap สำรอง...
powershell -NoProfile -ExecutionPolicy Bypass -File "%~dp0scripts\bootstrap.ps1" -NoLaunch
goto done
)
echo.
echo ============================================
echo 🔧 ตรวจสอบและบีบอัดไฟล์ EXE (UPX)...
echo ============================================
where upx >nul 2>nul
if %errorlevel% equ 0 (
for %%f in ("bin\*.exe" "build\bin\*.exe") do (
if exist "%%f" (
echo 🔹 บีบอัด %%~nxf ...
upx --best --lzma "%%f"
)
)
)
:done
echo.
echo ============================================
echo ✅ เสร็จสิ้นขั้นตอน Build!
echo ============================================
pause