2026-05-06 22:43:22 +02:00
|
|
|
|
Write-Host "AZA Empfang (webview-Huelle) — PyInstaller Build"
|
2026-04-19 20:41:37 +02:00
|
|
|
|
Write-Host ""
|
|
|
|
|
|
|
|
|
|
|
|
$projectRoot = $PSScriptRoot
|
|
|
|
|
|
Set-Location $projectRoot
|
|
|
|
|
|
|
2026-05-06 22:43:22 +02:00
|
|
|
|
$specFile = Join-Path $projectRoot "AZA_Empfang.spec"
|
2026-04-19 20:41:37 +02:00
|
|
|
|
|
2026-05-06 22:43:22 +02:00
|
|
|
|
if (-not (Test-Path (Join-Path $projectRoot "aza_empfang_app.py"))) {
|
|
|
|
|
|
Write-Error "aza_empfang_app.py nicht gefunden."
|
|
|
|
|
|
exit 1
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Write-Host "PyInstaller / pywebview..."
|
|
|
|
|
|
pip install pywebview pyinstaller --quiet
|
|
|
|
|
|
|
|
|
|
|
|
Write-Host "Build-Stamp (_build_info.py, fuer Versionsanzeige in der App)..."
|
|
|
|
|
|
python (Join-Path $projectRoot "aza_build_stamp.py")
|
|
|
|
|
|
if ($LASTEXITCODE -ne 0) {
|
|
|
|
|
|
Write-Warning "Build-Stamp fehlgeschlagen — Version zeigt ggf. Entwicklungsversion."
|
2026-04-19 20:41:37 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-05-06 22:43:22 +02:00
|
|
|
|
Write-Host "Alte Artefakte bereinigen..."
|
|
|
|
|
|
$distDir = Join-Path $projectRoot "dist"
|
|
|
|
|
|
$buildDir = Join-Path $projectRoot "build"
|
|
|
|
|
|
$nameLower = "aza_empfang"
|
|
|
|
|
|
foreach ($p in @(
|
|
|
|
|
|
(Join-Path $distDir "AZA_Empfang.exe"),
|
|
|
|
|
|
(Join-Path $distDir $nameLower))) {
|
|
|
|
|
|
if (Test-Path $p) { Remove-Item $p -Recurse -Force }
|
|
|
|
|
|
}
|
|
|
|
|
|
if (Test-Path (Join-Path $buildDir "AZA_Empfang")) {
|
|
|
|
|
|
Remove-Item (Join-Path $buildDir "AZA_Empfang") -Recurse -Force
|
2026-04-19 20:41:37 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-05-06 22:43:22 +02:00
|
|
|
|
Write-Host "EXE aus AZA_Empfang.spec (one-file)..."
|
|
|
|
|
|
Write-Host " Standard-Ziel-URL: https://empfang.aza-medwork.ch/empfang/"
|
|
|
|
|
|
Write-Host " Optional neben EXE: backend_url.txt (Basis wie https://api.example.com)"
|
|
|
|
|
|
Write-Host " oder Umgebung AZA_EMPFANG_URL."
|
|
|
|
|
|
pyinstaller --noconfirm $specFile
|
2026-04-19 20:41:37 +02:00
|
|
|
|
|
|
|
|
|
|
if ($LASTEXITCODE -ne 0) {
|
2026-05-06 22:43:22 +02:00
|
|
|
|
Write-Error "PyInstaller Build fehlgeschlagen."
|
2026-04-19 20:41:37 +02:00
|
|
|
|
exit 1
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-05-06 22:43:22 +02:00
|
|
|
|
$exePath = Join-Path $distDir "AZA_Empfang.exe"
|
2026-04-19 20:41:37 +02:00
|
|
|
|
if (-not (Test-Path $exePath)) {
|
|
|
|
|
|
Write-Error "EXE nicht gefunden: $exePath"
|
|
|
|
|
|
exit 1
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Write-Host ""
|
|
|
|
|
|
Write-Host "Build fertig."
|
2026-05-06 22:43:22 +02:00
|
|
|
|
Write-Host "USB / Kopieren:"
|
|
|
|
|
|
Write-Host " $exePath"
|