Files
aza/AzA march 2026 - Kopie (17)/build_empfang.ps1

53 lines
1.3 KiB
PowerShell
Raw Normal View History

2026-04-19 20:41:37 +02:00
Write-Host "AZA Empfang Desktop-App Build gestartet..."
Write-Host ""
$projectRoot = $PSScriptRoot
Set-Location $projectRoot
Write-Host "Abhaengigkeiten installieren..."
pip install pywebview --quiet
pip install pyinstaller --quiet
Write-Host "Alte Artefakte bereinigen..."
$distExe = Join-Path $projectRoot "dist\AZA_Empfang.exe"
if (Test-Path $distExe) { Remove-Item $distExe -Force }
$iconFile = Join-Path $projectRoot "logo.ico"
$iconArg = @()
if (Test-Path $iconFile) {
$iconArg = @("--icon", $iconFile)
Write-Host " Icon: $iconFile"
} else {
Write-Host " Kein Icon gefunden (logo.ico) - baue ohne Icon"
}
Write-Host "EXE wird gebaut..."
$appFile = Join-Path $projectRoot "aza_empfang_app.py"
$urlFile = Join-Path $projectRoot "backend_url.txt"
$addData = @()
if (Test-Path $urlFile) {
$addData = @("--add-data", "$urlFile;.")
}
pyinstaller --noconfirm --onefile --windowed `
--name "AZA_Empfang" `
@iconArg `
@addData `
$appFile
if ($LASTEXITCODE -ne 0) {
Write-Error "Build fehlgeschlagen."
exit 1
}
$exePath = Join-Path $projectRoot "dist\AZA_Empfang.exe"
if (-not (Test-Path $exePath)) {
Write-Error "EXE nicht gefunden: $exePath"
exit 1
}
Write-Host ""
Write-Host "Build fertig."
Write-Host "Die App liegt in:"
Write-Host $exePath