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:
2026-03-28 19:32:03 +01:00
parent 09312dbd66
commit d7282082f4
7 changed files with 59 additions and 48 deletions
+4 -1
View File
@@ -33,7 +33,10 @@ a = Analysis(
[str(src_path / 'main.py')],
pathex=[str(src_path)],
binaries=cx_binaries,
datas=ui_files + res_files + cx_datas,
datas=ui_files + res_files + cx_datas + [
(str(project_root / 'pyproject.toml'), '.'),
(str(project_root / 'THIRD_PARTY_LICENSES.txt'), '.'),
],
hiddenimports=[
'PySide6.QtCore',
'PySide6.QtGui',
+1 -1
View File
@@ -4,7 +4,7 @@
<!-- Paket-Definition (ersetzt Product in v4) -->
<Package
Name="DocuMentor"
Version="1.2.5"
Version="1.2.6"
Manufacturer="Vitali Graf / Software- und Datenbankentwicklung"
UpgradeCode="F498B66C-726D-44AA-95F4-CB4FBDCEF26E"
Language="1031"
+1 -1
View File
@@ -253,5 +253,5 @@ HINWEISE
================================================================================
Stand: März 2026
Erstellt für: DocuMentor v1.2.5
Erstellt für: DocuMentor v1.2.6
================================================================================
+1 -1
View File
@@ -10,7 +10,7 @@
; Build-Befehl: iscc installer.iss
#define MyAppName "DocuMentor"
#define MyAppVersion "1.2.5"
#define MyAppVersion "1.2.6"
#define MyAppPublisher "Ihr Name/Organisation"
#define MyAppURL "https://github.com/yourusername/xsl-validator"
#define MyAppExeName "DocuMentor.exe"
+1 -1
View File
@@ -1,6 +1,6 @@
[project]
name = "DocuMentor"
version = "1.2.5"
version = "1.2.6"
description = "Professionelle XSL-Transformations-Verwaltung und PDF-Generierung"
readme = "README.md"
license = {text = "MIT"}
+7 -2
View File
@@ -6,14 +6,19 @@ mit den tatsächlich installierten Paketversionen via importlib.metadata.
"""
import logging
import re
import sys
from dataclasses import dataclass, field
from importlib.metadata import PackageNotFoundError, version
from pathlib import Path
logger = logging.getLogger(__name__)
# Pfad zur Lizenzdatei relativ zum Projektroot
LICENSE_FILE = Path(__file__).parent.parent / "THIRD_PARTY_LICENSES.txt"
# Pfad zur Lizenzdatei: im PyInstaller-Bundle aus sys._MEIPASS,
# im Entwicklungsmodus relativ zum Projektroot
if hasattr(sys, "_MEIPASS"):
LICENSE_FILE = Path(sys._MEIPASS) / "THIRD_PARTY_LICENSES.txt" # type: ignore[attr-defined]
else:
LICENSE_FILE = Path(__file__).parent.parent / "THIRD_PARTY_LICENSES.txt"
# Mapping von Anzeigenamen zu PyPI-Paketnamen für Sonderfälle
_PACKAGE_NAME_MAP: dict[str, str] = {
+5 -2
View File
@@ -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: