diff --git a/bin/emrg b/bin/emrg index 78aaca60..a3439c28 100755 --- a/bin/emrg +++ b/bin/emrg @@ -22,4 +22,12 @@ PREFIX="$(dirname "$DIR")" export PATH="$DIR:$PATH" export PYTHONPATH="$PREFIX/source:$PREFIX/lib:$PYTHONPATH" export PYTHONDONTWRITEBYTECODE=1 -exec "$DIR/python" -m emrg "$@" +# R100: Windows 下 bin/python(复制品)缺 DLL 不可用(DLL 在 python-dist/ 根)→ +# 探测 python-dist 里的 exe(与 emrg.cmd 一致);POSIX 用 bin/python 软链。 +PY_BIN="$DIR/python" +if [ -e "$DIR/python-dist/python.exe" ]; then + PY_BIN="$DIR/python-dist/python.exe" +elif [ -e "$DIR/python-dist/python3.13.exe" ]; then + PY_BIN="$DIR/python-dist/python3.13.exe" +fi +exec "$PY_BIN" -m emrg "$@" diff --git a/bin/emrgd b/bin/emrgd index 87497f0b..82c71ff0 100755 --- a/bin/emrgd +++ b/bin/emrgd @@ -16,4 +16,12 @@ PREFIX="$(dirname "$DIR")" export PATH="$DIR:$PATH" export PYTHONPATH="$PREFIX/source:$PREFIX/lib:$PYTHONPATH" export PYTHONDONTWRITEBYTECODE=1 -exec "$DIR/python" -m emrg.server "$@" +# R100: Windows 下 bin/python(复制品)缺 DLL 不可用(DLL 在 python-dist/ 根)→ +# 探测 python-dist 里的 exe(与 emrgd.cmd 一致);POSIX 用 bin/python 软链。 +PY_BIN="$DIR/python" +if [ -e "$DIR/python-dist/python.exe" ]; then + PY_BIN="$DIR/python-dist/python.exe" +elif [ -e "$DIR/python-dist/python3.13.exe" ]; then + PY_BIN="$DIR/python-dist/python3.13.exe" +fi +exec "$PY_BIN" -m emrg.server "$@" diff --git a/packaging/build-runtime.sh b/packaging/build-runtime.sh index 6dd3799a..404d5ef8 100755 --- a/packaging/build-runtime.sh +++ b/packaging/build-runtime.sh @@ -55,6 +55,11 @@ cp -R "$PY_ROOT/." "$DIST/bin/python-dist/" # Windows:Git Bash 的 ln -s 需管理员权限(软链创建失败)→ 用复制替代 cp "$PYEXE" python.exe cp "$PYEXE" python3.exe + # R100:python-build-standalone 的 DLL(python313.dll/vcruntime140*.dll 等) + # 在 python-dist/ 根目录——bin/python.exe 复制品缺 DLL 不可用(Windows loader + # 找不到 → 启动失败)。把根目录 *.dll 一并复制到 bin/,使 PATH 里的 + # python 命令(session-scoped 脚本)可用。 + cp python-dist/*.dll . 2>/dev/null || true else ln -sfn python-dist/bin/python3.13 python ln -sfn python-dist/bin/python3.13 python3