Files
pqs-9100_client/build/clean-and-build.bat
2025-11-26 08:50:22 +08:00

70 lines
1.4 KiB
Batchfile
Raw Blame History

@echo off
chcp 65001 >nul
echo ========================================
echo 清理并重新打包`r
echo ========================================
echo.
echo [1/5] 结束所有相关进<E585B3>?..
echo 正在停止 NPQS9100...
taskkill /F /IM NPQS9100.exe 2>nul
echo 正在停止 Java...
taskkill /F /IM java.exe 2>nul
taskkill /F /IM javaw.exe 2>nul
echo <20>?所有进程已结束
timeout /t 2 /nobreak >nul
echo.
echo [2/5] 删除 out 目录...
cd /d "%~dp0.."
if exist out (
rmdir /s /q out 2>nul
if exist out (
echo <20>?删除失败,请手动删除 out 目录
pause
exit /b 1
) else (
echo <20>?out 目录已删除`r
)
) else (
echo <20>?out 目录不存在`r
)
echo.
echo [3/5] 构建前端代码...
call npm run build-frontend
if %errorlevel% neq 0 (
echo <20>?前端构建失败
pause
exit /b 1
)
echo <20>?前端代码构建完成
echo.
echo [4/5] 构建 electron 代码...
call npm run build-electron
if %errorlevel% neq 0 (
echo <20>?electron 构建失败
pause
exit /b 1
)
echo <20>?electron 代码构建完成
echo.
echo [5/5] 打包 Windows 版本(包含代码加密)...
call npm run build-w
if %errorlevel% neq 0 (
echo <20>?打包失败
pause
exit /b 1
)
echo.
echo ========================================
echo <20>?打包完成!`r
echo 输出目录: out\win-unpacked\
echo ========================================
echo.
pause