From c3d1bbc74ce6f2f17c459e4a40d4282e2be6f123 Mon Sep 17 00:00:00 2001 From: Vitali Graf Date: Sun, 18 Jan 2026 17:58:37 +0100 Subject: [PATCH] =?UTF-8?q?Docs:=20WiX=20MSI-Installer=20Anleitung=20zu=20?= =?UTF-8?q?Windows=20Distribution=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Vollständige WiX-Konfiguration (DocuMentor.wxs) - Heat-Tool für automatisches File Harvesting - Build-Automatisierung mit build_msi.py - Silent Installation und GPO-Deployment - MSI-Vorteile vs. Inno Setup detailliert erklärt --- docs/windows_distribution.md | 264 +++++++++++++++++++++++++++++++++-- 1 file changed, 249 insertions(+), 15 deletions(-) diff --git a/docs/windows_distribution.md b/docs/windows_distribution.md index e1630f0..c0e0cb5 100644 --- a/docs/windows_distribution.md +++ b/docs/windows_distribution.md @@ -47,11 +47,239 @@ iscc installer.iss Dies erstellt: - `dist/installer/DocuMentor-Setup-0.1.0.exe` - Professioneller Installer -### Option 3: MSI-Installer mit WiX - -```bash -# TODO: WiX-Konfiguration noch zu erstellen -``` +### Option 3: MSI-Installer mit WiX + +**Voraussetzungen:** +```bash +# WiX Toolset v4 installieren (empfohlen) +dotnet tool install --global wix + +# Oder WiX v3 von https://wixtoolset.org/releases/ +``` + +**Schritt 1: PyInstaller Build erstellen** +```bash +uv run python build_windows.py +``` + +**Schritt 2: WiX-Konfiguration erstellen (`DocuMentor.wxs`):** +```xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +``` + +**Schritt 3: GUIDs generieren** +```bash +# GUIDs mit PowerShell generieren +powershell -Command "[guid]::NewGuid()" + +# Oder Python-Skript verwenden +uv run python generate_guid.py +``` + +**Schritt 4: Dateien automatisch harvesten (empfohlen)** +```bash +# WiX v3: Heat Tool verwenden +heat dir dist\DocuMentor -cg ProductComponents -gg -sfrag -srd -dr INSTALLFOLDER -out ProductFiles.wxs + +# WiX v4: +wix heat dir dist\DocuMentor -cg ProductComponents -gg -sfrag -srd -dr INSTALLFOLDER -out ProductFiles.wxs +``` + +**Schritt 5: MSI kompilieren** +```bash +# WiX v3 +candle DocuMentor.wxs -out obj\ +light obj\DocuMentor.wixobj -out dist\installer\DocuMentor-0.1.0.msi -ext WixUIExtension + +# WiX v4 +wix build DocuMentor.wxs -out dist\installer\DocuMentor-0.1.0.msi +``` + +**Schritt 6: MSI testen** +```bash +# Installation (als Administrator) +msiexec /i dist\installer\DocuMentor-0.1.0.msi + +# Silent Installation für Deployment +msiexec /i DocuMentor-0.1.0.msi /quiet /qn /norestart + +# Deinstallation +msiexec /x dist\installer\DocuMentor-0.1.0.msi +``` + +**MSI-Vorteile gegenüber Inno Setup:** +- ✅ Windows-Standard (`.msi` Format) +- ✅ Gruppen-Richtlinien-Deployment (GPO) +- ✅ Silent Installation für Enterprise +- ✅ Windows Installer Service Transaktionen +- ✅ Rollback bei Fehlern +- ✅ Patch-Unterstützung (.msp) + +**Build-Automatisierung (`build_msi.py`):** +```python +"""WiX MSI Build-Skript für DocuMentor""" +import subprocess +import sys +from pathlib import Path + +def build_msi(): + project_root = Path(__file__).parent + dist_dir = project_root / "dist" / "DocuMentor" + + if not dist_dir.exists(): + print("Fehler: PyInstaller Build nicht gefunden. Erst build_windows.py ausführen!") + sys.exit(1) + + # Heat: Dateien harvesten + print("Harvesting Dateien mit Heat...") + subprocess.run([ + "heat", "dir", str(dist_dir), + "-cg", "ProductComponents", + "-gg", "-sfrag", "-srd", + "-dr", "INSTALLFOLDER", + "-out", "ProductFiles.wxs" + ], check=True) + + # Candle: WXS zu WIXOBJ kompilieren + print("Kompiliere WXS-Dateien...") + subprocess.run([ + "candle", "DocuMentor.wxs", "ProductFiles.wxs", + "-out", "obj\\" + ], check=True) + + # Light: WIXOBJ zu MSI linken + print("Erzeuge MSI-Installer...") + (project_root / "dist" / "installer").mkdir(exist_ok=True) + subprocess.run([ + "light", + "obj\\DocuMentor.wixobj", + "obj\\ProductFiles.wixobj", + "-out", "dist\\installer\\DocuMentor-0.1.0.msi", + "-ext", "WixUIExtension" + ], check=True) + + print("\n✅ MSI erstellt: dist\\installer\\DocuMentor-0.1.0.msi") + +if __name__ == "__main__": + build_msi() +``` ## Manuelle Schritte @@ -143,16 +371,22 @@ dist/DocuMentor-YYYYMMDD-Windows.zip - Benötigt Administrator-Rechte (optional) - Komplexere Konfiguration -### MSI-Installer - -**Vorteile:** -- Windows-Standard -- Gruppen-Richtlinien-fähig -- Silent Installation möglich - -**Nachteile:** -- Komplexe Erstellung -- Benötigt WiX Toolset +### MSI-Installer (WiX) + +**Vorteile:** +- Windows-Standard (.msi Format) +- Gruppen-Richtlinien-Deployment (GPO) für Enterprise +- Silent Installation möglich (`msiexec /quiet`) +- Windows Installer Transaktionen und Rollback +- Patch-Unterstützung (.msp für Updates) +- Deinstallation über Systemsteuerung integriert +- Versionsupgrades automatisch verwaltet + +**Nachteile:** +- Komplexere Erstellung als Inno Setup +- Benötigt WiX Toolset (kostenlos) +- XML-basierte Konfiguration +- Lernkurve für WiX-Syntax ## Externe Abhängigkeiten