@echo off
call check-for-admin
if %ERRORLEVEL% neq 0 exit /b

set CONFIG=config\install-sharemouse.txt
set EXE=..\software\sharemouse-setup.exe

if NOT EXIST %EXE% (
  echo ERROR: %EXE% not found!
  exit /b
)

echo ####### %0 #######

echo killing ShareMouse processes...
taskkill /F /IM sharemouse.exe 2>nul

echo installing ShareMouse ...
start /wait %EXE% /LOADINF=%CONFIG% /NORESTART /NOCANCEL /SILENT /SUPPRESSMSGBOXES /CLOSEAPPLICATIONS

rem refresh desktop (W10 style)
ie4uinit.exe -show

echo ####### %0 #######
pause