build: Console 改为就地覆盖组装,规避 .pak 只读删除失败
This commit is contained in:
1 parent
8b792496d6
commit
29162f5c1d
1 file changed
+5
-4
+5
-4
@@ -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 === 构建完成 ===
|
||||
|
||||
Reference in new issue
Block a user