@echo off chcp 65001 >nul echo ======================================== echo 清理并重新打包 echo ======================================== echo. echo [1/4] 删除 out 目录... cd /d "%~dp0.." if exist out ( rmdir /s /q out 2>nul if exist out ( echo 删除失败,请手动删除 out 目录 pause exit /b 1 ) else ( echo out 目录已删除 ) ) else ( echo out 目录不存在 ) echo. echo [2/4] 构建前端代码... call npm run build-frontend if %errorlevel% neq 0 ( echo 前端构建失败 pause exit /b 1 ) echo 前端代码构建完成 echo. echo [3/4] 构建 electron 代码... call npm run build-electron if %errorlevel% neq 0 ( echo electron 构建失败 pause exit /b 1 ) echo electron 代码构建完成 echo. echo [4/4] 打包 Windows 版本(包含代码加密)... call npm run build-w if %errorlevel% neq 0 ( echo 打包失败 pause exit /b 1 ) echo. echo ======================================== echo 打包完成! echo 输出目录: out\win-unpacked\ echo ======================================== echo. pause