Autostart-Setup-Skript, README aktualisiert

This commit is contained in:
dimedtec 2026-08-28 18:12:43 +02:00
parent cd2cf5d1bb
commit 3500d75b42
2 changed files with 43 additions and 3 deletions

View file

@ -0,0 +1,27 @@
# Richtet den Windows-Autostart fuer Anrufmonitor ein (Release-Build + Verknuepfung im
# Startup-Ordner). Idempotent - kann nach jedem Update erneut ausgefuehrt werden.
$ErrorActionPreference = 'Stop'
$repoRoot = Split-Path $PSScriptRoot -Parent
$exePath = Join-Path $repoRoot "src\Anrufmonitor.App\bin\Release\net10.0-windows\Anrufmonitor.App.exe"
Write-Host "== Release-Build ==" -ForegroundColor Cyan
dotnet build (Join-Path $repoRoot "src\Anrufmonitor.App\Anrufmonitor.App.csproj") -c Release
if (-not (Test-Path $exePath)) {
throw "Build-Ausgabe nicht gefunden: $exePath"
}
$startupDir = [Environment]::GetFolderPath('Startup')
$shortcutPath = Join-Path $startupDir "Anrufmonitor.lnk"
Write-Host "== Autostart-Verknuepfung ==" -ForegroundColor Cyan
$shell = New-Object -ComObject WScript.Shell
$shortcut = $shell.CreateShortcut($shortcutPath)
$shortcut.TargetPath = $exePath
$shortcut.WorkingDirectory = Split-Path $exePath
$shortcut.Description = "Anrufmonitor - SIP Caller-ID"
$shortcut.Save()
Write-Host "Fertig: $shortcutPath -> $exePath" -ForegroundColor Green
Write-Host "Hinweis: appsettings.Local.json muss im Release-Ordner liegen (wird beim Build" -ForegroundColor Yellow
Write-Host " automatisch mitkopiert, falls sie in src\Anrufmonitor.App\ vorhanden ist)." -ForegroundColor Yellow