Fix installer scripts: private key export, encoding, description

- Fix PrivateKey null error by using GetRSAPrivateKey() instead of
  .PrivateKey which is null for certs created with -Signer
- Replace all Unicode characters (umlauts, arrows, emojis) with
  ASCII-safe alternatives so output renders correctly on any
  Windows console regardless of codepage
- Add explanation in setup why Starface URL is needed (CA import)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-03 09:59:24 +02:00
parent c303461330
commit 60b44788fd
3 changed files with 90 additions and 78 deletions
+10 -10
View File
@@ -3,7 +3,7 @@
.SYNOPSIS
Deinstalliert das Starface Outlook Sync Add-in.
.DESCRIPTION
Entfernt Server, Zertifikate, Scheduled Task, Registry-Einträge und Dateien.
Entfernt Server, Zertifikate, Scheduled Task, Registry-Eintraege und Dateien.
#>
param(
@@ -21,17 +21,17 @@ function Write-Header($text) {
}
function Write-Step($text) {
Write-Host " $text" -ForegroundColor Green
Write-Host " [OK] $text" -ForegroundColor Green
}
function Write-Warn($text) {
Write-Host " $text" -ForegroundColor Yellow
Write-Host " [!] $text" -ForegroundColor Yellow
}
Write-Header "Starface Outlook Sync - Deinstallation"
# Sicherheitsabfrage
Write-Host " Dies entfernt das Starface Outlook Sync Add-in vollständig." -ForegroundColor Yellow
Write-Host " Dies entfernt das Starface Outlook Sync Add-in vollstaendig." -ForegroundColor Yellow
Write-Host " Installationsverzeichnis: $InstallDir" -ForegroundColor Yellow
$confirm = Read-Host " Fortfahren? (j/n)"
if ($confirm -ne "j") {
@@ -68,7 +68,7 @@ $certInfoPath = Join-Path $InstallDir "cert-info.json"
if (Test-Path $certInfoPath) {
$certInfo = Get-Content $certInfoPath -Raw | ConvertFrom-Json
# Localhost-Zertifikat aus dem persönlichen Store entfernen
# Localhost-Zertifikat aus dem persoenlichen Store entfernen
if ($certInfo.localhostThumbprint) {
$cert = Get-ChildItem "Cert:\LocalMachine\My" | Where-Object { $_.Thumbprint -eq $certInfo.localhostThumbprint }
if ($cert) {
@@ -85,14 +85,14 @@ if (Test-Path $certInfoPath) {
Write-Step "Lokale CA entfernt."
}
# Auch aus dem persönlichen Store
# Auch aus dem persoenlichen Store
$caCertMy = Get-ChildItem "Cert:\LocalMachine\My" | Where-Object { $_.Thumbprint -eq $certInfo.caThumbprint }
if ($caCertMy) {
Remove-Item $caCertMy.PSPath -Force
}
}
} else {
Write-Warn "cert-info.json nicht gefunden. Zertifikate müssen ggf. manuell entfernt werden."
Write-Warn "cert-info.json nicht gefunden. Zertifikate muessen ggf. manuell entfernt werden."
}
# ============================================================
@@ -161,11 +161,11 @@ Write-Header "Deinstallation abgeschlossen"
Write-Host " Das Starface Outlook Sync Add-in wurde entfernt." -ForegroundColor Green
Write-Host ""
Write-Host " Hinweis: Falls das Add-in im neuen Outlook manuell" -ForegroundColor Gray
Write-Host " hinzugefügt wurde, muss es dort auch manuell entfernt werden:" -ForegroundColor Gray
Write-Host " Einstellungen Add-Ins verwalten Add-In entfernen" -ForegroundColor Gray
Write-Host " hinzugefuegt wurde, muss es dort auch manuell entfernt werden:" -ForegroundColor Gray
Write-Host " Einstellungen -> Add-Ins verwalten -> Add-In entfernen" -ForegroundColor Gray
Write-Host ""
Write-Host " Das Starface-Zertifikat wurde NICHT entfernt," -ForegroundColor Yellow
Write-Host " da es ggf. von anderen Anwendungen benötigt wird." -ForegroundColor Yellow
Write-Host " da es ggf. von anderen Anwendungen benoetigt wird." -ForegroundColor Yellow
Write-Host ""
Read-Host "Eingabetaste zum Beenden"