@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\*.DSP GOTO DAMAGED
IF NOT EXIST %1\TOOLS GOTO DAMAGED
IF NOT EXIST %1\BUNDLE GOTO DAMAGED
IF NOT EXIST %1\UNPACK2.EXE GOTO DAMAGED
IF NOT EXIST %1\UNPACK GOTO DAMAGED
ECHO.
ECHO ************************************************************
ECHO *  Please, read the README.S3 file on the diskette first.  *
ECHO ************************************************************
%1\TESTVER
IF ERRORLEVEL 1 GOTO END
PAUSE
ECHO.
ECHO ************************************************************
ECHO *  Loading files, Please wait.....                         *
ECHO ************************************************************
ECHO.
%2\OS2\ATTRIB -R %2\OS2\*.* /S          1>NUL 2>NUL
REM IF EXIST %2\OS2\UNPACK2.EXE GOTO START
COPY %1\UNPACK2.EXE %2\OS2\UNPACK2.EXE
%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\SCREEN01.SAV GOTO NEXT2
COPY %2\OS2\SCREEN01.SYS %2\OS2\SCREEN01.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\UNPACK %1\TOOLS %2    >NUL
GOTO NEXT4B
:NEXT4A
%2\OS2\UNPACK %1\TOOLS %2 /n:MKSYSLVL.EXE    >NUL
%2\OS2\UNPACK %1\TOOLS %2 /n:S3PATCH.EXE     >NUL
%2\OS2\UNPACK %1\TOOLS %2 /n:OS2KRNL.RTP     >NUL
%2\OS2\UNPACK %1\TOOLS %2 /n:VWIN.RTP        >NUL
:NEXT4B
%2\OS2\UNPACK %1\BUNDLE %2   >NUL
%2\OS2\INSTALL\MKSYSLVL %2\OS2\INSTALL\SYSLEVEL.OS2 XR02110 >NUL
DEL %2\OS2\INSTALL\MKSYSLVL.EXE >NUL
%2\OS2\ATTRIB -R -S -H %2\OS2KRNL       1>NUL 2>NUL
%2\OS2\INSTALL\S3PATCH /NOP /NOS /Q  %2\  %2\OS2\INSTALL\OS2KRNL.RTP  1>NUL 2>NUL
%2\OS2\ATTRIB +R +S +H %2\OS2KRNL       1>NUL 2>NUL
DEL %2\OS2\INSTALL\OS2KRNL.RTP  >NUL
%2\OS2\INSTALL\S3PATCH /NOP /NOS /Q  %2\OS2\MDOS  %2\OS2\INSTALL\VWIN.RTP  1>NUL 2>NUL
DEL %2\OS2\INSTALL\S3PATCH.EXE  >NUL
DEL %2\OS2\INSTALL\VWIN.RTP     >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 an OS/2 session and run     *
ECHO *      DSPINSTL.                                           *
ECHO *                                                          *
ECHO *   3) Open the OS/2 System, and then open System Setup.   *
ECHO *      Double Click on the System icon. Select the desired *
ECHO *      screen resolution on the Screen page of the         *
ECHO *      notebook. 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 ************************************************************
GOTO END
:USAGE
ECHO ÿ
ECHO Usage: S3INST [INSTALLDRIVE:] [BOOTDRIVE:]
GOTO END
:PRELOAD
IF EXIST %2\OS2\INSTALL\PRELOAD\CONFIG.EXE GOTO COPYPRLDFILES
%1\S3PRF
GOTO DISPLAYMESSAGE
:COPYPRLDFILES
IF NOT EXIST %1\CONFIG GOTO DAMAGED
IF NOT EXIST %1\S3WIN  GOTO DAMAGED
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
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\UNPACK %1\CONFIG %2 >NUL
:NEXT6
ECHO ************************************************************
ECHO *  1) Perform a shutdown and restart the system.           *
ECHO *                                                          *
ECHO *  2) After the restart, go to the Preinstalled Essentials *
ECHO *     folder and open the Configuration Tools folder.      *
ECHO *     Start the Configure Preinstalled System program to   *
ECHO *     change your display to SVGA mode.                    *
ECHO *                                                          *
ECHO *  3) Open the OS/2 System, and then open System Setup.    *
ECHO *     Double Click on the System icon. Select the desired  *
ECHO *     screen resolution on the Screen page of the notebook.*
ECHO *     Then close the System - Settings notebook.           *
ECHO *                                                          *
ECHO *  5) Perform a shutdown and restart the system.           *
ECHO ************************************************************

:END
