From 29162f5c1d0cca1cf2750b22a1d33dcd3855f6d8 Mon Sep 17 00:00:00 2001 From: AskaEth Date: Wed, 9 Sep 2026 19:33:07 +0800 Subject: [PATCH] =?UTF-8?q?build:=20Console=20=E6=94=B9=E4=B8=BA=E5=B0=B1?= =?UTF-8?q?=E5=9C=B0=E8=A6=86=E7=9B=96=E7=BB=84=E8=A3=85=EF=BC=8C=E8=A7=84?= =?UTF-8?q?=E9=81=BF=20.pak=20=E5=8F=AA=E8=AF=BB=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deploy/build.bat | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/deploy/build.bat b/deploy/build.bat index 00adc1d..8a030b3 100644 --- a/deploy/build.bat +++ b/deploy/build.bat @@ -37,12 +37,13 @@ call :ensure_electron || exit /b 1 cd .. echo === [5/5] 组装便携版 Console === -REM 旧版本可能正在运行,且 Electron 解压出来的 .pak 带只读属性,普通 rmdir 删不掉 +REM 旧版本可能在运行;Electron 解压出的 .pak 带只读属性,整目录删除很容易失败, +REM 改为「就地覆盖」:只清掉我们自己的 resources\app,运行时文件直接覆盖。 taskkill /im "Scoreboard Console.exe" /f >nul 2>&1 taskkill /im scoreboard.exe /f >nul 2>&1 -powershell -NoProfile -Command "if (Test-Path '%CONSOLE_OUT%') { Remove-Item -Recurse -Force '%CONSOLE_OUT%' }" || exit /b 1 -mkdir "%CONSOLE_OUT%" || exit /b 1 +if not exist "%CONSOLE_OUT%" mkdir "%CONSOLE_OUT%" || exit /b 1 xcopy /e /i /y "console\node_modules\electron\dist" "%CONSOLE_OUT%" >nul || exit /b 1 +if exist "%CONSOLE_OUT%\resources\app" rmdir /s /q "%CONSOLE_OUT%\resources\app" mkdir "%CONSOLE_OUT%\resources\app" 2>nul xcopy /e /i /y "console\main" "%CONSOLE_OUT%\resources\app\main" >nul || exit /b 1 xcopy /e /i /y "console\renderer" "%CONSOLE_OUT%\resources\app\renderer" >nul || exit /b 1 @@ -51,7 +52,7 @@ REM config.json 必须放在 exe 同级(Console 按 exe 目录解析配置) copy /y "console\config.json" "%CONSOLE_OUT%\config.json" >nul || exit /b 1 copy /y "dist\scoreboard.exe" "%CONSOLE_OUT%\scoreboard.exe" >nul || exit /b 1 copy /y "config.yaml" "%CONSOLE_OUT%\config.yaml" >nul || exit /b 1 -ren "%CONSOLE_OUT%\electron.exe" "Scoreboard Console.exe" || exit /b 1 +if exist "%CONSOLE_OUT%\electron.exe" ren "%CONSOLE_OUT%\electron.exe" "Scoreboard Console.exe" echo. echo === 构建完成 ===