Fix: Build-Skripte verwenden Versionsnummer aus pyproject.toml für Ausgabedateien (v1.5.1)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+20
-3
@@ -6,9 +6,18 @@ Erstellt einen MSI-Installer aus dem PyInstaller Build.
|
||||
|
||||
import subprocess
|
||||
import sys
|
||||
import tomllib
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
def get_version(project_root: Path) -> str:
|
||||
"""Liest die Versionsnummer aus pyproject.toml."""
|
||||
pyproject_path = project_root / "pyproject.toml"
|
||||
with pyproject_path.open("rb") as f:
|
||||
data = tomllib.load(f)
|
||||
return data["project"]["version"]
|
||||
|
||||
|
||||
def build_msi():
|
||||
"""Erstellt MSI-Installer mit WiX v6."""
|
||||
project_root = Path(__file__).parent
|
||||
@@ -19,7 +28,12 @@ def build_msi():
|
||||
print("Bitte zuerst ausführen: uv run python build_windows.py")
|
||||
sys.exit(1)
|
||||
|
||||
version = get_version(project_root)
|
||||
msi_output = project_root / "dist" / f"DocuMentor-{version}.msi"
|
||||
|
||||
print(f"DocuMentor Build gefunden: {dist_dir}")
|
||||
print(f"Version: {version}")
|
||||
print(f"MSI-Ausgabe: {msi_output}")
|
||||
print()
|
||||
|
||||
# Schritt 1: ProductFiles.wxs generieren (ersetzt WiX heat)
|
||||
@@ -34,7 +48,10 @@ def build_msi():
|
||||
|
||||
# Schritt 2: MSI kompilieren mit WiX v6
|
||||
print("Schritt 2/2: Kompiliere MSI-Installer...")
|
||||
result = subprocess.run(["wix", "build", "DocuMentor.wxs", "ProductFiles.wxs", "-o", "DocuMentor.msi"], check=False)
|
||||
result = subprocess.run(
|
||||
["wix", "build", "DocuMentor.wxs", "ProductFiles.wxs", "-o", str(msi_output)],
|
||||
check=False,
|
||||
)
|
||||
|
||||
if result.returncode != 0:
|
||||
print("\nFEHLER: MSI-Kompilierung fehlgeschlagen!")
|
||||
@@ -43,10 +60,10 @@ def build_msi():
|
||||
sys.exit(1)
|
||||
|
||||
print()
|
||||
print("[OK] MSI erfolgreich erstellt: DocuMentor.msi")
|
||||
print(f"[OK] MSI erfolgreich erstellt: {msi_output}")
|
||||
print()
|
||||
print("Installation testen mit:")
|
||||
print(" msiexec /i DocuMentor.msi")
|
||||
print(f" msiexec /i \"{msi_output}\"")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user