Fix: Version und Drittanbieter-Lizenzen im PyInstaller-Build anzeigen (v1.2.6)
pyproject.toml und THIRD_PARTY_LICENSES.txt werden nun ins PyInstaller-Bundle eingebunden. Pfadauflösung nutzt sys._MEIPASS im Bundle-Kontext. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -45,11 +45,14 @@ class AboutDialog(QDialog):
|
||||
try:
|
||||
return version("DocuMentor")
|
||||
except PackageNotFoundError:
|
||||
# Fallback: pyproject.toml parsen (Entwicklungsmodus ohne Installation)
|
||||
# Fallback: pyproject.toml parsen (PyInstaller-Bundle oder Entwicklungsmodus)
|
||||
try:
|
||||
import tomllib
|
||||
|
||||
pyproject = Path(__file__).parent.parent.parent / "pyproject.toml"
|
||||
if hasattr(sys, "_MEIPASS"):
|
||||
pyproject = Path(sys._MEIPASS) / "pyproject.toml" # type: ignore[attr-defined]
|
||||
else:
|
||||
pyproject = Path(__file__).parent.parent.parent / "pyproject.toml"
|
||||
with open(pyproject, "rb") as f:
|
||||
return tomllib.load(f)["project"]["version"]
|
||||
except Exception:
|
||||
|
||||
Reference in New Issue
Block a user