@echo off
chcp 65001 >nul
setlocal
set "ROOT=%~dp0"
set "LAUNCHER=%ROOT%ONE.DownloadBridgeLauncher.exe"
set "LAUNCHER_PROJECT=%ROOT%DownloadBridgeLauncher\ONE.DownloadBridgeLauncher.csproj"
if exist "%LAUNCHER%" (
  "%LAUNCHER%" register --root "%ROOT%."
  exit /b %errorlevel%
)
if exist "%LAUNCHER_PROJECT%" (
  dotnet run --project "%LAUNCHER_PROJECT%" -- register --root "%ROOT%."
  exit /b %errorlevel%
)
if not exist "%LAUNCHER%" (
  echo ONE.DownloadBridgeLauncher 없음: "%LAUNCHER%"
  exit /b 1
)
