@echo off
setlocal EnableExtensions
title MiiO OBS Guided Setup
echo MiiO OBS Setup wird vorbereitet ...
powershell.exe -NoLogo -NoProfile -ExecutionPolicy Bypass -Command "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue'; $PackageUrl = 'https://mio.sfcon.app/installers/MiiO-OBS-Citrix-Setup-v11-2026-07-23.zip'; $ExpectedSha256 = '23ecfede13eb9f679120f43a9d524b17a5b57811256b65e1befe8431a26b0ec9'; $ReleaseName = 'v11-2026-07-23'; $DownloadRoot = Join-Path ([IO.Path]::GetTempPath()) ('MiiO-OBS-Guided-Setup-' + $ReleaseName); $ArchivePath = Join-Path $DownloadRoot 'MiiO-OBS-Citrix-Setup.zip'; $UnpackRoot = Join-Path $DownloadRoot 'package'; Write-Host ''; Write-Host 'MiiO OBS gefuehrtes Setup' -ForegroundColor Cyan; Write-Host '=========================' -ForegroundColor Cyan; Write-Host '1/4 Lade das gepruefte Installationspaket von mio.sfcon.app ...' -ForegroundColor Yellow; if (Test-Path $DownloadRoot) { Remove-Item -Path $DownloadRoot -Recurse -Force }; New-Item -ItemType Directory -Path $DownloadRoot -Force | Out-Null; [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; Invoke-WebRequest -Uri $PackageUrl -OutFile $ArchivePath -UseBasicParsing -TimeoutSec 60; Write-Host '2/4 Pruefe die SHA-256-Pruefsumme ...' -ForegroundColor Yellow; $ActualSha256 = (Get-FileHash -Path $ArchivePath -Algorithm SHA256).Hash.ToLowerInvariant(); if ($ActualSha256 -ne $ExpectedSha256) { Remove-Item -Path $ArchivePath -Force -ErrorAction SilentlyContinue; throw ('Paketpruefung fehlgeschlagen. Erwartet: {0}; erhalten: {1}' -f $ExpectedSha256, $ActualSha256) }; Write-Host '3/4 Entpacke das MiiO-Paket ...' -ForegroundColor Yellow; Expand-Archive -Path $ArchivePath -DestinationPath $UnpackRoot -Force; $Installer = Join-Path $UnpackRoot 'Install-MiiO-Citrix.ps1'; if (-not (Test-Path $Installer)) { throw 'Das heruntergeladene Paket ist unvollstaendig.' }; Write-Host '4/4 Installiere und starte den Raum-Assistenten ...' -ForegroundColor Yellow; & powershell.exe -NoProfile -ExecutionPolicy Bypass -File $Installer -StartSetup; if ($LASTEXITCODE -ne 0) { throw ('MiiO-Installation wurde mit Code {0} beendet.' -f $LASTEXITCODE) }; Write-Host ''; Write-Host 'MiiO OBS Setup wurde abgeschlossen.' -ForegroundColor Green;"
set "MIIO_EXIT=%ERRORLEVEL%"
echo.
if not "%MIIO_EXIT%"=="0" echo Setup fehlgeschlagen. Bitte die Fehlermeldung fotografieren und an SFC Support senden.
if "%MIIO_EXIT%"=="0" echo Setup erfolgreich beendet.
pause
exit /b %MIIO_EXIT%
