Build: Vollständige Windows-Distribution-Infrastruktur

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>
This commit is contained in:
2026-01-04 20:37:30 +01:00
parent 6976d21768
commit bb7cad9204
18 changed files with 1903 additions and 1 deletions
+102
View File
@@ -0,0 +1,102 @@
#!/usr/bin/env python3
"""
Generiert Windows-Versionsinformationen für PyInstaller
Liest Version aus pyproject.toml und erstellt version_info.txt
"""
import tomllib
from pathlib import Path
from datetime import datetime
def parse_version(version_str: str) -> tuple[int, int, int, int]:
"""Parst Version-String (z.B. '0.1.0') zu Tuple (0, 1, 0, 0)."""
parts = version_str.split('.')
major = int(parts[0]) if len(parts) > 0 else 0
minor = int(parts[1]) if len(parts) > 1 else 0
patch = int(parts[2]) if len(parts) > 2 else 0
build = 0 # Könnte aus Git-Commit-Count generiert werden
return (major, minor, patch, build)
def create_version_info(project_root: Path):
"""Erstellt version_info.txt für PyInstaller."""
# pyproject.toml lesen
pyproject_path = project_root / "pyproject.toml"
with open(pyproject_path, 'rb') as f:
pyproject = tomllib.load(f)
project = pyproject['project']
version = project['version']
name = project['name']
description = project['description']
# Version parsen
file_version = parse_version(version)
product_version = file_version
# Jahr für Copyright
year = datetime.now().year
# version_info.txt Content
version_info_content = f"""# UTF-8
#
# Generiert automatisch von create_version_info.py
# NICHT manuell bearbeiten!
#
VSVersionInfo(
ffi=FixedFileInfo(
# filevers und prodvers als Tuple: (1, 0, 0, 0)
filevers={file_version},
prodvers={product_version},
# Maske für gültige Bits in filevers und prodvers
mask=0x3f,
# Flags - kann VS_FF_DEBUG, VS_FF_PRERELEASE, etc. enthalten
flags=0x0,
# Betriebssystem - VOS_NT_WINDOWS32
OS=0x40004,
# Dateityp - VFT_APP (Anwendung)
fileType=0x1,
# Subtyp (nicht verwendet für VFT_APP)
subtype=0x0,
# Datumsstempel
date=(0, 0)
),
kids=[
StringFileInfo(
[
StringTable(
'040904B0', # Deutsch (0x0409 = Englisch, 0x0407 = Deutsch), Unicode
[StringStruct('CompanyName', 'Ihr Name/Organisation'),
StringStruct('FileDescription', '{description}'),
StringStruct('FileVersion', '{version}'),
StringStruct('InternalName', '{name}'),
StringStruct('LegalCopyright', '© {year} Ihr Name. Alle Rechte vorbehalten.'),
StringStruct('OriginalFilename', '{name}.exe'),
StringStruct('ProductName', '{name}'),
StringStruct('ProductVersion', '{version}')])
]),
VarFileInfo([VarStruct('Translation', [1033, 1200])]) # Englisch, Unicode
]
)
"""
# version_info.txt schreiben
version_info_path = project_root / "version_info.txt"
version_info_path.write_text(version_info_content, encoding='utf-8')
print(f"✓ version_info.txt erstellt")
print(f" Version: {version}")
print(f" Datei: {version_info_path}")
def main():
project_root = Path(__file__).parent
create_version_info(project_root)
if __name__ == "__main__":
main()