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

set CONFIG=config\install-vcesimulator.txt
set EXE=..\software\vce_exam_simulator_setup.exe
set STARTMENU="%PROGRAMDATA%\Microsoft\Windows\Start Menu\Programs"

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

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

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

echo cleanup ...
del /F /Q %STARTMENU%\"VCE Exam Simulator\VCE Exam Simulator on the Web.url" 2>nul
del /F /Q %STARTMENU%\"VCE Exam Simulator\Uninstall VCE Exam Simulator.lnk" 2>nul

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

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

