1addd5b2ab
* fix: handle pip install execution in frozen runtime * fix: harden pip subprocess fallback handling * fix: scope global data root to packaged electron runtime * refactor: inline frozen runtime check for electron guard * fix: prefer current interpreter for source pip installs * fix: avoid resolving venv python symlink for pip * refactor: share runtime environment detection utilities * fix: improve error message when pip module is unavailable * fix: raise ImportError when pip module is unavailable * fix: preserve ImportError semantics for missing pip * fix: 修复非electron app环境更新时仍然显示electron更新对话框的问题 --------- Co-authored-by: Soulter <905617992@qq.com>
11 lines
233 B
Python
11 lines
233 B
Python
import os
|
|
import sys
|
|
|
|
|
|
def is_frozen_runtime() -> bool:
|
|
return bool(getattr(sys, "frozen", False))
|
|
|
|
|
|
def is_packaged_electron_runtime() -> bool:
|
|
return is_frozen_runtime() and os.environ.get("ASTRBOT_ELECTRON_CLIENT") == "1"
|