@echo off
echo Registering moharena:// URL protocol...
echo This requires administrator privileges.
echo.

net session >nul 2>&1
if %errorLevel% neq 0 (
  echo Please run this script as Administrator!
  pause
  exit /b 1
)

setlocal enabledelayedexpansion
set "exepath=%~dp0moharena_guard.exe"

reg add "HKCR\moharena" /ve /t REG_SZ /d "URL:MoH Arena Protocol" /f
reg add "HKCR\moharena" /v "URL Protocol" /t REG_SZ /d "" /f
reg add "HKCR\moharena\DefaultIcon" /ve /t REG_SZ /d "!exepath!,0" /f
reg add "HKCR\moharena\shell" /ve /t REG_SZ /d "open" /f
reg add "HKCR\moharena\shell\open" /ve /t REG_SZ /d "Open with MoH Arena Guard" /f
reg add "HKCR\moharena\shell\open\command" /ve /t REG_SZ /d "\"!exepath!\" %%1" /f

echo.
echo URL protocol registration complete!
pause
