feat(updater): add zero-dependency local auto-updater and build bootstrap

This commit is contained in:
CAtlas0784 committed 2026-10-30 21:24:42 +07:00
1 parent e024bc5252
commit 0ec9f62857
5 files changed
+262 -15

No files matched your search

+29 -14
View File
@@ -1,29 +1,44 @@
@echo off
chcp 65001 >nul
title 🔧 Wails3 Build & Compress Script
title 🔧 G-Launcher Build Script
cd /d "%~dp0"
echo ============================================
echo 🔧 เริ่มต้น Build โปรเจกต์...
echo 🔧 เริ่มต้น Build โปรเจกต์ G-Launcher...
echo ============================================
start /wait wails3 build
echo.
echo ============================================
echo 🔧 กำลังบีบอัดและลบข้อมูล debug...
echo ============================================
for %%f in ("build\bin\*.exe") do (
echo 🔹 ลดขนาดไฟล์ %%~nxf ...
upx --best --lzma "%%f"
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 ✅ เสร็จสิ้นขั้นตอน Build และลดขนาดไฟล์!
echo 🔧 ตรวจสอบและบีบอัดไฟล์ EXE (UPX)...
echo ============================================
pause
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 📦 เริ่ม Package...
echo ✅ เสร็จสิ้นขั้นตอน Build!
echo ============================================
start wails3 package
pause