Files
EngineeringSync/installer/build-installer.ps1
EngineeringSync 04ae8a0aae Initial commit: EngineeringSync v1.0.0
Vollständige Implementierung des EngineeringSync-Middleware-Tools:
- Windows Service (Kestrel :5050) mit FileSystemWatcher + SignalR
- WPF Tray-App mit PendingChanges- und Projektverwaltungs-Fenster
- Setup-Wizard (8-Schritte-Installer)
- SQLite/EF Core Datenschicht (WAL-Modus)
- SHA-256-basiertes Debouncing (2s Fenster)
- Backup-System mit konfigurierbarer Aufbewahrung

Bugfixes & Verbesserungen:
- BUG-1: AppDbContext OnConfiguring invertierte Bedingung behoben
- BUG-2: Event-Handler-Leak in TrayApp (Fenster-Singleton-Pattern)
- BUG-3: ProjectConfigChanged SignalR-Signal in allen CRUD-Endpoints
- BUG-5: Rename-Sync löscht alte Datei im Simulations-Ordner
- BUG-6: Doppeltes Dispose von SignalR verhindert
- BUG-7: Registry-Deinstallation nur EngineeringSync-Eintrag entfernt
- S1: Path-Traversal-Schutz via SafeCombine() im SyncManager
- E1: FSW Buffer 64KB + automatischer Re-Scan bei Overflow
- E2: Retry-Logik (3x) für gesperrte Dateien mit exponentiellem Backoff
- E4: Channel.Writer.TryComplete() beim Shutdown
- C2: HubMethodNames-Konstanten statt Magic Strings
- E3: Pagination in Changes-API (page/pageSize Query-Parameter)
- A1: Fire-and-Forget mit try/catch + Logging

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-26 21:52:26 +01:00

83 lines
3.7 KiB
PowerShell

# ======================================================================
# build-installer.ps1 - Publiziert alle Projekte und erstellt den Installer
# Aufruf: .\installer\build-installer.ps1
# ======================================================================
$ErrorActionPreference = "Stop"
$root = Split-Path $PSScriptRoot -Parent
Write-Host ""
Write-Host "+----------------------------------------------+" -ForegroundColor Cyan
Write-Host "| EngineeringSync Installer Build |" -ForegroundColor Cyan
Write-Host "+----------------------------------------------+" -ForegroundColor Cyan
Write-Host ""
# -- 1. Service publizieren (self-contained) -------------------------------------------
Write-Host "[1/4] Publiziere Windows Service (self-contained)..." -ForegroundColor Yellow
dotnet publish "$root\EngineeringSync.Service\EngineeringSync.Service.csproj" `
--configuration Release `
--runtime win-x64 `
--self-contained true `
-o "$root\EngineeringSync.Service\bin\Release\net10.0\publish"
if ($LASTEXITCODE -ne 0) { throw "Service-Publish fehlgeschlagen" }
Write-Host " [OK] Service publiziert (self-contained)" -ForegroundColor Green
# -- 2. TrayApp publizieren (self-contained) -------------------------------------------
Write-Host "[2/4] Publiziere TrayApp (self-contained)..." -ForegroundColor Yellow
dotnet publish "$root\EngineeringSync.TrayApp\EngineeringSync.TrayApp.csproj" `
--configuration Release `
--runtime win-x64 `
--self-contained true `
-o "$root\EngineeringSync.TrayApp\bin\Release\net10.0-windows\publish"
if ($LASTEXITCODE -ne 0) { throw "TrayApp-Publish fehlgeschlagen" }
Write-Host " [OK] TrayApp publiziert (self-contained)" -ForegroundColor Green
# -- 3. Setup-Wizard publizieren (self-contained) --------------------------------------
Write-Host "[3/4] Publiziere Setup-Wizard..." -ForegroundColor Yellow
dotnet publish "$root\EngineeringSync.Setup\EngineeringSync.Setup.csproj" `
--configuration Release `
--runtime win-x64 `
--self-contained true `
--output "$root\EngineeringSync.Setup\bin\Release\net10.0-windows\publish"
if ($LASTEXITCODE -ne 0) { throw "Setup-Wizard-Publish fehlgeschlagen" }
Write-Host " [OK] Setup-Wizard publiziert (self-contained)" -ForegroundColor Green
# -- 4. Inno Setup ausfuehren -----------------------------------------
Write-Host "[4/4] Erstelle Installer mit Inno Setup..." -ForegroundColor Yellow
$isccCmd = Get-Command "iscc" -ErrorAction SilentlyContinue
$isccPaths = @(
"C:\Program Files (x86)\Inno Setup 6\ISCC.exe",
"C:\Program Files\Inno Setup 6\ISCC.exe",
$(if ($isccCmd) { $isccCmd.Source } else { $null })
) | Where-Object { $_ -and (Test-Path $_) } | Select-Object -First 1
if (-not $isccPaths) {
Write-Host ""
Write-Host " WARNUNG: Inno Setup nicht gefunden!" -ForegroundColor Red
Write-Host " Bitte installieren: https://jrsoftware.org/isinfo.php" -ForegroundColor Red
Write-Host ""
Write-Host " Alternativ manuell kompilieren:" -ForegroundColor Yellow
Write-Host " ISCC.exe ""$PSScriptRoot\setup.iss""" -ForegroundColor Yellow
exit 1
}
New-Item -ItemType Directory -Force -Path "$root\dist" | Out-Null
& $isccPaths "$PSScriptRoot\setup.iss"
if ($LASTEXITCODE -ne 0) { throw "Inno Setup fehlgeschlagen" }
Write-Host ""
Write-Host "+----------------------------------------------+" -ForegroundColor Green
Write-Host "| [OK] Installer erfolgreich erstellt! |" -ForegroundColor Green
Write-Host "+----------------------------------------------+" -ForegroundColor Green
Write-Host ""
Write-Host " Ausgabe: $root\dist" -ForegroundColor Cyan
# Installer im Explorer oeffnen
$distPath = "$root\dist"
Start-Process "explorer.exe" $distPath