$ErrorActionPreference = "Stop" $ProjectRoot = Split-Path -Parent $MyInvocation.MyCommand.Path Set-Location -LiteralPath $ProjectRoot if (Get-Process -Name "SyncVito" -ErrorAction SilentlyContinue) { throw "SyncVito läuft noch. Bitte die Anwendung über das Tray-Menü beenden und den Build erneut starten." } Write-Host "Abhängigkeiten werden geprüft …" python -m pip install --disable-pip-version-check -r requirements.txt if ($LASTEXITCODE -ne 0) { throw "Die Abhängigkeiten konnten nicht installiert werden." } Write-Host "Tests werden ausgeführt …" python -m pytest if ($LASTEXITCODE -ne 0) { throw "Die Tests sind fehlgeschlagen." } Write-Host "Programmsymbol wird erzeugt …" python tools\generate_icon.py if ($LASTEXITCODE -ne 0) { throw "Das Programmsymbol konnte nicht erzeugt werden." } Write-Host "SyncVito.exe wird erstellt …" python -m PyInstaller --noconfirm --clean SyncVito.spec if ($LASTEXITCODE -ne 0) { throw "Der PyInstaller-Build ist fehlgeschlagen." } $ExecutablePath = Join-Path $ProjectRoot "dist\SyncVito.exe" $ChecksumPath = "$ExecutablePath.sha256" $Checksum = (Get-FileHash -LiteralPath $ExecutablePath -Algorithm SHA256).Hash.ToLowerInvariant() Set-Content -LiteralPath $ChecksumPath -Value "$Checksum SyncVito.exe" -Encoding Ascii Write-Host "Fertig: $ExecutablePath" Write-Host "Prüfsumme: $ChecksumPath"