Files
pricing_review/启动造价审核.bat
2026-10-11 10:52:01 +08:00

37 lines
1.0 KiB
Batchfile
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
@echo off
cd /d "%~dp0"
rem 2026-10-11:不再写死个人机 python 路径。查找顺序 = py -3 -> python。
rem Windows 商店的 python 占位符会"静默退出",所以每个候选都先探测一次。
set "PY="
py -3 -c "import sys" >nul 2>&1
if not errorlevel 1 set "PY=py -3"
if not defined PY (
python -c "import sys" >nul 2>&1
if not errorlevel 1 set "PY=python"
)
if not defined PY goto NOPY
if not exist "%~dp0launch.py" goto NOFILE
echo 正在启动造价审核,请稍候...
%PY% launch.py
if errorlevel 1 goto FAIL
goto END
:FAIL
echo.
echo 启动失败。常见原因:
echo 1. 提示 ModuleNotFoundError 缺依赖 —— 执行: %PY% -m pip install -r requirements.txt
echo 2. 提示授权/激活 —— 商业版门禁属正常,联网激活或联系软件提供方
echo 请把上面的错误信息截图发出来。
pause
goto END
:NOPY
echo 没有找到可用的 Python(需要 3.11 及以上)。
echo 请到 https://www.python.org/downloads/ 安装,安装时勾选 "Add python.exe to PATH",
echo 装完后重新双击本文件。
pause
goto END
:NOFILE
echo 找不到启动文件 launch.py
echo 请确认你在正确的文件夹里运行本文件。
pause
:END