@echo off
goto start

    *
    * This command file installs the NeoMagic OS/2 3.0/4.0 SBCS display
    * driver.
    *
    * To install the driver from a directory on the hard disk copy all
    * files from the installation diskette to the same directory.  Then
    * follow the normal installation procedure.
    *

: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
del %dst%os2\video.cfg > nul 2>&1

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

%dst%os2\install\dspinstl

%src%chkkrnl > nul
if ERRORLEVEL 1 GOTO exit

:noMiniVdm
echo DEVICE=%dst%OS2\MDOS\VPRPMI.SYS >> %dst%config.sys

: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=

