@echo off
setlocal
cd /d "%~dp0"
where dotnet >nul 2>nul
if errorlevel 1 goto missing_runtime
set "LIVECOACH_DESKTOP_RUNTIME="
for /f "delims=" %%R in ('dotnet --list-runtimes ^| findstr /B /C:"Microsoft.WindowsDesktop.App 8."') do set "LIVECOACH_DESKTOP_RUNTIME=1"
if not defined LIVECOACH_DESKTOP_RUNTIME goto missing_runtime
start "LiveCoachAI" dotnet "%~dp0LiveCoachAnchorClient.Wpf.dll"
exit /b 0

:missing_runtime
echo 缺少 Microsoft .NET 8 Desktop Runtime x64，正在打开微软官方下载页。
start "" "https://dotnet.microsoft.com/download/dotnet/8.0/runtime"
pause
