DefineVariables
Number [ErrCount]
Directory [windir]
Directory [winsdir]
Logical [EnKeyb]
Logical [NetAvail]
Logical [MathPres]
Logical [CDAvail]
Text [DispType]
Number [XMSAvail]
Number [ExtmemPagesActive]
Number [ExtmemPagesAvail]
Number [ExtMemAvail]
Number [ExtMemPres]
Number [ExpMempgavail]
Number [ExpMempgactive]
Text [osver]
Text [DosVer]
Text [EmsVer]
Text [ProdExecutable]
Text [InstDir]
TextArray [Array1]
EndDefineVariables
[EnKeyb] := NoCharacter
[NetAvail] := NoCharacter
[MathPres] := NoCharacter
[CDAvail] := NoCharacter
  
  Do SetupDisplay
  Do CheckHardware
  if [errcount] > 1
    Dialog UseHeader "Encountered Some Problems" LightGrayOnBlue
      Our installation has encounterd the following problems,
      you can continue to install or exit installation.
      [Array1][1]
      [Array1][2]
      [Array1][3]
      [Array1][4]
      [Array1][5]
      [Array1][6]
      [Array1][7]
    EndDialog
  endif

:start
GetMenuChoice UseHeader "Installing WEAPONS V 2.0"
  Install WEAPONS
  Install Wolfenstien
  Hardware Summary
  Exit Installation
EndGetMenuChoice
:start
  InCase Choice is
    =1: Do InstallGuns
    =2: Do InstallWolf
    =3: Do HardwareSum
    =4: SoLong
  EndIncase
goto start

Procedure SetupDisplay
  SetBackGroundCharTO b0
  SetPopupAttrTo LightGrayOnBlue
EndProcedure

Procedure InstallGuns
  DetermineInstallationDrive
  DetermineInstallationDirectory installationdrive:\WEAPONS
  QueFiles
    autoptr.cfg   
    gunsimg.gxl   
    gunstag.gxl   
    gunstxt.gxl   
    gxprint.gxl   
    weapons.exe   
  EndQueFiles
  GetQuedFiles ShowJustOne
  ModifyConfigSys
    SetBuffersToAtLeast 30
    SetFilesToAtLeast 30
  EndModifyConfigSys
EndProcedure

Procedure InstallWolf
  DetermineInstallationDrive
  DetermineInstallationDirectory installationdrive:\WOLF3D
  QueFiles
    audiohed.wl1  
    audiot.wl1    
    catalog.doc   
    gamemaps.wl1  
    maphead.wl1   
    order.frm     
    vgadict.wl1   
    vgagraph.wl1  
    vgahead.wl1   
    vswap.wl1     
    wolf3d.exe    
  EndQueFiles
  GetQuedFiles ShowJustOne
  ModifyConfigSys
    SetBuffersToAtLeast 30
    SetFilesToAtLeast 30
  EndModifyConfigSys
EndProcedure

Procedure CheckHardware
  [Number3] := 1
  if VGA
    [DispType] := VGA
  endif
  if  [DispType] = BlankString
    [Array1][[number3]] := Your Display adapter must be EGA or better.
    IncrementNumber [number3]
  endif
  [windir] := [WindowsDirectory]
  [winsdir] := [WindowsSystemDirectory]
  [ExtmemPagesActive] := ExtendedMemoryPagesActive
  [ExtmemPagesAvail] := ExtendedMemoryPagesAvailable
  [ExtMemAvail] := ExtendedMemoryAvailable
  [ExtMemPres] := ExtendedMemoryPresent
  [ExpMempgAvail] := ExpandedMemoryPagesAvailable
  [ExpMempgActive] := ExpandedMemoryPagesActive
  [osver] := OSVersion
  [DosVer] := DOSVersion
  [EmsVer] := EMSVersion
  if [DOSVer] < 3.3
    [Array1][[number3]] := You must have a DOS version of at least 3.3 or more
    IncrementNumber [number3]
  endif
  [Errcount] := [Number3]
EndProcedure

Procedure HardwareSum
  Dialog
    .cDOS Version  : [DosVer]
    .cExtended Memory Available : [ExtMemAvail]
    .cExtended Memory Present : [ExtMemPres]
    .cExtended Memory Pages Active : [ExtMemPagesActive]
    .cExtended Memory Pages Available : [ExtMemPagesAvail]
    .cExpanded Memory Pages Available : [ExpmempgAvail]
    .cExpanded Memory Pages Active    : [ExpMempgactive]
    .cWindows Directory  : [windir]
  EndDialog
EndProcedure
