@echo off chcp 65001 >nul setlocal cd /d "%~dp0" title 入库分拣工作站 - 打包 set "PY=C:\Users\17677\AppData\Local\Programs\Python\Python312\python.exe" if not exist "%PY%" set "PY=python" echo 正在检查 PyInstaller ... "%PY%" -c "import PyInstaller" >nul 2>&1 if errorlevel 1 ( echo 未安装,正在安装 PyInstaller ... "%PY%" -m pip install pyinstaller if errorlevel 1 ( echo. echo [错误] PyInstaller 安装失败,请检查网络后重试。 pause exit /b 1 ) ) set "ISCC=C:\Program Files (x86)\Inno Setup 6\ISCC.exe" if not exist "%ISCC%" set "ISCC=%LOCALAPPDATA%\Programs\Inno Setup 6\ISCC.exe" if not exist "%ISCC%" ( echo. echo [提示] 没找到 Inno Setup,本次只生成程序文件夹,不生成安装包。 echo 需要安装包请先执行:winget install JRSoftware.InnoSetup echo 或到 https://jrsoftware.org/isdl.php 下载安装后重跑。 echo. ) echo. "%PY%" build_exe.py --clean set "RC=%errorlevel%" echo. if not "%RC%"=="0" ( echo [打包失败] 错误码 %RC%,请看上面的输出。 pause exit /b %RC% ) echo 产物: echo 安装包 dist\入库分拣工作站_安装程序_v1.0.64.exe ^<-- 现场只拷这个 echo 绿色版 dist\入库分拣工作站\ pause endlocal