This commit is contained in:
2026-05-23 21:31:34 +02:00
parent 51b5ddc6f2
commit 641bb10479
6155 changed files with 3775717 additions and 291 deletions

View File

@@ -0,0 +1,5 @@
Backup: installer component labels + setup foreground
Created: 20260522_201133
Restore:
Copy-Item 'C:\Users\surov\Documents\AZA_GIT\aza\AzA march 2026\backup_installer_component_labels_foreground_20260522_201133\aza_installer.iss' 'installer\aza_installer.iss' -Force
Copy-Item 'C:\Users\surov\Documents\AZA_GIT\aza\AzA march 2026\backup_installer_component_labels_foreground_20260522_201133\build_installer.ps1' 'build_installer.ps1' -Force

View File

@@ -0,0 +1,180 @@
#define MyAppName "AzA"
#ifndef MyAppVersion
#define MyAppVersion "0.1.0"
#endif
#ifndef MyOutputBaseFilename
#define MyOutputBaseFilename "aza_desktop_setup"
#endif
#define MyAppPublisher "AZA MedWork"
#define MyAppExeName "aza_desktop.exe"
#define MyStartPanelExe "aza_start_panel.exe"
#define MyUpdaterExe "aza_updater.exe"
#define MyChatExe "AZA_EmpfangShell.exe"
#define MyAppSourceDir SourcePath + "\..\dist\aza_desktop"
[Setup]
AppId={{B7E4C0D2-6B5D-4D39-9D7C-5B0D5E8C2A11}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL=https://aza-medwork.ch
DefaultDirName={autopf}\AzA Medwork\AzA
DefaultGroupName=AzA
DisableProgramGroupPage=no
OutputDir={#MyAppSourceDir}\..\..\dist\installer
OutputBaseFilename={#MyOutputBaseFilename}
Compression=lzma
SolidCompression=yes
WizardStyle=modern
PrivilegesRequired=admin
ArchitecturesInstallIn64BitMode=x64
UninstallDisplayIcon={app}\logo.ico
SetupIconFile={#MyAppSourceDir}\..\..\logo.ico
SetupMutex=AZADesktopSetupMutex
CloseApplications=no
RestartApplications=no
[Languages]
Name: "german"; MessagesFile: "compiler:Languages\German.isl"
[Types]
Name: "standard"; Description: "AzA Startpanel, Office, Praxis Chat und Updater (empfohlen)"
Name: "chatonly"; Description: "Nur AZA Chat (Empfang / MPA)"
Name: "custom"; Description: "Benutzerdefiniert"; Flags: iscustom
[Components]
Name: "launcher"; Description: "AzA Startpanel — Control Panel mit Matterhorn-Video"; Types: standard custom; Flags: fixed
Name: "office"; Description: "AZA Office — Hauptprogramm (Dokumentation, Profil, KG, Diktat, Briefe, Praxisarbeitsplatz)"; Types: standard custom; Flags: checkablealone
Name: "chat"; Description: "AZA Praxis Chat — WebView-Huelle (MiniChat)"; Types: standard chatonly custom; Flags: checkablealone
Name: "updater"; Description: "AZA Updater — sichere Hintergrund-Updates"; Types: standard custom; Flags: checkablealone
[Tasks]
Name: "desktopicon_launcher"; Description: "Desktop-Verknuepfung: AzA (Startpanel)"; GroupDescription: "Verknuepfungen:"; Components: launcher; Flags: checkedonce
Name: "desktopicon_office"; Description: "Desktop-Verknuepfung: AZA Office"; GroupDescription: "Verknuepfungen:"; Components: office
Name: "desktopicon_chat"; Description: "Desktop-Verknuepfung: AZA Praxis Chat"; GroupDescription: "Verknuepfungen:"; Components: chat
[Dirs]
Name: "{app}\config"; Components: office; Permissions: users-modify
[InstallDelete]
Type: filesandordirs; Name: "{app}\_internal\*.pyd"
Type: filesandordirs; Name: "{app}\_internal\*.dll"
Type: files; Name: "{app}\_internal\*.tmp"
[Files]
; --- AzA Startpanel (Haupt-Einstieg) ---
Source: "{#MyAppSourceDir}\{#MyStartPanelExe}"; DestDir: "{app}"; Components: launcher; Flags: ignoreversion restartreplace uninsrestartdelete
; --- AZA Office ---
Source: "{#MyAppSourceDir}\{#MyAppExeName}"; DestDir: "{app}"; Components: office; Flags: ignoreversion restartreplace uninsrestartdelete
Source: "{#MyAppSourceDir}\_internal\*"; DestDir: "{app}\_internal"; Components: office; Flags: ignoreversion recursesubdirs createallsubdirs restartreplace
Source: "{#MyAppSourceDir}\_internal\backend_url.txt"; DestDir: "{app}"; Components: office; Flags: ignoreversion skipifsourcedoesntexist
Source: "{#MyAppSourceDir}\_internal\backend_token.txt"; DestDir: "{app}"; Components: office; Flags: ignoreversion skipifsourcedoesntexist
Source: "{#MyAppSourceDir}\BUILD_INFO.txt"; DestDir: "{app}"; Components: office; Flags: ignoreversion skipifsourcedoesntexist
Source: "{#MyAppSourceDir}\..\..\setup_openai_runtime.ps1"; DestDir: "{app}"; Components: office; Flags: ignoreversion
; --- Gemeinsam: Assets, Version, Icon ---
Source: "{#MyAppSourceDir}\assets\*"; DestDir: "{app}\assets"; Components: launcher office; Flags: ignoreversion recursesubdirs createallsubdirs skipifsourcedoesntexist
Source: "{#MyAppSourceDir}\version.json"; DestDir: "{app}"; Components: launcher office updater; Flags: ignoreversion skipifsourcedoesntexist
Source: "{#MyAppSourceDir}\..\..\logo.ico"; DestDir: "{app}"; Components: launcher office chat updater; Flags: ignoreversion
Source: "{#MyAppSourceDir}\..\..\logo.png"; DestDir: "{app}"; Components: launcher; Flags: ignoreversion skipifsourcedoesntexist
; --- AZA Praxis Chat ---
Source: "{#MyAppSourceDir}\{#MyChatExe}"; DestDir: "{app}"; Components: chat; Flags: ignoreversion restartreplace uninsrestartdelete
; --- AZA Updater ---
Source: "{#MyAppSourceDir}\{#MyUpdaterExe}"; DestDir: "{app}"; Components: updater; Flags: ignoreversion restartreplace uninsrestartdelete
[Icons]
Name: "{group}\AzA"; Filename: "{app}\{#MyStartPanelExe}"; IconFilename: "{app}\logo.ico"; Components: launcher
Name: "{autodesktop}\AzA"; Filename: "{app}\{#MyStartPanelExe}"; IconFilename: "{app}\logo.ico"; Tasks: desktopicon_launcher; Components: launcher
Name: "{group}\AZA Office"; Filename: "{app}\{#MyAppExeName}"; IconFilename: "{app}\logo.ico"; Components: office
Name: "{autodesktop}\AZA Office"; Filename: "{app}\{#MyAppExeName}"; IconFilename: "{app}\logo.ico"; Tasks: desktopicon_office; Components: office
Name: "{group}\OpenAI Schluessel einrichten"; Filename: "powershell.exe"; Parameters: "-ExecutionPolicy Bypass -File ""{app}\setup_openai_runtime.ps1"""; Components: office
Name: "{group}\AZA Praxis Chat"; Filename: "{app}\{#MyChatExe}"; IconFilename: "{app}\logo.ico"; Components: chat
Name: "{autodesktop}\AZA Praxis Chat"; Filename: "{app}\{#MyChatExe}"; IconFilename: "{app}\logo.ico"; Tasks: desktopicon_chat; Components: chat
Name: "{group}\AZA Updater"; Filename: "{app}\{#MyUpdaterExe}"; IconFilename: "{app}\logo.ico"; Components: updater
[Run]
Filename: "{app}\{#MyStartPanelExe}"; Description: "AzA Startpanel oeffnen"; Flags: nowait postinstall skipifsilent; Components: launcher
[UninstallRun]
Filename: "netsh.exe"; Parameters: "advfirewall firewall delete rule name=""AZA Desktop - Lokale Kommunikation"""; Flags: runhidden; RunOnceId: "DelFirewallRule"
[Code]
function NextButtonClick(CurPageID: Integer): Boolean;
begin
Result := True;
if CurPageID = wpSelectComponents then
begin
if not WizardIsComponentSelected('launcher') and not WizardIsComponentSelected('office') and not WizardIsComponentSelected('chat') then
begin
MsgBox('Bitte mindestens AzA Startpanel, AZA Office und/oder AZA Praxis Chat waehlen.', mbError, MB_OK);
Result := False;
Exit;
end;
if WizardIsComponentSelected('office') and not WizardIsComponentSelected('chat') then
begin
if MsgBox('Ohne "AZA Praxis Chat" startet der Chat-Button im Startpanel nicht.' + #13#10 + #13#10 +
'Empfehlung: Aktivieren Sie "AZA Praxis Chat" zusaetzlich zu "AZA Office".' + #13#10 + #13#10 +
'Trotzdem fortfahren und nur AZA Office installieren?',
mbConfirmation, MB_YESNO or MB_DEFBUTTON2) = IDNO then
Result := False;
end;
end;
end;
function InitializeSetup(): Boolean;
var
R: Integer;
begin
Result := True;
Exec('taskkill.exe', '/F /IM aza_start_panel.exe', '', SW_HIDE, ewWaitUntilTerminated, R);
Exec('taskkill.exe', '/F /IM aza_desktop.exe', '', SW_HIDE, ewWaitUntilTerminated, R);
Exec('taskkill.exe', '/F /IM aza_updater.exe', '', SW_HIDE, ewWaitUntilTerminated, R);
Exec('taskkill.exe', '/F /IM AZA_EmpfangShell.exe', '', SW_HIDE, ewWaitUntilTerminated, R);
Exec('taskkill.exe', '/F /IM AZA_EmpfangChat.exe', '', SW_HIDE, ewWaitUntilTerminated, R);
Exec('taskkill.exe', '/F /IM AZA_Empfang.exe', '', SW_HIDE, ewWaitUntilTerminated, R);
Sleep(500);
end;
function PrepareToInstall(var NeedsRestart: Boolean): String;
var
R: Integer;
begin
Result := '';
NeedsRestart := False;
Exec('taskkill.exe', '/F /IM aza_start_panel.exe', '', SW_HIDE, ewWaitUntilTerminated, R);
Exec('taskkill.exe', '/F /IM aza_desktop.exe', '', SW_HIDE, ewWaitUntilTerminated, R);
Exec('taskkill.exe', '/F /IM aza_updater.exe', '', SW_HIDE, ewWaitUntilTerminated, R);
Exec('taskkill.exe', '/F /IM AZA_EmpfangShell.exe', '', SW_HIDE, ewWaitUntilTerminated, R);
Sleep(500);
end;
procedure CurStepChanged(CurStep: TSetupStep);
var
R: Integer;
AppPath, ExePath, Cmd: String;
begin
if CurStep = ssPostInstall then
begin
AppPath := ExpandConstant('{app}');
ExePath := AddBackslash(AppPath) + 'aza_desktop.exe';
if WizardIsComponentSelected('office') and FileExists(ExePath) then
begin
Exec('netsh.exe', 'advfirewall firewall delete rule name="AZA Desktop - Lokale Kommunikation"', '', SW_HIDE, ewWaitUntilTerminated, R);
Sleep(200);
Cmd := 'advfirewall firewall add rule name="AZA Desktop - Lokale Kommunikation" dir=in action=allow program="' + ExePath + '" localport=8000 protocol=tcp remoteip=127.0.0.1';
if not Exec('netsh.exe', Cmd, '', SW_HIDE, ewWaitUntilTerminated, R) or (R <> 0) then
Log('Firewall-Regel konnte nicht angelegt werden (Code: ' + IntToStr(R) + ')');
end;
end;
end;
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
var
UserDataDir: String;
begin
if CurUninstallStep = usPostUninstall then
begin
UserDataDir := ExpandConstant('{userappdata}\AZA Desktop');
Log('AzA deinstalliert. Persoenliche Daten bleiben unter "' + UserDataDir + '" erhalten (kein automatisches Loeschen).');
end;
end;

View File

@@ -0,0 +1,228 @@
param(
[switch]$TestBuild
)
$projectRoot = $PSScriptRoot
$innoScript = Join-Path $projectRoot "installer\aza_installer.iss"
$setupOutput = Join-Path $projectRoot "dist\installer\aza_desktop_setup.exe"
$versionMetaDir = Join-Path $projectRoot "dist\installer_meta"
$versionMetaFile = Join-Path $versionMetaDir "aza_version_info.txt"
$azaVersionPy = Join-Path $projectRoot "aza_version.py"
if ($TestBuild) {
$setupOutput = Join-Path $projectRoot "dist\installer\aza_desktop_setup_TEST.exe"
}
function Find-InnoSetup {
$candidates = @(
"${env:ProgramFiles(x86)}\Inno Setup 6\ISCC.exe",
"${env:ProgramFiles}\Inno Setup 6\ISCC.exe",
"C:\Program Files (x86)\Inno Setup 6\ISCC.exe",
"C:\Program Files\Inno Setup 6\ISCC.exe",
"${env:LOCALAPPDATA}\Programs\Inno Setup 6\ISCC.exe"
)
foreach ($path in $candidates) {
if ($path -and (Test-Path $path)) {
return $path
}
}
$regPaths = @(
"HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Inno Setup 6_is1",
"HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Inno Setup 6_is1",
"HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Inno Setup 6_is1"
)
foreach ($regPath in $regPaths) {
try {
$installLocation = (Get-ItemProperty $regPath -ErrorAction SilentlyContinue).InstallLocation
if ($installLocation) {
$iscc = Join-Path $installLocation "ISCC.exe"
if (Test-Path $iscc) {
return $iscc
}
}
} catch {}
}
$isccInPath = Get-Command "ISCC.exe" -ErrorAction SilentlyContinue
if ($isccInPath) {
return $isccInPath.Source
}
return $null
}
function Install-InnoSetup {
$innoUrl = "https://jrsoftware.org/download.php/is.exe"
$installerPath = Join-Path $env:TEMP "innosetup6_installer.exe"
Write-Host ""
Write-Host "Inno Setup 6 wird automatisch heruntergeladen und installiert..."
Write-Host "Quelle: $innoUrl"
try {
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Invoke-WebRequest -Uri $innoUrl -OutFile $installerPath -UseBasicParsing
} catch {
Write-Error "Download von Inno Setup fehlgeschlagen: $_"
return $false
}
if (-not (Test-Path $installerPath)) {
Write-Error "Inno Setup Installer wurde nicht heruntergeladen."
return $false
}
Write-Host "Installiere Inno Setup 6 (silent)..."
$process = Start-Process -FilePath $installerPath -ArgumentList "/VERYSILENT", "/SUPPRESSMSGBOXES", "/NORESTART" -Wait -PassThru
if ($process.ExitCode -ne 0) {
Write-Error "Inno Setup Installation fehlgeschlagen (Exit Code: $($process.ExitCode))."
return $false
}
Write-Host "Inno Setup 6 wurde erfolgreich installiert."
return $true
}
# --- Voraussetzungen pruefen ---
if (-not (Test-Path $innoScript)) {
Write-Error "Installer-Script nicht gefunden: $innoScript"
exit 1
}
if (-not (Test-Path $azaVersionPy)) {
Write-Error "aza_version.py nicht gefunden: $azaVersionPy"
exit 1
}
if (-not (Test-Path (Join-Path $projectRoot "dist\aza_desktop\AZA_EmpfangShell.exe"))) {
Write-Error "Empfang-Web-Shell fehlt: dist\aza_desktop\AZA_EmpfangShell.exe - bitte build_exe.ps1 ausfuehren (PyInstaller-Ziel inkl. Shell)."
exit 1
}
$requiredExes = @(
"dist\aza_desktop\aza_start_panel.exe",
"dist\aza_desktop\aza_desktop.exe",
"dist\aza_desktop\aza_updater.exe",
"dist\aza_desktop\version.json"
)
foreach ($rel in $requiredExes) {
$full = Join-Path $projectRoot $rel
if (-not (Test-Path $full)) {
Write-Error "Build-Artefakt fehlt: $rel - bitte build_exe.ps1 ausfuehren."
exit 1
}
}
$matterhornVideo = Join-Path $projectRoot "dist\aza_desktop\assets\matternhorn-aza-2.mp4"
if (-not (Test-Path $matterhornVideo)) {
Write-Warning "Matterhorn-Video fehlt: dist\aza_desktop\assets\matternhorn-aza-2.mp4"
}
# --- Inno Setup finden oder automatisch installieren ---
$innoCompiler = Find-InnoSetup
if (-not $innoCompiler) {
$installed = Install-InnoSetup
if ($installed) {
$innoCompiler = Find-InnoSetup
}
if (-not $innoCompiler) {
Write-Host ""
Write-Error "Inno Setup 6 konnte nicht gefunden oder installiert werden."
Write-Host ""
Write-Host "Bitte Inno Setup 6 manuell installieren:"
Write-Host " https://jrsoftware.org/isdl.php"
Write-Host ""
Write-Host "Danach dieses Script erneut ausfuehren."
exit 1
}
}
Write-Host "Inno Setup Compiler: $innoCompiler"
# --- Version lesen ---
if (-not (Test-Path $versionMetaDir)) {
New-Item -ItemType Directory -Path $versionMetaDir | Out-Null
}
Write-Host "Lese zentrale AZA-Version aus aza_version.py..."
$versionContent = Get-Content $azaVersionPy -Raw
if ($versionContent -match 'APP_VERSION\s*=\s*"([^"]+)"') {
$appVersion = $matches[1].Trim()
} else {
$appVersion = $null
}
if (-not $appVersion) {
Write-Error "Konnte APP_VERSION nicht aus aza_version.py lesen."
exit 1
}
Set-Content -Path $versionMetaFile -Value $appVersion -Encoding ASCII
# --- Build-Zeitstempel lesen ---
$buildTimestamp = ""
$buildInfoPy = Join-Path $projectRoot "_build_info.py"
if (Test-Path $buildInfoPy) {
$biContent = Get-Content $buildInfoPy -Raw
if ($biContent -match 'BUILD_TIMESTAMP\s*=\s*"([^"]+)"') {
$buildTimestamp = $matches[1].Trim()
}
}
if (-not $buildTimestamp) {
$buildTimestamp = (Get-Date -Format "yyyyMMdd_HHmmss")
}
# --- Ausgabe-Ordner sicherstellen ---
$outputDir = Join-Path $projectRoot "dist\installer"
if (-not (Test-Path $outputDir)) {
New-Item -ItemType Directory -Path $outputDir | Out-Null
}
# --- Installer bauen ---
Write-Host "Baue AZA Installer (Version $appVersion, Build $buildTimestamp)..."
$outputBase = if ($TestBuild) { "aza_desktop_setup_TEST" } else { "aza_desktop_setup" }
& $innoCompiler "/DMyAppVersion=$appVersion" "/DMyOutputBaseFilename=$outputBase" $innoScript
if ($LASTEXITCODE -ne 0) {
Write-Error "Installer-Build fehlgeschlagen."
exit 1
}
if (-not (Test-Path $setupOutput)) {
Write-Error "Installer wurde nicht gefunden: $setupOutput"
exit 1
}
# Installer mit Zeitstempel umbenennen (nur Standard-Build)
if (-not $TestBuild) {
$stampedName = "aza_desktop_setup_${buildTimestamp}.exe"
$stampedPath = Join-Path $outputDir $stampedName
Copy-Item $setupOutput $stampedPath -Force
Write-Host " Installer mit Zeitstempel: $stampedName"
}
# BUILD_INFO.txt neben den Installer legen
$distBuildInfo = Join-Path $projectRoot "dist\aza_desktop\BUILD_INFO.txt"
if (Test-Path $distBuildInfo) {
Copy-Item $distBuildInfo (Join-Path $outputDir "BUILD_INFO.txt") -Force
Write-Host " BUILD_INFO.txt -> dist\installer\ kopiert"
}
Write-Host ""
Write-Host "Installer erfolgreich erstellt:"
Write-Host " Standard: $setupOutput"
Write-Host " Zeitstempel: $stampedPath"
Write-Host "Verwendete Version:"
Write-Host " $appVersion (Build $buildTimestamp)"