@echo off 

cd /d "%~dp0\Drivers"

devcon.exe remove Root\ViGEmBus >nul 2>&1

echo Installing the ViGEm emulated gamepads driver..

call devcon.exe install ViGEmDriver\ViGEmBus.inf Root\ViGEmBus >nul 2>&1
if %ERRORLEVEL% == 0 goto :success
echo Installation failed; you need to right click the .bat and "run as admin".
pause 
exit

:success
echo Installation is successful; if you want to uninstall the driver, run "! Driver Uninstall (Run as Admin).bat"

devcon.exe install .\HidGuardian\HidGuardian.inf Root\HidGuardian
devcon.exe classfilter HIDClass upper -HidGuardian

cd .\HidCerberus.Srv
echo Installing HidCerberus.Srv...
HidCerberus.Srv.exe install

ping 127.0.0.1 -n 2 > nul

net start "HidCerberus Service"

ping 127.0.0.1 -n 2 > nul

echo Done

ECHO.
ECHO.
pause
