Docs: WiX MSI-Installer Anleitung zu Windows Distribution hinzugefügt

- 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
This commit is contained in:
2026-01-18 17:58:37 +01:00
parent b1f259e443
commit c3d1bbc74c
+249 -15
View File
@@ -47,11 +47,239 @@ iscc installer.iss
Dies erstellt: Dies erstellt:
- `dist/installer/DocuMentor-Setup-0.1.0.exe` - Professioneller Installer - `dist/installer/DocuMentor-Setup-0.1.0.exe` - Professioneller Installer
### Option 3: MSI-Installer mit WiX ### Option 3: MSI-Installer mit WiX
```bash **Voraussetzungen:**
# TODO: WiX-Konfiguration noch zu erstellen ```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
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<!-- Produkt-Definition -->
<Product
Id="*"
Name="DocuMentor"
Language="1031"
Version="0.1.0"
Manufacturer="Ihr Name/Firma"
UpgradeCode="PUT-YOUR-UPGRADE-GUID-HERE">
<Package
InstallerVersion="200"
Compressed="yes"
InstallScope="perMachine"
Description="Professionelle XSL-Transformations-Verwaltung"
Comments="DocuMentor - XSL/PDF Management Tool" />
<!-- Upgrade-Logik (deinstalliert alte Versionen) -->
<MajorUpgrade
DowngradeErrorMessage="Eine neuere Version ist bereits installiert."
AllowSameVersionUpgrades="yes" />
<MediaTemplate EmbedCab="yes" />
<!-- Feature-Definition -->
<Feature Id="ProductFeature" Title="DocuMentor" Level="1">
<ComponentGroupRef Id="ProductComponents" />
<ComponentRef Id="ApplicationShortcut" />
<ComponentRef Id="DesktopShortcut" />
</Feature>
<!-- UI-Dialoge (Standard-Installer-Oberfläche) -->
<UIRef Id="WixUI_InstallDir" />
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLFOLDER" />
<!-- Icon für Programme und Funktionen -->
<Icon Id="icon.ico" SourceFile="resources\icon.ico"/>
<Property Id="ARPPRODUCTICON" Value="icon.ico" />
<!-- Website-Link in Systemsteuerung -->
<Property Id="ARPHELPLINK" Value="https://github.com/IhrRepo/DocuMentor" />
</Product>
<!-- Fragment: Verzeichnisstruktur -->
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLFOLDER" Name="DocuMentor" />
</Directory>
<!-- Start-Menü -->
<Directory Id="ProgramMenuFolder">
<Directory Id="ApplicationProgramsFolder" Name="DocuMentor"/>
</Directory>
<!-- Desktop -->
<Directory Id="DesktopFolder" Name="Desktop" />
</Directory>
</Fragment>
<!-- Fragment: Komponenten (Dateien) -->
<Fragment>
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
<!-- Hauptexecutable -->
<Component Id="MainExecutable" Guid="PUT-COMPONENT-GUID-HERE">
<File Id="DocuMentorEXE" Source="dist\DocuMentor\DocuMentor.exe" KeyPath="yes" />
</Component>
<!-- Alle weiteren Dateien aus dist/DocuMentor/ -->
<!-- HINWEIS: In Produktion heat.exe verwenden für automatisches Harvesting -->
<Component Id="AllFiles" Guid="PUT-COMPONENT-GUID-HERE-2">
<File Id="AllFilesMarker" Source="dist\DocuMentor\*" KeyPath="yes" />
</Component>
</ComponentGroup>
<!-- Start-Menü Verknüpfung -->
<DirectoryRef Id="ApplicationProgramsFolder">
<Component Id="ApplicationShortcut" Guid="PUT-COMPONENT-GUID-HERE-3">
<Shortcut
Id="ApplicationStartMenuShortcut"
Name="DocuMentor"
Description="XSL-Transformations-Verwaltung"
Target="[INSTALLFOLDER]DocuMentor.exe"
WorkingDirectory="INSTALLFOLDER"
Icon="icon.ico" />
<RemoveFolder Id="CleanUpShortCut" Directory="ApplicationProgramsFolder" On="uninstall"/>
<RegistryValue
Root="HKCU"
Key="Software\DocuMentor"
Name="installed"
Type="integer"
Value="1"
KeyPath="yes"/>
</Component>
</DirectoryRef>
<!-- Desktop Verknüpfung (optional) -->
<DirectoryRef Id="DesktopFolder">
<Component Id="DesktopShortcut" Guid="PUT-COMPONENT-GUID-HERE-4">
<Shortcut
Id="DesktopShortcut"
Name="DocuMentor"
Target="[INSTALLFOLDER]DocuMentor.exe"
WorkingDirectory="INSTALLFOLDER"
Icon="icon.ico" />
<RegistryValue
Root="HKCU"
Key="Software\DocuMentor"
Name="desktopShortcut"
Type="integer"
Value="1"
KeyPath="yes"/>
</Component>
</DirectoryRef>
</Fragment>
</Wix>
```
**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 ## Manuelle Schritte
@@ -143,16 +371,22 @@ dist/DocuMentor-YYYYMMDD-Windows.zip
- Benötigt Administrator-Rechte (optional) - Benötigt Administrator-Rechte (optional)
- Komplexere Konfiguration - Komplexere Konfiguration
### MSI-Installer ### MSI-Installer (WiX)
**Vorteile:** **Vorteile:**
- Windows-Standard - Windows-Standard (.msi Format)
- Gruppen-Richtlinien-fähig - Gruppen-Richtlinien-Deployment (GPO) für Enterprise
- Silent Installation möglich - Silent Installation möglich (`msiexec /quiet`)
- Windows Installer Transaktionen und Rollback
**Nachteile:** - Patch-Unterstützung (.msp für Updates)
- Komplexe Erstellung - Deinstallation über Systemsteuerung integriert
- Benötigt WiX Toolset - 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 ## Externe Abhängigkeiten