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:
+4
-1
@@ -33,7 +33,10 @@ a = Analysis(
|
|||||||
[str(src_path / 'main.py')],
|
[str(src_path / 'main.py')],
|
||||||
pathex=[str(src_path)],
|
pathex=[str(src_path)],
|
||||||
binaries=cx_binaries,
|
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=[
|
hiddenimports=[
|
||||||
'PySide6.QtCore',
|
'PySide6.QtCore',
|
||||||
'PySide6.QtGui',
|
'PySide6.QtGui',
|
||||||
|
|||||||
+1
-1
@@ -4,7 +4,7 @@
|
|||||||
<!-- Paket-Definition (ersetzt Product in v4) -->
|
<!-- Paket-Definition (ersetzt Product in v4) -->
|
||||||
<Package
|
<Package
|
||||||
Name="DocuMentor"
|
Name="DocuMentor"
|
||||||
Version="1.2.5"
|
Version="1.2.6"
|
||||||
Manufacturer="Vitali Graf / Software- und Datenbankentwicklung"
|
Manufacturer="Vitali Graf / Software- und Datenbankentwicklung"
|
||||||
UpgradeCode="F498B66C-726D-44AA-95F4-CB4FBDCEF26E"
|
UpgradeCode="F498B66C-726D-44AA-95F4-CB4FBDCEF26E"
|
||||||
Language="1031"
|
Language="1031"
|
||||||
|
|||||||
@@ -253,5 +253,5 @@ HINWEISE
|
|||||||
|
|
||||||
================================================================================
|
================================================================================
|
||||||
Stand: März 2026
|
Stand: März 2026
|
||||||
Erstellt für: DocuMentor v1.2.5
|
Erstellt für: DocuMentor v1.2.6
|
||||||
================================================================================
|
================================================================================
|
||||||
|
|||||||
+1
-1
@@ -10,7 +10,7 @@
|
|||||||
; Build-Befehl: iscc installer.iss
|
; Build-Befehl: iscc installer.iss
|
||||||
|
|
||||||
#define MyAppName "DocuMentor"
|
#define MyAppName "DocuMentor"
|
||||||
#define MyAppVersion "1.2.5"
|
#define MyAppVersion "1.2.6"
|
||||||
#define MyAppPublisher "Ihr Name/Organisation"
|
#define MyAppPublisher "Ihr Name/Organisation"
|
||||||
#define MyAppURL "https://github.com/yourusername/xsl-validator"
|
#define MyAppURL "https://github.com/yourusername/xsl-validator"
|
||||||
#define MyAppExeName "DocuMentor.exe"
|
#define MyAppExeName "DocuMentor.exe"
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
[project]
|
[project]
|
||||||
name = "DocuMentor"
|
name = "DocuMentor"
|
||||||
version = "1.2.5"
|
version = "1.2.6"
|
||||||
description = "Professionelle XSL-Transformations-Verwaltung und PDF-Generierung"
|
description = "Professionelle XSL-Transformations-Verwaltung und PDF-Generierung"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
license = {text = "MIT"}
|
license = {text = "MIT"}
|
||||||
|
|||||||
@@ -6,14 +6,19 @@ mit den tatsächlich installierten Paketversionen via importlib.metadata.
|
|||||||
"""
|
"""
|
||||||
import logging
|
import logging
|
||||||
import re
|
import re
|
||||||
|
import sys
|
||||||
from dataclasses import dataclass, field
|
from dataclasses import dataclass, field
|
||||||
from importlib.metadata import PackageNotFoundError, version
|
from importlib.metadata import PackageNotFoundError, version
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
# Pfad zur Lizenzdatei relativ zum Projektroot
|
# Pfad zur Lizenzdatei: im PyInstaller-Bundle aus sys._MEIPASS,
|
||||||
LICENSE_FILE = Path(__file__).parent.parent / "THIRD_PARTY_LICENSES.txt"
|
# 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
|
# Mapping von Anzeigenamen zu PyPI-Paketnamen für Sonderfälle
|
||||||
_PACKAGE_NAME_MAP: dict[str, str] = {
|
_PACKAGE_NAME_MAP: dict[str, str] = {
|
||||||
|
|||||||
@@ -45,10 +45,13 @@ class AboutDialog(QDialog):
|
|||||||
try:
|
try:
|
||||||
return version("DocuMentor")
|
return version("DocuMentor")
|
||||||
except PackageNotFoundError:
|
except PackageNotFoundError:
|
||||||
# Fallback: pyproject.toml parsen (Entwicklungsmodus ohne Installation)
|
# Fallback: pyproject.toml parsen (PyInstaller-Bundle oder Entwicklungsmodus)
|
||||||
try:
|
try:
|
||||||
import tomllib
|
import tomllib
|
||||||
|
|
||||||
|
if hasattr(sys, "_MEIPASS"):
|
||||||
|
pyproject = Path(sys._MEIPASS) / "pyproject.toml" # type: ignore[attr-defined]
|
||||||
|
else:
|
||||||
pyproject = Path(__file__).parent.parent.parent / "pyproject.toml"
|
pyproject = Path(__file__).parent.parent.parent / "pyproject.toml"
|
||||||
with open(pyproject, "rb") as f:
|
with open(pyproject, "rb") as f:
|
||||||
return tomllib.load(f)["project"]["version"]
|
return tomllib.load(f)["project"]["version"]
|
||||||
|
|||||||
Reference in New Issue
Block a user