Implementiert ein professionelles Build-System für Windows-Benutzer ohne Python-Installation: PyInstaller-Integration: - DocuMentor.spec mit automatischer Icon/Version-Einbindung - Unterstützung für alle PySide6-UI-Dateien und Dependencies - UPX-Kompression für kleinere Executable-Größe Icon-System: - create_icon.py generiert Standard-Icon oder konvertiert PNG zu ICO - Multi-Size ICO (16x16 bis 256x256) für alle Windows-Kontexte - Automatische Integration in Build-Prozess - Prompts für Bild-KIs (Gemini, DALL-E, etc.) Versionsinformationen: - create_version_info.py liest Version aus pyproject.toml - Windows-Datei-Eigenschaften (Rechtsklick → Details) - Automatische Generierung bei jedem Build Build-Automatisierung: - build_windows.py orchestriert gesamten Build-Prozess - Erstellt Icon und Versionsinformationen automatisch - Generiert ZIP-Archiv für Distribution - Cleanup alter Builds Inno Setup-Integration: - installer.iss für professionelle Setup.exe - GUID-Generator (generate_guid.py) - Desktop-Verknüpfungen und Start-Menü-Integration Dokumentation: - BUILD.md - Schnellstart-Anleitung - docs/windows_distribution.md - Detaillierte Distribution-Dokumentation - docs/icon_and_version_info.md - Icon- und Versions-System - resources/icon_prompt.md - KI-Prompts für Icon-Generierung Dependencies: - pyinstaller>=6.0.0 für Executable-Erstellung - pillow>=10.0.0 für Icon-Generierung Externe Abhängigkeiten (Java, FOP, Saxon, diff-pdf) bleiben separat installierbar. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
6.7 KiB
DocuMentor Build-Anleitung
Schnellstart: Windows-Distribution erstellen
Voraussetzungen
# Dependencies installieren (inkl. Pillow für Icon-Generierung)
uv sync --all-groups
Build ausführen
# Automatischer Build (empfohlen)
uv run python build_windows.py
Dies erstellt automatisch:
- Icon (falls nicht vorhanden):
resources/icon.ico - Versionsinformationen:
version_info.txt - Executable:
dist/DocuMentor/DocuMentor.exe(mit Icon und Versionsinformationen) - ZIP-Archiv:
dist/DocuMentor-YYYYMMDD-Windows.zip
Icon anpassen (optional)
# Standard-Icon generieren
uv run python create_icon.py
# Oder eigenes PNG-Icon konvertieren
uv run python create_icon.py mein-logo.png
Manuelle Build-Schritte
# 1. Cleanup
rm -rf build/ dist/
# 2. PyInstaller ausführen
uv run pyinstaller --clean DocuMentor.spec
# 3. Testen
# Auf Windows: dist/DocuMentor/DocuMentor.exe
# Mit Wine: wine dist/DocuMentor/DocuMentor.exe
Setup.exe erstellen (optional)
Mit Inno Setup
-
Inno Setup installieren: https://jrsoftware.org/isdl.php
-
GUID generieren für
installer.iss(nur beim ersten Mal!):uv run python generate_guid.pyKopiere die generierte GUID und füge sie in
installer.issbeiAppIdein (Zeile ~22).WICHTIG: Die GUID nur EINMAL generieren! Bei Updates dieselbe GUID verwenden.
-
Windows-Build erstellen:
uv run python build_windows.pyDies erstellt automatisch das Icon und kopiert es nach
dist/DocuMentor/. -
Installer kompilieren:
iscc installer.iss -
Ergebnis:
dist/installer/DocuMentor-Setup-0.1.0.exe(mit Icon und Versionsinformationen)
MSI erstellen (optional)
Mit WiX Toolset - noch zu implementieren.
Konfiguration anpassen
Icon anpassen
Option 1: Standard-Icon generieren
uv run python create_icon.py
Option 2: Eigenes Icon aus PNG erstellen
uv run python create_icon.py ihr-logo.png
Option 3: Manuell ICO-Datei platzieren
- Icon erstellen oder downloaden (
.icoFormat mit mehreren Größen) - Als
resources/icon.icospeichern - Beim nächsten Build wird es automatisch verwendet
Das Icon wird automatisch verwendet für:
- Windows-Executable (DocuMentor.exe)
- Inno Setup Installer
- Desktop-Verknüpfungen
Anforderungen:
- Multi-Size ICO (16x16 bis 256x256 Pixel)
- Das
create_icon.pySkript erstellt alle Größen automatisch
Versionsinformationen
Automatische Generierung:
Versionsinformationen werden automatisch aus pyproject.toml generiert:
uv run python create_version_info.py
Dies liest die Version aus pyproject.toml und erstellt version_info.txt.
Version ändern:
In pyproject.toml:
version = "0.2.0"
Auch aktualisieren in:
installer.iss(Zeile 13:#define MyAppVersion)
Dann Versionsinformationen neu generieren:
uv run python create_version_info.py
Was enthalten die Versionsinformationen:
- Dateiversion und Produktversion
- Beschreibung und Copyright
- Anwendungsname
- Wird in Windows Explorer angezeigt (Rechtsklick → Eigenschaften → Details)
Build-Größe reduzieren
In DocuMentor.spec Module ausschließen:
excludes=[
'tkinter',
'matplotlib',
'test',
'unittest',
],
One-File Build (alles in einer .exe)
In DocuMentor.spec ändern:
exe = EXE(
pyz,
a.scripts,
a.binaries, # Uncomment
a.zipfiles, # Uncomment
a.datas, # Uncomment
[], # Comment out
exclude_binaries=False, # Ändern
# ...
name='DocuMentor',
onefile=True, # Hinzufügen
)
# COLLECT auskommentieren oder entfernen
Achtung: One-File ist langsamer beim Start (3-5 Sekunden).
Testing
Lokales Testing
# Build erstellen
uv run python build_windows.py
# Mit Wine testen (Linux/WSL)
wine dist/DocuMentor/DocuMentor.exe
Testing auf Windows
- ZIP-Datei auf Windows-System kopieren
- Entpacken
DocuMentor.exestarten- Features testen:
- Programmstart
- Einstellungsdialog öffnet beim ersten Start
- Projekt öffnen/erstellen
- Tree-Navigation
- XSL/XML-Dateien hinzufügen
- PDF-Generierung (mit konfigurierten Tools)
- PDF-Vergleich
Troubleshooting
"Module not found" beim Start
Lösung: Hidden imports in DocuMentor.spec ergänzen:
hiddenimports=[
'missing.module',
]
Antivirus blockiert die .exe
Ursache: Unsigned executables werden oft als verdächtig eingestuft.
Lösungen:
- Code-Signing-Zertifikat kaufen und verwenden
- Bei Microsoft SmartScreen einreichen
- Exception in Antivirus eintragen (für Tests)
Executable ist zu groß (>200 MB)
Lösungen:
- UPX-Kompression ist bereits aktiv
- Ungenutzte Module excluden (siehe oben)
- Virtual Environment aufräumen:
uv sync --no-dev
UI-Dateien nicht gefunden
Problem: .ui Dateien werden nicht gefunden.
Lösung: In DocuMentor.spec prüfen:
datas=ui_files, # Muss gesetzt sein
Automatisierung
GitHub Actions (CI/CD)
Siehe docs/windows_distribution.md für vollständiges Beispiel.
Lokales Release-Skript
#!/bin/bash
# release.sh - Erstellt vollständiges Release
VERSION="0.1.0"
echo "Building DocuMentor v$VERSION..."
# 1. Build
uv run python build_windows.py
# 2. Installer (falls Inno Setup installiert)
if command -v iscc &> /dev/null; then
iscc installer.iss
echo "✓ Installer erstellt"
fi
echo ""
echo "Release v$VERSION fertig!"
echo " • ZIP: dist/DocuMentor-*-Windows.zip"
echo " • Setup: dist/installer/DocuMentor-Setup-$VERSION.exe"
Distribution
ZIP-Archiv
Vorteile:
- Einfach, portable
- Keine Installation nötig
- USB-Stick-fähig
Verwendung:
- Auf GitHub Releases hochladen
- Per E-Mail versenden
- Auf Webserver bereitstellen
Setup.exe
Vorteile:
- Professionell
- Start-Menü-Integration
- Deinstallation
Verwendung:
- Primäre Distributions-Methode
- Auf Website zum Download anbieten
Dokumentation für Endbenutzer
Die dist/DocuMentor/README.txt wird automatisch erstellt und enthält:
- Installationsanweisungen
- Liste der externen Abhängigkeiten
- Konfigurationshinweise
Weitere Informationen
Siehe docs/windows_distribution.md für detaillierte Dokumentation.