@echo off
goto start

* This command file installs the NeoMagic 20xx OS/2 Warp SBCS display
* driver.

:start
if %1.==. GOTO explain
if %2.==. GOTO defsrc
set orgsrc=%1
set orgdst=%2
goto getparms

:defsrc
set dst=%1
set src=.\
set orgdst=%1
set orgsrc=.\
goto check_src

:getparms
set src=%1
set dst=%2

:check_src
if not exist %src%neomagic.dsc goto fix_src

:check_dst
if not exist %dst%os2 goto fix_dst
goto do_install

:fix_src
set src=%orgsrc%\
if not exist %src%neomagic.dsc goto fix_src1
goto check_dst

:fix_src1
set src=%orgsrc%:\
if not exist %src%neomagic.dsc goto baddrive

:fix_dst
set dst=%orgdst%\
if not exist %dst%os2 goto fix_dst2
goto do_install

:fix_dst2
set dst=%orgdst%:\
if not exist %dst%os2 goto baddrive

:do_install
copy %src%NEOMAGIC.dsc %dst%os2\install\NEOMAGIC.dsc > nul

attrib %dst%psfonts\*.pfb -r > nul
attrib %dst%psfonts\*.pfb +a > nul

%dst%os2\install\dspinstl

%src%testver > nul
if ERRORLEVEL 400 GOTO ver40
if ERRORLEVEL 300 GOTO ver30

:ver30
echo DEVICE=%dst%OS2\MDOS\VPRPMI.SYS >> %dst%config.sys
echo SET AUTOSTART=TASKLIST,FOLDERS,CONNECTIONS,LAUNCHPAD >> %dst%config.sys
goto exit

:ver40
erase %dst%os2\mdos\vprpmi.sys > nul
echo SET AUTOSTART=TASKLIST,FOLDERS,CONNECTIONS,WARPCENTER >> %dst%config.sys
goto exit

:exit
echo
echo ***Installation Complete
echo .
echo .
echo .
goto end

:baddrive
echo
echo ERROR -- Cannot install to drive %1:
echo
echo !!!  Installation was unsuccessful
echo .
echo .
echo .
goto explain

:explain
echo Usage:
echo *
echo *    Change to install drive and CD to install directory
echo *    Then say,
echo *
echo *            SETUP  bootdrive
echo *
echo *    Where "bootdrive" is your OS/2 boot drive.  Example:
echo *
echo *           SETUP C                 Installs to C:
echo *           SETUP D                 Installs to D:
echo *             etc.
goto end

:end
set src=
set dst=
set orgsrc=
set orgdst=

