diff --git a/deploy/build.bat b/deploy/build.bat index 3781eba..60a67c3 100644 --- a/deploy/build.bat +++ b/deploy/build.bat @@ -50,9 +50,10 @@ taskkill /im scoreboard.exe /f >nul 2>&1 if not exist "rules" echo [warn] rules dir missing node deploy\prepare-extra.mjs || exit /b 1 cd console -REM pnpm 11 blocks postinstall by default; electron-builder fetches its own Electron -REM runtime into its cache, so skipping scripts here is safe (and avoids ERR_PNPM_IGNORED_BUILDS). +REM pnpm 11 blocks postinstall by default (ERR_PNPM_IGNORED_BUILDS), so the electron +REM runtime binary is fetched explicitly below instead of relying on the install script. call pnpm install --frozen-lockfile --ignore-scripts || exit /b 1 +call :ensure_electron || exit /b 1 call pnpm run dist || exit /b 1 cd .. @@ -63,3 +64,15 @@ echo dist\console\ console installer + portable dir /b dist\console endlocal exit /b 0 + +REM ---- ensure the electron runtime binary is present (pnpm skips its postinstall) -- +:ensure_electron +if exist node_modules\electron\dist\electron.exe exit /b 0 +set "EV=38.8.6" +echo downloading electron %EV% ... +curl -L --fail --max-time 900 -o electron-dl.zip "%ELECTRON_MIRROR%%EV%/electron-v%EV%-win32-x64.zip" || exit /b 1 +powershell -NoProfile -Command "Expand-Archive -LiteralPath 'electron-dl.zip' -DestinationPath 'node_modules/electron/dist' -Force" || exit /b 1 +del /q electron-dl.zip +echo electron.exe> node_modules\electron\path.txt +echo electron runtime ready +exit /b 0