@ECHO OFF
ECHO ÿ
ECHO ************************************************************
ECHO *  OS/2 2.1 Display Driver Installation for S3             *
ECHO ************************************************************
IF .%1. == .. GOTO USAGE
IF .%2. == .. GOTO USAGE
IF NOT EXIST %2\OS2\INSTALL GOTO USAGE
IF NOT EXIST %1\TOOLS GOTO DAMAGED
IF NOT EXIST %1\BUNDLE GOTO DAMAGED
IF NOT EXIST %1\UNPACK2 GOTO DAMAGED
IF NOT EXIST %1\UNPACK GOTO DAMAGED
ECHO.
ECHO ************************************************************
ECHO *  Please, read the README.S3 file on the diskette first.  *
ECHO ************************************************************
%2\OS2\UNPACK.EXE  %1\TESTVER  %2 >NUL
%2\OS2\INSTALL\TESTVER.EXE %2
IF ERRORLEVEL 1 GOTO END
DEL %2\OS2\INSTALL\TESTVER.EXE 1>NUL 2>NUL
IF NOT .%3. == .. GOTO SKIP
ECHO Press any key when ready or Ctrl-C to quit. . .
PAUSE >NUL
:SKIP
ECHO.
ECHO ************************************************************
ECHO *  Loading files, Please wait.....                         *
ECHO ************************************************************
ECHO.
ECHO S3 Installation log file for 16M >> %2\OS2\INSTALL\DISPLAY.LOG
%2\OS2\ATTRIB -R %2\OS2\*.* /S          1>NUL 2>NUL
%2\OS2\UNPACK.EXE  %1\UNPACK2 %2 >NUL
%2\OS2\UNPACK2.EXE %1\UNPACK %2 >NUL
:START
IF EXIST %2\OS2\SVGA.SAV GOTO NEXT1
COPY %2\OS2\SVGA.EXE %2\OS2\SVGA.SAV >NUL
:NEXT1
IF EXIST %2\OS2\SCREEN0?.SAV GOTO NEXT2
COPY %2\OS2\SCREEN0?.SYS %2\OS2\SCREEN0?.SAV >NUL
:NEXT2
IF EXIST %2\OS2\INSTALL\WINSUP.IAM GOTO NEXT4A
IF EXIST %2\OS2\INSTALL\DSPINSTL.SAV GOTO NEXT3
COPY %2\OS2\INSTALL\DSPINSTL.EXE %2\OS2\INSTALL\DSPINSTL.SAV >NUL
:NEXT3
IF EXIST %2\OS2\INSTALL\RSPDSPI.SAV GOTO NEXT4
COPY %2\OS2\INSTALL\RSPDSPI.EXE %2\OS2\INSTALL\RSPDSPI.SAV >NUL
:NEXT4
%2\OS2\UNPACK2 %1\TOOLS %2    >NUL
GOTO NEXT4B
:NEXT4A
rem %2\OS2\UNPACK2 %1\TOOLS %2 /n:MKSYSLVL.EXE    >NUL
%2\OS2\UNPACK2 %1\TOOLS %2 /n:S3PATCH.EXE     >NUL
%2\OS2\UNPACK2 %1\TOOLS %2 /n:OS2KRNL.RTP     >NUL
%2\OS2\UNPACK2 %1\TOOLS %2 /n:VWIN.RTP        >NUL
:NEXT4B
%2\OS2\UNPACK2 %1\BUNDLE %2   >NUL
%2\OS2\INSTALL\DDICO.EXE %2
DEL %2\OS2\INSTAL\DDICO.EXE 1>NUL 2>NUL
DEL %2\OS2\INSTALL\PSS3CID.DSC 1>NUL 2>NUL
IF .%3. == .. GOTO UPDATE
%2\OS2\UNPACK2 %1\CID  %2 >NUL
DEL %2\OS2\INSTALL\PSS3.DSC 1>NUL 2>NUL
:UPDATE
rem %2\OS2\INSTALL\MKSYSLVL %2\OS2\INSTALL\SYSLEVEL.OS2 XR02110 >NUL
rem ECHO Updated syslevel.os2 with XR02110 >> %2\OS2\INSTALL\DISPLAY.LOG
rem DEL %2\OS2\INSTALL\MKSYSLVL.EXE >NUL
%2\OS2\ATTRIB -R -S -H %2\OS2KRNL       1>NUL 2>NUL
ECHO Patching OS2KRNL >> %2\OS2\INSTALL\DISPLAY.LOG
%2\OS2\INSTALL\S3PATCH /NOP /NOS /Q  %2\  %2\OS2\INSTALL\OS2KRNL.RTP >> %2\OS2\INSTALL\DISPLAY.LOG 2>NUL
%2\OS2\ATTRIB +R +S +H %2\OS2KRNL       1>NUL 2>NUL
DEL %2\OS2\INSTALL\OS2KRNL.RTP  >NUL
ECHO Patching VWIN.SYS >> %2\OS2\INSTALL\DISPLAY.LOG
%2\OS2\INSTALL\S3PATCH /NOP /NOS /Q  %2\OS2\MDOS  %2\OS2\INSTALL\VWIN.RTP >> %2\OS2\INSTALL\DISPLAY.LOG 2>NUL
DEL %2\OS2\INSTALL\S3PATCH.EXE  >NUL
DEL %2\OS2\INSTALL\VWIN.RTP     >NUL
IF EXIST %2\OS2\SCREEN01.SAV DEL %\OS2\SCREEN02.SYS 2>NUL
IF EXIST %2\OS2\SCREEN02.SAV DEL %\OS2\SCREEN01.SYS 2>NUL
IF EXIST %2\OS2\INSTALL\DSPDRVS GOTO PRELOAD
:DISPLAYMESSAGE
ECHO ************************************************************
ECHO *   1) Perform a shutdown and restart the system.          *
ECHO *                                                          *
ECHO *   2) After the restart, open the OS/2 System folder,     *
ECHO *      then open the System Setup folder.  Open the        *
ECHO *      Display Driver Install object.  This will execute   *
ECHO *      the Display Driver Installation (DSPINSTL)utility   *
ECHO *      program.                                            *
ECHO *                                                          *
ECHO *   3) When DSPINSTL has completed, open the OS/2 System   *
ECHO *      folder, then open the System Setup folder.  Open    *
ECHO *      the System object and select the desired screen     *
ECHO *      resolution on the Screen page of the notebook.      *
ECHO *      Then close the System - Settings notebook.          *
ECHO *                                                          *
ECHO *   4) Perform a shutdown and restart the system.          *
ECHO ************************************************************
GOTO END
:DAMAGED
ECHO ÿ
ECHO ************************************************************
ECHO * This diskette does not contain all necessary files.      *
ECHO ************************************************************
ECHO DAMAGED DISKETTE >> %2\OS2\INSTALL\DISPLAY.LOG
GOTO END
:USAGE
ECHO ÿ
ECHO Usage: S3INST [INSTALLDRIVE:] [BOOTDRIVE:]
GOTO END
:INSERTDISK
ECHO ************************************************************
ECHO * Insert S3 Display Driver Diskette                        *
ECHO ************************************************************
pause
GOTO NEXT7
:PRELOAD
IF EXIST %2\OS2\INSTALL\PRELOAD\CONFIG.EXE GOTO COPYPRLDFILES
%2\OS2\UNPACK2.EXE S3PRF %2 >NUL
%2\OS2\INSTALL\S3PRF.EXE
DEL %2\OS2\INSTAL\S3PRF.EXE 1>NUL 2>NUL
GOTO DISPLAYMESSAGE
:COPYPRLDFILES
ECHO  Preloaded system configuration >> %2\OS2\INSTALL\DISPLAY.LOG
IF NOT EXIST %1\CONFIG GOTO DAMAGED
IF EXIST %2\OS2\INSTALL\WINSUP.IAM GOTO NEXT6
IF EXIST %2\OS2\INSTALL\PRELOAD\CONFIG.SAV GOTO NEXT5
COPY %2\OS2\INSTALL\PRELOAD\CONFIG.EXE %2\OS2\INSTALL\PRELOAD\CONFIG.SAV >NUL
:NEXT5
%2\OS2\UNPACK2 %1\CONFIG %2 >NUL
:NEXT6
IF NOT EXIST %1\S3WIN  GOTO INSERTDISK
:NEXT7
IF NOT EXIST %1\S3.DSP GOTO DAMAGED
IF NOT EXIST %1\S3VIDEO GOTO DAMAGED
IF NOT EXIST %1\DISPLAY.DL_ GOTO DAMAGED
COPY %1\S3WIN       %2\OS2\INSTALL\DSPDRVS >NUL
COPY %1\S3.DSP      %2\OS2\INSTALL\DSPDRVS >NUL
COPY %1\S3VIDEO  %2\OS2\INSTALL\DSPDRVS >NUL
COPY %1\DISPLAY.DL_ %2\OS2\INSTALL\DSPDRVS >NUL
GOTO DISPLAYMESSAGE
:END
DEL %2\OS2\INSTALL\TESTVER.EXE 1>NUL 2>NUL
