@echo off
.\chkinst.exe
if errorlevel 6 goto fatal
if errorlevel 5 goto no_dx_no_game
if errorlevel 4 goto no_dx
if errorlevel 3 goto old_dx_no_game
if errorlevel 2 goto old_dx
if errorlevel 1 goto no_game
goto end

:no_game
.\setup.exe
goto end

:old_dx
rem if exist dx5eng.exe .\setup.exe dx_old
goto end

:old_dx_no_game
.\setup.exe dx_old game
goto end

:no_dx
rem if exist dx5eng.exe .\setup.exe dx_none
goto end

:no_dx_no_game
.\setup.exe dx_none game
goto end

:fatal
echo Error running chkinst
goto end

:end
