diff --git a/deploy/build.bat b/deploy/build.bat index 8aeab14..00adc1d 100644 --- a/deploy/build.bat +++ b/deploy/build.bat @@ -37,10 +37,10 @@ call :ensure_electron || exit /b 1 cd .. echo === [5/5] 组装便携版 Console === -REM 旧版本可能正在运行,文件被占用会导致清理失败 +REM 旧版本可能正在运行,且 Electron 解压出来的 .pak 带只读属性,普通 rmdir 删不掉 taskkill /im "Scoreboard Console.exe" /f >nul 2>&1 taskkill /im scoreboard.exe /f >nul 2>&1 -rmdir /s /q "%CONSOLE_OUT%" 2>nul +powershell -NoProfile -Command "if (Test-Path '%CONSOLE_OUT%') { Remove-Item -Recurse -Force '%CONSOLE_OUT%' }" || exit /b 1 mkdir "%CONSOLE_OUT%" || exit /b 1 xcopy /e /i /y "console\node_modules\electron\dist" "%CONSOLE_OUT%" >nul || exit /b 1 mkdir "%CONSOLE_OUT%\resources\app" 2>nul