Füge WiX v6-kompatiblen MSI-Installer hinzu

- Erstelle generate_wix_files.py zum Ersetzen von 'wix heat'
- Migriere DocuMentor.wxs auf WiX v4/v6-Syntax
- Füge build_msi.py für automatisierten Build hinzu
- Aktualisiere Dokumentation für WiX v6
- Erweitere .gitignore für WiX-Artefakte

WiX v6 hat das 'heat' Tool entfernt, daher wurde ein Python-Skript
erstellt, das automatisch alle Dateien aus dist/DocuMentor harvested
und eine WiX-konforme ProductFiles.wxs generiert.

Der neue Build-Prozess:
1. uv run python build_windows.py
2. uv run python generate_wix_files.py
3. wix build DocuMentor.wxs ProductFiles.wxs -o DocuMentor.msi

Oder vereinfacht: uv run python build_msi.py
This commit is contained in:
2026-01-18 19:01:05 +01:00
parent c3d1bbc74c
commit 43bd0ec8e6
5 changed files with 353 additions and 172 deletions
+53
View File
@@ -0,0 +1,53 @@
"""
WiX MSI Build-Skript für DocuMentor (WiX v6)
Erstellt einen MSI-Installer aus dem PyInstaller Build.
"""
import subprocess
import sys
from pathlib import Path
def build_msi():
"""Erstellt MSI-Installer mit WiX v6."""
project_root = Path(__file__).parent
dist_dir = project_root / "dist" / "DocuMentor"
if not dist_dir.exists():
print("FEHLER: PyInstaller Build nicht gefunden!")
print("Bitte zuerst ausführen: uv run python build_windows.py")
sys.exit(1)
print(f"DocuMentor Build gefunden: {dist_dir}")
print()
# Schritt 1: ProductFiles.wxs generieren (ersetzt WiX heat)
print("Schritt 1/2: Generiere ProductFiles.wxs...")
result = subprocess.run(["uv", "run", "python", "generate_wix_files.py"], check=False)
if result.returncode != 0:
print("\nFEHLER: ProductFiles.wxs Generierung fehlgeschlagen!")
sys.exit(1)
print()
# 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)
if result.returncode != 0:
print("\nFEHLER: MSI-Kompilierung fehlgeschlagen!")
print("Stelle sicher, dass WiX v6 installiert ist:")
print(" dotnet tool install --global wix")
sys.exit(1)
print()
print("[OK] MSI erfolgreich erstellt: DocuMentor.msi")
print()
print("Installation testen mit:")
print(" msiexec /i DocuMentor.msi")
if __name__ == "__main__":
build_msi()