@echo off
chcp 65001 >nul
echo 🔧 设置 Electron 镜像源...
echo.

REM 设置 Electron 镜像环境变量
set ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/
set ELECTRON_BUILDER_BINARIES_MIRROR=https://npmmirror.com/mirrors/electron-builder-binaries/
set ELECTRON_CUSTOM_DIR={{ version }}
set ELECTRON_CUSTOM_FILENAME={{ filename }}

echo ✅ 环境变量已设置:
echo   ELECTRON_MIRROR: %ELECTRON_MIRROR%
echo   ELECTRON_BUILDER_BINARIES_MIRROR: %ELECTRON_BUILDER_BINARIES_MIRROR%
echo.

echo 🚀 开始打包 Windows 版本...
echo.

call npm run pack:win

if %ERRORLEVEL% EQU 0 (
    echo.
    echo ✅ 打包成功！
) else (
    echo.
    echo ❌ 打包失败，请检查错误信息
)

pause
