Metropoli BBS
VIEWER: install.inf MODE: TEXT (ASCII)
 
 
;;	INSTALL.INF - Script For Installing Windows Drivers
;;	Copyright 1991, 1992 - Weitek Corp.
 
[String9] := No     ;; UnSet Completion Flag for exit screen
SetCompletionStatusTo UnFinished  ;; UnSet Instalit's internal completion flag
                                  ;; in case of CTRL-X exit
 
Do Setup          ;; Setup screen parameters, color, etc.  See procedure @ end
 
[Dir1] := CurrentDirectory  ;; Get current directory
 
 
;;                    Extract Drive letter of current directory
;;                    Good for drives A: through L:
 
If [Dir1] Contains A:
    [String2] := A:
    [String6] := A
Endif
 
If [Dir1] Contains B:
    [String2] := B:
    [String6] := B
Endif
 
If [Dir1] Contains C:
    [String2] := C:
    [String6] := C
Endif
 
If [Dir1] Contains D:
    [String2] := D:
    [String6] := D
Endif
 
If [Dir1] Contains E:
    [String2] := E:
    [String6] := E
Endif
 
If [Dir1] Contains F:
    [String2] := F:
    [String6] := F
Endif
 
If [Dir1] Contains G:
    [String2] := G:
    [String6] := G
Endif
 
If [Dir1] Contains H:
    [String2] := H:
    [String6] := H
Endif
 
If [Dir1] Contains I:
    [String2] := I:
    [String6] := I
Endif
 
If [Dir1] Contains J:
    [String2] := J:
    [String6] := J
Endif
 
If [Dir1] Contains K:
    [String2] := K:
    [String6] := K
Endif
 
If [Dir1] Contains L:
    [String2] := L:
    [String6] := L
Endif
 
;;         Welcome screen
Dialog
  .c
  .cThanks for purchasing the WinMAX Graphics Accelerator.
  .c
  .cThis program copies the WinMAX drivers into your Windows
  .cSYSTEM subdirectory and updates SETUP.INF so that the driver
  .cchoices for the WinMAX will be available from the Windows
  .cSetup program.
 
 
  .cIf you have not yet installed Windows on your system,
  .cplease exit now by typing CONTROL-X.
 
EndDialog
 
;;		The installation directory is the root of the
;;		installation program's drive.
 
[Dir6] := CurrentDirectory
[InstallationDirectory] := [Dir6]
 
 
[String8] := [InstallFromDrive]
If [String8] Contains A
    [InstallationDirectory] := [InstallFromDrive]:\
Endif
 
If [String8] Contains B
    [InstallationDirectory] := [InstallFromDrive]:\
Endif
 
;;		The Windows Directory is the first directory in the
;;		path that has a WIN.INI.
 
If [WindowsDirectory] = ""
  Dialog
      .c
      .cWarning.Install cannot find your Windows directory.
      .cEither you have not installed Windows, your installation
      .chas been damaged, or your path statement does not include
      .cyour Windows directory.
      .c
      .cPlease remedy this situation, then run Install again.
      .c
   EndDialog
   SoLong
Endif
 
GetMenuChoice
 Install the WinMAX Windows 3.0 Drivers
    ; - copies the WinMAX Windows driver files to your Windows
    ;   directory, and
    ; - modifies SETUP.INF in your Windows system directory so that the
    ;   Windows Setup "sees" the WinMAX Windows Drivers.
 Install the WinMAX Windows 3.1 Drivers
    ; - copies the WinMAX Windows driver files to your Windows
    ;   directory, and
    ; - modifies SETUP.INF in your Windows system directory so that the
    ;   Windows Setup "sees" the WinMAX drivers.
 Remove the WinMAX Windows Drivers
    ; - removes the WinMAX Windows driver files
    ;   from your Windows directory, and
    ; - restores the SETUP.INF file to its original state
    ;   before installation of the WinMAX Graphics Accelerator.
 Exit
    ; Exit the WinMAX Graphics Accelerator driver installation program now.
EndGetMenuChoice
 
InCase Choice is
  =1:    [String3] := installed into
         [String4] := win3.0
         Do GetUserInput
         Do CopyDrivers
         Do EditSetups
         Do ByeBye
  =2:    [String3] := installed into
         [String4] := win3.1
         Do GetUserInput
         Do CopyDrivers
         Do EditSetups
         Do ByeBye
  =3:    [String3] := removed from
         Do GetUserInput
         Do CopyDrivers
         Do EditSetups
         Do ByeBye2
  =4:    Do ByeBye3
EndCase
 
Procedure GetUserInput
  [String5] := [WindowsDirectory]
  Dialog [String5] UseHeader " Please verify your Windows Directory "
 
   If this is correct, Press ENTER to accept.
   Otherwise, enter the name of the directory where Windows
   is installed.  Include the Drive name.
   .c
   For example:  D:\WINDOWS
   .c
  EndDialog
  [WindowsDirectory] := [String5]
  [string1] := [String5]\SYSTEM
 
  Popup WinMAX drivers will be [String3]: [String1]
 
EndProcedure
 
Procedure CopyDrivers
  Do RemoveFiles
  If [String3] = installed into
    OpenCopyWindow
      CopyFiles from [InstallationDirectory] to [String1]
         wnd*.drv
         vddwndx.386
      EndCopyFiles
      If [String4] = win3.1
         CopyFiles from [InstallationDirectory] to [String1]
              wndxvga.3gr
         EndCopyFiles
      EndIf
    If FileExists [String1]\winmem32.dll
    else
      CopyFiles from [InstallationDirectory] to [String1]
         winmem32.dll
      EndCopyFiles
    Endif
    CloseCopyWindow
  EndIf
EndProcedure
 
 
Procedure EditSetups
[Number2] := 0
  If FileExists [WindowsDirectory]\SETUP.INF
   [Dir3] := [WindowsDirectory]
   [Number2] := 1
   Do EditSETUP.INF
  Endif
 
  If FileExists [WindowsDirectory]\SYSTEM\SETUP.INF
   [Dir3] := [WindowsDirectory]\SYSTEM
   [Number2] := 1
   Do EditSETUP.INF
  Endif
 
  If [Number2] = 0
   Dialog
      .cWe cannot find the directory containing SETUP.INF.
      .cEither you have not installed Windows, your installation
      .chas been damaged, or your path statement does not include
      .cyour Windows directory.
      .c
      .cPlease remedy this situation and rerun install.
      .c
   EndDialog
   SoLong
  EndIf
EndProcedure
 
Procedure EditSETUP.INF
 
;;                              Extract drive from Windows path and switch
;;                              to it.  Good for Drives C: through L:
 
  if [Dir3] contains C:
   DosCommand C: Quietly
  EndIf
 
  if [Dir3] contains D:
   DosCommand D: Quietly
  EndIf
 
  if [Dir3] contains E:
   DosCommand E: Quietly
  EndIf
 
  if [Dir3] contains E:
   DosCommand E: Quietly
  EndIf
 
  if [Dir3] contains F:
   DosCommand F: Quietly
  EndIf
 
  if [Dir3] contains G:
   DosCommand G: Quietly
  EndIf
 
  if [Dir3] contains H:
   DosCommand H: Quietly
  EndIf
 
  if [Dir3] contains I:
   DosCommand I: Quietly
  EndIf
 
  if [Dir3] contains J:
   DosCommand J: Quietly
  EndIf
 
  if [Dir3] contains K:
   DosCommand K: Quietly
  EndIf
 
  if [Dir3] contains L:
   DosCommand L: Quietly
  EndIf
 
;;                             Now that "Windows" drive is current, switch
;;                             to Windows Directory
 
 DOSCommand cd [Dir3] Quietly
 
;;                             Setup copy from source to Windows directory
 
;;                                Make sure there is enough room
;;                                to complete the installation
;;                                We need 2Xsize of setup.inf
;;                                plus  enough room for wtkstpad
;;                                and wtkstprm plus a little.
 
  [Number1] := SizeOfFile SETUP.INF
  [Number6] := SizeOfFile SETUP.INF
  [Number5] := [Number6] + 50000
  [Number4] := [Number1] + [Number1]
  [Number1] := [Number4] + 50000
  [Number3] := FreeSpaceOnDrive [String6]
 
Dialog
	.c The next step is to modify SETUP.INF in [Dir3].
	.c This will take a few seconds.
EndDialog
 
If [Number3] < [Number1]
;;                      Not enough space to complete install
If [String3] = installed into
  Dialog PressAKey whiteonred UseHeader "Need More Disk Space"
    .c
    .c You need to have [Number1] bytes on the drive containing your
    .c Windows directory (e.g. drive C:) in order to complete the
    .c installation.  Please remove files from that drive and try again.
    .c Do not remove files we just copied:
    .c wnd*.drv, vddwndx.386, wndxvga.3gr, or winmem32.dll.
    .c
  EndDialog
Else
  Dialog PressAKey whiteonred UseHeader "Need More Disk Space"
    .c
    .c You need to have [Number5] bytes on the drive containing your
    .c Windows directory (e.g. drive C:) in order to complete the
    .c removal.  Please remove files from that drive and try
    .c again.
    .c
  EndDialog
EndIf
 
GoTo [Point1]
Endif
  CopyFiles from [InstallationDirectory] to [Dir3] Quietly
    wtkstprm.exe
    wtkstpad.exe
  EndCopyFiles
 
;;                             Run wtkstprm on Windows directory
 
  Run [Dir3]\wtkstprm.exe Quietly
 
;;                             Are we installing?  If so, run & copy as below
 
  If [String3] = installed into
    Run [Dir3]\wtkstpad.exe [String4] Quietly
    [Number8] := OSExitCode
    If OSExitCode = 99
         Dialog PressAKey whiteonred UseHeader "SETUP.INF Has Too Many Disks"
             .cInstallation of WinMAX Windows Drivers cannot
             .cbe completed because you have too many entries (35)
             .cin the [disks] section of your SETUP.INF file.
             .c
             .cPlease remedy the situation by removing one entry.
             .c
         EndDialog
         DOSCommand Del Setup.WT2 Quietly
         DOSCommand Del Setup.WT1 Quietly
         Do RemoveFiles
         GoTo [Point1]
    EndIf
 
    CopyFiles from [Dir3] to [Dir3] Quietly
      setup.wt2 as setup.inf
    EndCopyFiles
    DOSCommand Del Setup.WT2 Quietly
 
;;                             If removing then copy old setup to setup.inf
 
  Else
    CopyFiles from [Dir3] to [Dir3] Quietly
      setup.wt1 as setup.inf
    EndCopyFiles
  EndIf
 
;;                             In any case, delete these files
 
  DOSCommand Del Setup.WT1 Quietly
 
  DOSCommand del wtkstprm.exe Quietly
  DOSCommand del wtkstpad.exe Quietly
 
;;                             If we made it this far, we're all done
 
[String9] := Yes                ;; Set Completion Flag
;;                            And switch to drive and CD to directory
;;                            from which Install was called from
[Point1]
  DosCommand [String2] Quietly
  DOSCommand cd [Dir1] Quietly
 
 
SetCompletionStatusTo Finished  ;; Set Instalit's internal completion flag
                                ;; in case of CTRL-X exit
EndProcedure
 
 
Procedure ByeBye
 
  If [String9] = No
  SetCompletionStatusTo Finished ;; Set Instalit's internal completion flag
                                 ;; Though exit without success, supress
                                 ;; redundant non-completion messages
 
    Dialog PressAKey whiteonred UseHeader "Installation Incomplete"
     .c
     .cPlease run Install again to complete installation
     .cof WinMAX Windows Drivers Drivers.
     .c
    EndDialog
  EndIf
 
  If [String9] = Yes
    Dialog PressAKey whiteonltblue UseHeader "Installation Complete"
    .c
    .cInstallation of WinMAX Windows Drivers successful!
    .c
 
    When you again see the DOS prompt:
      * Change to your Windows directory
      * Type SETUP [ENTER]
      * Use the Up or Dn arrow then ENTER to select the Display option
      * Select the Windows driver of your choice
      * Start Windows in the normal fashion
 
    .cThanks again for buying the WinMAX Graphics Controller
   EndDialog
  EndIf
 SoLong
EndProcedure
 
Procedure ByeBye2
 
  If [String9] = No
  SetCompletionStatusTo Finished ;; Set Instalit's internal completion flag
                                 ;; Though exit without success, supress
                                 ;; redundant non-completion messages
 
    Dialog PressAKey whiteonred UseHeader "Removal of WinMAX Drivers incomplete"
     .c
     .cPlease run Install again to complete removal of files.
     .c
    EndDialog
  EndIf
 
  If [String9] = Yes
    Dialog PressAKey whiteonltblue UseHeader "Removal Complete"
    .c
    .c Removal of the WinMAX Windows drivers Completed.
 
    The WinMAX Windows drivers have been removed. You
    cannot not run Windows using one of these drivers now.
 
    When you again see the DOS prompt:
      * Change to your Windows directory
      * Type SETUP [ENTER]
      * Use the Up or Dn arrow then ENTER to select the Display option
      * Select the driver of your choice
      * Start Windows in the normal fashion
 
    .cThanks again for buying the WinMAX Graphics Controller.
   EndDialog
  EndIf
 SoLong
EndProcedure
 
Procedure RemoveFiles
  If FileExists [String1]\wnd*.drv
    DOSCommand del [String1]\wnd*.drv Quietly
  Endif
  If FileExists [String1]\wndxvga.3gr
    DOSCommand del [String1]\wndxvga.3gr Quietly
  Endif
  If FileExists [String1]\vddwndx.386
    DOSCommand del [String1]\vddwndx.386 Quietly
  Endif
EndProcedure
 
Procedure ByeBye3
 
;;                               Exit from main menu
 
Dialog PressAKey whiteonred
.cInstallation or removal of WinMAX Windows Driver
.cfiles not completed.  Exit requested by user.
.c
.cPlease run Install again to perform installation or removal
.cof the WinMAX Windows Drivers.
.c
EndDialog
SetCompletionStatusTo Finished  ;; Set Instalit's internal completion flag
SoLong
EndProcedure
 
 
;;                           Set up color scheme, etc.
 
Procedure Setup
  SetClearScreenOnExit On
  SetCheckMarks Off
  SetBackgroundCharTo B0
  ;;SetPopupAttrTo RedOnLightGray
  SetShadowAttrTo BlackOnBlack
  SetScreenAttrTo WhiteOnBlue
  SetTopLineAttrTo BlackOnLightGray
  SetBottomLineAttrTo BlackOnLightGray
  SetTopLineTo BlankString
  SetTopLineTo    "           WinMAX Windows Driver Installation Utility v1.0          "
  SetBottomLineTo BlankString
  SetBottomLineTo "   Type CONTROL-X to quit at any time                                         "
  SetExitMessageTo Copyright 1991-1992
EndProcedure
 
EndScript

[ RETURN TO DIRECTORY ]