;;*                                                                *
;;* CASmate For Windows Installation Script --- for Instalit       *
;;*     Enhanced  Experimental Version - for Workgroups            *
;;*                                                                *
;;******************************************************************
;;
;; Updated Last By : Meir Petler
;; Date: July 27 1994
;; CASmate / Windows Version: starting with 3.6
;;
;;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
;; Description:
;;
;; This Script will be used by INSTALIT for Windows to install CASmate,
;; parts of it or machine drivers.
;;
;; ---------------------------------------------------------------------------
;;
;; Pre - Sets:  Define Variables And Constants
;; *******************************************
;;
;; defines the minimum disk space needed for installation
definevariables
  number [diskspaceneeded] := 12000000   ;; Defines minimum disk space for Full Install
  Number [CasIniLoopCount] := 0
  Number [DriversNumber] 
  Number [DrvArrayCounter] 
  Number [DrvDescriptNum]
  Number [DrvDescriptCount]
  
  Text [CasIniBackName] 
  Text [CasIniBacknumber]
  Text [WinVerLong]
  Text [WinVerMsb]
  Text [CasDirLine] 
  Text [CasDirFromFile] 
  Text [DrvNameFromFile] 
  Text [DrvDescription]
  
enddefinevariables
;;
;;------------------------------------
;; General Mode Settings
;; *********************
;;
;; overwrite files that exist without asking
setreplacementinquiry off
;;---------------------------------------------------------------------------
;;
;; Special files and Bitmaps loading
;; *********************************
;;
CopyFiles FROM [InstallFromDirectory] to ShadowDirectory quietly
   SCANVEC.BMP
   CAS_WIN.BMP
EndCopyFiles

;; Screen color setting and Scanvec logo display
;; *********************************************
;;
LoadBitMap 1 ShadowDirectory\CAS_WIN.BMP
ShowBitMap 1
SetBackgroundColor 0 255 255 0 64 64 TopToBottom
SetDefaultBitmap off
SetBackgroundModeTo Transparent
ShowWindow Maximized
;;SetBottomLineTo BlankString
;;SetBottomLineTo Press ESCAPE to exit     (c) 1994  Scanvec, Inc.
SetTopLineTo BlankString
SetTopLineTo CASmate Installation and Setup Utility        ScanVec, Inc.
SetSupportInformation
  For Assistance, Call Scanvec Technical Support Offices:
  USA - Tel. 1-206-536-4750  Fax. 1-206-536-4850  BBS. 1-206-536-0737
  GERMANY - Tel. 971-1034   Fax. 971-60525  BBS 971-60422
  OTHER COUNTRIES - Tel. +972-3-6474477  Fax. +972-3-490778 
 			 BBS +972-3-6474484
EndSetSupportInformation
CopyFiles FROM [InstallFromDirectory] to ShadowDirectory quietly

   DRVLIST.TXT
   DRVDESCR.TXT
   TTY.DRV
   TTY.HLP
   TTY_OLD.DRV
   TTY_OLD.HLP
   CTL3DV2.DLL
   README.WRI
EndCopyFiles

LoadBitMap 2 ShadowDirectory\SCANVEC.BMP @XY(10,5)
Delay 5000
HideBitMap 1
ShowBitMap 2
;;
;;
;; ----------------------------------------------------------------------------
;;           E N D      O F      I N I T I A L I Z A T I O N
;; ----------------------------------------------------------------------------
;;
;;                       Start of Main Program Loop
;;                      ****************************
;;
;; ****** Welcome dialog
;;
Dialog
  .cWelcome to the CASmate for Windows Installation 
  .cand Setup Program
  .c
  .cThis program will install the Full CASmate system
  .cor update the existing installation on your hard disk.
  .c
  .cYou can interrupt installation any time
  .cby pressing the 'ESC' key.
  .c
  .cPress 'ENTER' to start the Installation / Setup.
EndDialog

;;
;;
;; **** MAIN Option Menu
;;      ****************
[Point1]
GetMenuChoice @xy CENTER Highlight 1 UseHeader "What Would You like to Install?" 
	Install CASmate - Complete Installation
		;Select this option if this is the first time you
		;are installing CASmate for Windows on this computer,
		;Or if you want to install everything, erasing old setup
		;configurations.
	Update Existing CASmate for Windows Installation
		;If you already have an Installation of CASmate for Windows
		;and you would like to save your current setup (Plotters,
		;Scanner, Directories) - Choose this option.
	Add Plotter / Engraver Drivers
		;If you have this product installed already, and you want only
		;to add a machine driver - choose this option. 
	Exit The Installer
		;If you Want to abort this program, select this option.
  EndGetMenuChoice


InCase Choice is
	=1: Do InstallAll
	=2: Do InstallRef
	=3: Do InstallDrv
	=4: SoLong

EndInCase

Do ConfigChk&Set
Do ByeBye

;; ****************************************************************************
;;          E N D    O F    M A I N    P R O G R A M     L O O P
;; ****************************************************************************


Procedure ConfigChk&Set
 
Dialog 5000 UseHeader " Configuration of Windows System"
.c
.cThe CASmate Installer will now check the configuration
.cof your system and update key files in your Windows System 
.cdirectory if they are old or missing.
.c
EndDialog

[WinVerLong] := ProductVersionOf [WindowsDirectory]\Printman.exe
[WinVerMsb] := SubstringOf [WinVerLong] from 1 to 11
If [WinVerMsb] = 00003.00010
	Dialog 5000 
	.c
	.cPlease wait...
	.c
	EndDialog
   CopyFiles from ShadowDirectory to [WindowsSystemDirectory] Quietly
   TTY_OLD.DRV as TTY.DRV
   TTY_OLD.HLP as TTY.HLP
   EndCopyFiles
EndIf

If [WinVerMsb] = 00003.00011
	Dialog 5000 
	.c
	.cPlease wait...
	.c
	EndDialog
   CopyFiles from ShadowDirectory to [WindowsSystemDirectory] Quietly
   TTY.DRV
   TTY.HLP
   EndCopyFiles
EndIf

If FileExists [WindowsSystemDirectory]\CTL3DV2.DLL
 Else
   CopyFiles from ShadowDirectory to [WindowsSystemDirectory] Quietly
   CTL3DV2.DLL
   EndCopyFiles
EndIf

;;Popup "Config check - Last  Milestone" ;; Remove before release !!!

EndProcedure

;;
;;
;; ***************************************************************************
;;     F u l l   I n s t a l l a t i o n  -  D e s t r u c t i v e 
;; ***************************************************************************
;;

Procedure InstallAll

;;Popup "Install All - First milestone" 
  [InstallationDirectory] := C:\CASWIN

;; check to see if there is enough disk space on target  
  [Point2]

  DetermineInstallationDrive [diskspaceneeded] RequireFixed

  if freespaceondrive installationdrive < [diskspaceneeded]
    dialog
      .cThe current drive you selected does not have
      .cenough space to install the files
      .c
      .cselect another drive or press esc and make more space 
      .cfor the installation.
      .c
    enddialog
    goto [Point2]
  endif

  DetermineInstallationDirectory InstallationDrive:\CASWIN QueSize

  QueFileGroup 2
  getquedfiles

;; build program group and program execution icon
  CopyFiles from ShadowDirectory to [InstallationDirectory] 
	README.WRI
	EndCopyFiles

  BuildProgramGroup "ScanVec Products" SCANVEC.GRP
     [InstallationDirectory]\cas_win.EXE "CASmate"
     [InstallationDirectory]\jobman.EXE "Job Manager"
     [WindowsDirectory]\write.exe [installationDirectory]\Readme.wri "Readme"
  EndBuildProgramGroup

  ChangeDirectoryTo [InstallationDirectory]

;;Popup "Install All - Second Milestone" ;; Remove before release !!!
;;Popup "CASmate INI LOOP" ;; Remove before release !!!

;; Dealing with casmate.ini file in the windows directory
;;    We create one if there is none, or rename it if
;;                     if exists
;;
;;
If FileExists [windowsdirectory]\CASMATE.INI
  	[CasIniLoopCount] := 0
  	[CasIniBackName] := CASMATE.01  ;; Inetialize string
  		[Point3]   
  	  IncrementNumber [CasIniLoopCount]
    		 If [CasIniLoopCount]<10
       			  [CasIniBackNumber] := 0[CasIniLoopCount]
      		    Else
        		  [CasIniBackNumber] := [CasIniLoopCount]
    		 EndIf

		If FileExists [WindowsDirectory]\CASMATE.[CasIniBackNumber]
 			 GoTo [Point3]
            	 Else
 			 [CasIniBackName] := CASMATE.[CasIniBackNumber]
		EndIf
Popup "Your Old CASmate.Ini will be saved as [CasIniBackName]
       RenameFile [WindowsDirectory]\CASMATE.INI to [CasIniBackName]
EndIf

deletefiles from [windowsdirectory] quietly
	CASMATE.INI
enddeletefiles

appendfile [windowsdirectory]\casmate.ini
           [Configuration]
           CASDir=[installationdirectory]
endappendfile
;;Popup "Install All - Go To Driver Install" ;; Remove before release !!!

Do InstallDrv

;;Popup "Install All - Last Milestone" ;; Remove before release !!!

EndProcedure



Procedure InstallRef


;;This is a partial installation, that will install only new or updated
;;files to the current CASwin directory. The user should specify the current
;;CASwin directory.

;; First - We look to see if we have a casmate.ini in the system.

If FileExists [WindowsDirectory]\casmate.ini
  Else
  Dialog
	.cThe Installer has NOT found the file CASmate.INI
	.cIn Your WINDOWS directory !
	.cYou MUST select Complete installation.
  EndDialog
  Goto [Point1]   
EndIf
;;Now, we extract from the CASmate.ini file the current CASdir
 
	ExamineTextFile [WindowsDirectory]\casmate.ini
	[CasDirLine] :=Line 2
	[CasDirFromFile] :=SubstringOf [CasDirLine] from 8 to End
  [InstallationDirectory] := [CasDirFromFile]

;; Testing to see if the chosen directory exists already.

If DirectoryExists [InstallationDirectory]
      Dialog
	.cThe Installer has determined that the active CASmate 
	.cfor Windows directory in this system is
	.c[InstallationDirectory]
	.c
	.cThis Information is from the CASmate.INI file In Your Windows directory !
	.cThe installer will Update the Installation in this directory.
	.c
	.c
	.cIf your installation is elsewhere, you will be able to select a
	.cdifferent directory during the installation, but you should note that
	.cthe CASmate.Ini file will be modified.
 	EndDialog

	Else
        Dialog
	.cThe Installer has determined that the active CASmate 
	.cfor Windows directory in this system Is [InstallationDirectory]
	.cBUT... Directory [InstallationDirectory] Does Not Exist 
	.con this Drive. Check the correct path of your 
	.ccurrent CASmate for Windows Directory, 
	.cfix your CASMATE.INI file, using a text editor,
	.cOr, choose Complete Installation in the main menu.
	EndDialog
      Goto [Point1]
EndIf
;; Testing to see if the chosen directory is an active CASwin directory
If FileExists [InstallationDirectory]\cas_win.exe
   else
   Dialog
	.cSorry, But Directory [InstallationDirectory] Is Not a Functional 
	.cCASmate Directory. Some files are missing... Check the correct 
	.cpath of your current CASmate for Windows Directory, 
	.cfix your CASMATE.INI file, using a text editor,
	.cOr choose Complete Installation in the main menu.
	EndDialog
      Goto [Point1]
EndIf

;; check to see if there is enough disk space on target  

 QueFileGroup 2 Inquire IfNewer

 DetermineInstallationDirectory [InstallationDirectory] QueSize

 getquedfiles

  CopyFiles from ShadowDirectory to [InstallationDirectory] 
	README.WRI
	EndCopyFiles

  BuildProgramGroup "ScanVec Products" SCANVEC.GRP
     [WindowsDirectory]\write.exe [installationDirectory]\Readme.wri "Readme"
  EndBuildProgramGroup

  ChangeDirectoryTo [InstallationDirectory]

;; Test to see if casmate.ini file needs to be modified
;; Remember - the file is still loaded in the memory from the "ExamineTextFile"
;; in line 153 in this script !
;; See page 5-205 in manual
;; *******************************************************
;; ModifyTextFile  Creates an automatic backup file !!!!

;; Popup "Install Ref - Second Milestone - Casmate Ini manipulation" ;; Remove before release !!!


ModifyTextFile [WindowsDirectory]\casmate.ini
InSection [Configuration]
AddOrChangeLineWith (CASdir,=,) as "CASdir=[InstallationDirectory]" at end

EndModifyTextFile

;; Another method - see page 6-359

;;[Array4][1] := Configuration
;;[Array4][2] := CASDir
;;[Array4][3] := [InstallationDirectory]
;;[Array4][4] := [WindowsDirectory]\casmate.ini
;;WRitePrivateProfileString Using [Array4]

ForgetTextFile     ;; To Remove CASmate.Ini from the Memory !

;;Popup "Install Ref - Last Milestone" ;; Remove before release !!!

EndProcedure

;;
;;
;;
;;----------------------------------------------------------------------------
;;----------------------------------------------------------------------------
;;----------------------------------------------------------------------------

Procedure InstallDrv
;;
;;This is a partial installation, that will install only Driver
;;files to the current CASwin directory. There is Auto detection of the current
;;CASwin directory - user can ONLY abort !!!.

;;*****************************************************************************
;;
;;  Initial tests - see if CASwin Exists already
;;
;;*****************************************************************************
;;

;; First - We look to see if we have a casmate.ini in the system.


;;Popup "Install Driver only - First Milestone" ;; Remove before release !!!

If FileExists [WindowsDirectory]\casmate.ini
  Else
  Dialog
	.cThe Installer has NOT found the file CASmate.INI
	.cin your WINDOWS directory !
	.cYou MUST select Complete installation.
  EndDialog
  Goto [Point1]   
EndIf
;;Now, we extract from the CASmate.ini file the current CASdir
 
	ExamineTextFile [WindowsDirectory]\casmate.ini
	[CasDirLine] :=Line 2
	[CasDirFromFile] :=SubstringOf [CasDirLine] from 8 to End
  [InstallationDirectory] := [CasDirFromFile]

;; Testing to see if the chosen directory exists already.

If DirectoryExists [InstallationDirectory]
      Dialog
	.cThe Installer has determined that the active CASmate 
	.cfor Windows directory in this system is:
	.c
	.c[InstallationDirectory]
	.c
	.cThis information is from the CASmate.INI file In your Windows directory.
	.cThe drivers you will select will be placed in this directory.
	.c
	.c
	.cIf You want to place the drivers elsewhere, you will be able to
	.cchange the install directory later. If you do so, remember
	.c to fix your CASMATE.INI file. 
      EndDialog

	Else
        Dialog
	.cThe Installer has determined that the active CASmate 
	.cfor Windows directory in this system is [InstallationDirectory]
	.cBUT... Directory [InstallationDirectory] Does Not Exist 
	.con this Drive. Check the correct path of your 
	.ccurrent CASmate for Windows Directory, 
	.cfix your CASMATE.INI file, using a text editor,
	.cOr, choose Complete Installation in the main menu.
	EndDialog
      Goto [Point1]
EndIf
;; Testing to see if the chosen directory is an active CASwin directory

If FileExists [InstallationDirectory]\cas_win.exe
   else
	Dialog
	.cSorry, but Directory [InstallationDirectory] is Not a Functional 
	.cCASmate Directory. Some important files are missing!!
	.cCheck the correct path of your current CASmate for Windows Directory, or choose
	.cfix your CASMATE.INI file, using a text editor,
	.cOr, choose Complete Installation in the main menu.
	EndDialog
      Goto [Point1]
EndIf

ForgetTextFile

;;*****************************************************************************
;;
;;  First stage - take the driver list from DRVLIST.txt and feed it to the menu
;;
;;*****************************************************************************

TextOut @xy(150,250) PLEASE WAIT

ExamineTextFile ShadowDirectory\DRVLIST.TXT
  [DriversNumber] := TextLineCount
  [DrvArrayCounter] := 1
 [Point4]
  [DrvNameFromFile] := Line [DrvArrayCounter]
  [Array2][[DrvArrayCounter]] := [DrvNameFromFile]
  If [DrvArrayCounter] < [DriversNumber]
        IncrementNumber [DrvArrayCounter]
     GoTo [Point4]
  EndIf

TextOut @xy(150,250) PLEASE WAIT, SEARCHING FOR DRIVER LIBRARY

;;Popup "Install Driver only - Second Milestone" ;; Remove before release !!!

ForgetTextFile   ;; Remove DRVLIST.TXT from memory !

ExamineTextFile ShadowDirectory\DRVDESCR.TXT
  [DrvDescriptNum] := TextLineCount
  [DrvDescriptCount] := 1
 [Point5]
  [DrvDescription] := Line [DrvDescriptCount]
  [Array1][[DrvDescriptCount]] := [DrvDescription]
  If [DrvDescriptCount] < [DrvDescriptNum]
        IncrementNumber [DrvDescriptCount]
     GoTo [Point5]
  EndIf



ForgetTextFile ;; Remove Driver description list from memory


;;
;;*****************************************************************************
;;
;;       Driver   Selection    Menu    -     Stage   2
;;
;;*****************************************************************************

   [DrvArrayCounter] :=1
SetTopLineTo BlankString
SetTopLineTo Press spacebar to toggle selection.
;;
GetMenuChoice AllowMultiple DisallowIfNone @xy(center,center)  UseHeader "Select One or More Drivers To Install"
   [Array1][1]
	   ;[Array2][1]
   [Array1][2]
	   ;[Array2][2]
   [Array1][3]
	   ;[Array2][3]
   [Array1][4]
	   ;[Array2][4]
   [Array1][5]
	   ;[Array2][5]
   [Array1][6]
	   ;[Array2][6]
   [Array1][7]
	   ;[Array2][7]
   [Array1][8]
	   ;[Array2][8]
   [Array1][9]
	   ;[Array2][9]
   [Array1][10]
	   ;[Array2][10]
   [Array1][11]
	   ;[Array2][11]
   [Array1][12]
	   ;[Array2][12]
   [Array1][13]
	   ;[Array2][13]
   [Array1][14]
	   ;[Array2][14]
   [Array1][15]
	  ;[Array2][15]
   [Array1][16]
	  ;[Array2][16]
   [Array1][17]
	   ;[Array2][17]
   [Array1][18]
	   ;[Array2][18]
   [Array1][19]
	   ;[Array2][19]
   [Array1][20]
	   ;[Array2][20]
   [Array1][21]
	   ;[Array2][21]
   [Array1][22]
	   ;[Array2][22]
   [Array1][23]
	   ;[Array2][23]
   [Array1][24]
	   ;[Array2][24]
   [Array1][25]
	   ;[Array2][25]
   [Array1][26]
	   ;[Array2][26]
   [Array1][27]
	   ;[Array2][27]
   [Array1][28]
	   ;[Array2][28]
   [Array1][29]
	   ;[Array2][29]
   [Array1][30]
	   ;[Array2][30]
   [Array1][31]
	   ;[Array2][31]
   [Array1][32]
	   ;[Array2][32]
   [Array1][33]
	   ;[Array2][33]
   [Array1][34]
	   ;[Array2][34]
   [Array1][35]
	   ;[Array2][35]
   [Array1][36]
	   ;[Array2][36]
   [Array1][37]
	   ;[Array2][37]
   [Array1] [38]
	   ;[Array2] [38]
   [Array1] [39]
	   ;[Array2] [39]
   [Array1] [40]
	   ;[Array2] [40]
   [Array1] [41]
	   ;[Array2] [41]
   [Array1] [42]
	   ;[Array2] [42]
   [Array1] [43]
	   ;[Array2] [43]
   [Array1] [44]
	   ;[Array2] [44]
   [Array1] [45]
	   ;[Array2] [45]
   [Array1] [46]
	   ;[Array2] [46]
   [Array1] [47]
	   ;[Array2] [47]
   [Array1] [48]
	   ;[Array2] [48]
   [Array1] [49]
	   ;[Array2] [49]
   [Array1] [50]
	   ;[Array2] [50]
   [Array1] [51]
	   ;[Array2] [51]
   [Array1] [52]
	   ;[Array2] [52]
   [Array1] [53]
	   ;[Array2] [53]
   [Array1] [54]
	   ;[Array2] [54]
   [Array1] [55]
	   ;[Array2] [55]
   [Array1] [56]
	   ;[Array2] [56]
   [Array1] [57]
	   ;[Array2] [57]
   [Array1] [58]
	   ;[Array2] [58]
   [Array1] [59]
	   ;[Array2] [59]
   [Array1] [60]
	   ;[Array2] [60]
   [Array1] [61]
	   ;[Array2] [61]
   [Array1] [62]
	   ;[Array2] [62]
   [Array1] [63]
	   ;[Array2] [63]
   [Array1] [64]
	   ;[Array2] [64]
   [Array1] [65]
	   ;[Array2] [65]
   [Array1] [66]
	   ;[Array2] [66]
   [Array1] [67]
	   ;[Array2] [67]
   [Array1] [68]
	   ;[Array2] [68]
   [Array1] [69]
	   ;[Array2] [69]
   [Array1] [70]
	   ;[Array2] [70]
   [Array1] [71]
	   ;[Array2] [71]
   [Array1] [72]
	   ;[Array2] [72]
   [Array1] [73]
	   ;[Array2] [73]
   [Array1] [74]
	   ;[Array2] [74]
   [Array1] [75]
	   ;[Array2] [75]
   [Array1] [76]
	   ;[Array2] [76]
   [Array1] [77]
	   ;[Array2] [77]
   [Array1] [78]
	   ;[Array2] [78]
   [Array1] [79]
	   ;[Array2] [79]
   [Array1] [80]
	   ;[Array2] [80]
   [Array1] [81]
	   ;[Array2] [81]
   [Array1] [82]
	   ;[Array2] [82]
   [Array1] [83]
	   ;[Array2] [83]
   [Array1] [84]
	   ;[Array2] [84]
   [Array1] [85]
	   ;[Array2] [85]
   [Array1] [86]
	   ;[Array2] [86]
   [Array1] [87]
	   ;[Array2] [87]
   [Array1] [88]
	   ;[Array2] [88]
   [Array1] [89]
	   ;[Array2] [89]
   [Array1] [90]
	   ;[Array2] [90]
   [Array1] [91]
	   ;[Array2] [91]
   [Array1] [92]
	   ;[Array2] [92]
   [Array1] [93]
	   ;[Array2] [93]
   [Array1] [94]
	   ;[Array2] [94]
   [Array1] [95]
	   ;[Array2] [95]
   [Array1] [96]
	   ;[Array2] [96]
   [Array1] [97]
	   ;[Array2] [97]
   [Array1] [98]
	   ;[Array2] [98]
   [Array1] [99]
	   ;[Array2] [99]
   [Array1] [100]
	   ;[Array2] [100]
   [Array1] [101]
	   ;[Array2] [101]
   [Array1] [102]
	   ;[Array2] [102]
   [Array1] [103]
	   ;[Array2] [103]
   [Array1] [104]
	   ;[Array2] [104]
   [Array1] [105]
	   ;[Array2] [105]
   [Array1] [106]
	   ;[Array2] [106]
   [Array1] [107]
	   ;[Array2] [107]
   [Array1] [108]
	   ;[Array2] [108]
   [Array1] [109]
	   ;[Array2] [109]
   [Array1] [110]
	   ;[Array2] [110]
   [Array1] [111]
	   ;[Array2] [111]
   [Array1] [112]
	   ;[Array2] [112]
   [Array1] [113]
	   ;[Array2] [113]
   [Array1] [114]
	   ;[Array2] [114]
   [Array1] [115]
	   ;[Array2] [115]
   [Array1] [116]
	   ;[Array2] [116]
   [Array1] [117]
	   ;[Array2] [117]
   [Array1] [118]
	   ;[Array2] [118]
   [Array1] [119]
	   ;[Array2] [119]
   [Array1] [120]
	   ;[Array2] [120]
   [Array1] [121]
	   ;[Array2] [121]
   [Array1] [122]
	   ;[Array2] [122]
   [Array1] [123]
	   ;[Array2] [123]
   [Array1] [124]
	   ;[Array2] [124]
   [Array1] [125]
	   ;[Array2] [125]
   [Array1] [126]
	   ;[Array2] [126]
   [Array1] [127]
	   ;[Array2] [127]
   [Array1] [128]
	   ;[Array2] [128]
   [Array1] [129]
	   ;[Array2] [129]
   [Array1] [128]
	   ;[Array2] [128]
   [Array1] [129]
	   ;[Array2] [129]
   [Array1] [130]
	   ;[Array2] [130]
   [Array1] [131]
	   ;[Array2] [131]
   [Array1] [132]
	   ;[Array2] [132]
   [Array1] [133]
	   ;[Array2] [133]
   [Array1] [134]
	   ;[Array2] [134]
   [Array1] [135]
	   ;[Array2] [135]
   [Array1] [136]
	   ;[Array2] [136]
   [Array1] [137]
	   ;[Array2] [137]
   [Array1] [138]
	   ;[Array2] [138]
   [Array1] [139]
	   ;[Array2] [139]
   [Array1] [140]
	   ;[Array2] [140]
   [Array1] [141]
	   ;[Array2] [141]
   [Array1] [142]
	   ;[Array2] [142]
   [Array1] [143]
	   ;[Array2] [143]
   [Array1] [144]
	   ;[Array2] [144]
   [Array1] [145]
	   ;[Array2] [145]
   [Array1] [146]
	   ;[Array2] [146]
   [Array1] [147]
	   ;[Array2] [147]
   [Array1] [148]
	   ;[Array2] [148]

EndGetMenuChoice

SetTopLineTo BlankString
SetTopLineTo CASmate Installation and Setup Utility        ScanVec, Inc.

InCase Choice is
	=1:Textout @xy(300,400) Driver Selected 
	   [String9] := [Array2] [1]
		Do OneDrvInsT
	=2:TextOut @xy(300,400) Driver Selected
	    [String9] := [Array2] [2]
		Do OneDrvInsT
	=3:TextOut @xy(300,400) Driver Selected
	    [String9] := [Array2] [3]
		Do OneDrvInsT
	=4:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [4]
		Do OneDrvInsT
	=5:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [5]
		Do OneDrvInsT
	=6:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [6]
		Do OneDrvInsT
	=7:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [7]
		Do OneDrvInsT
	=8:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [8]
		Do OneDrvInsT
	=9:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [9]
		Do OneDrvInsT
	=10:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [10]
		Do OneDrvInsT
	=11:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [11]
		Do OneDrvInsT
	=12:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [12]
		Do OneDrvInsT
	=13:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [13]
		Do OneDrvInsT
	=14:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [14]
		Do OneDrvInsT
	=15:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [15]
		Do OneDrvInsT
	=16:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [16]
		Do OneDrvInsT
	=17:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [17]
		Do OneDrvInsT
	=18:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [18]
		Do OneDrvInsT
	=19:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [19]
		Do OneDrvInsT
	=20:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [20]
		Do OneDrvInsT
	=21:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [21]
		Do OneDrvInsT
	=22:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [22]
		Do OneDrvInsT
	=23:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [23]
		Do OneDrvInsT
	=24:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [24]
		Do OneDrvInsT
	=25:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [25]
		Do OneDrvInsT
	=26:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [26]
		Do OneDrvInsT
	=27:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [27]
		Do OneDrvInsT
	=28:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [28]
		Do OneDrvInsT
	=29:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [29]
		Do OneDrvInsT
	=30:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [30]
		Do OneDrvInsT
	=31:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [31]
		Do OneDrvInsT
	=32:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [32]
		Do OneDrvInsT
	=33:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [33]
		Do OneDrvInsT
	=34:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [34]
		Do OneDrvInsT
	=35:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [35]
		Do OneDrvInsT
	=36:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [36]
		Do OneDrvInsT
	=37:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [37]
		Do OneDrvInsT
	=38:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [38]
		Do OneDrvInsT
	=39:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [39]
		Do OneDrvInsT
	=40:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [40]
		Do OneDrvInsT
	=41:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [41]
		Do OneDrvInsT
	=42:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [42]
		Do OneDrvInsT
	=43:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [43]
		Do OneDrvInsT
	=44:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [44]
		Do OneDrvInsT
	=45:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [45]
		Do OneDrvInsT
	=46:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [46]
		Do OneDrvInsT
	=47:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [47]
		Do OneDrvInsT
	=48:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [48]
		Do OneDrvInsT
	=49:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [49]
		Do OneDrvInsT
	=50:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [50]
		Do OneDrvInsT
	=51:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [51]
		Do OneDrvInsT
	=52:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [52]
		Do OneDrvInsT
	=53:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [53]
		Do OneDrvInsT
	=54:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [54]
		Do OneDrvInsT
	=55:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [55]
		Do OneDrvInsT
	=56:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [56]
		Do OneDrvInsT
	=57:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [57]
		Do OneDrvInsT
	=58:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [58]
		Do OneDrvInsT
	=59:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [59]
		Do OneDrvInsT
	=60:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [60]
		Do OneDrvInsT
	=61:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [61]
		Do OneDrvInsT
	=62:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [62]
		Do OneDrvInsT
	=63:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [63]
		Do OneDrvInsT
	=64:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [64]
		Do OneDrvInsT
	=65:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [65]
		Do OneDrvInsT
	=66:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [66]
		Do OneDrvInsT
	=67:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [67]
		Do OneDrvInsT
	=68:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [68]
		Do OneDrvInsT
	=69:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [69]
		Do OneDrvInsT
	=70:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [70]
		Do OneDrvInsT
	=71:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [71]
		Do OneDrvInsT
	=72:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [72]
		Do OneDrvInsT
	=73:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [73]
		Do OneDrvInsT
	=74:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [74]
		Do OneDrvInsT
	=75:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [75]
		Do OneDrvInsT
	=76:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [76]
		Do OneDrvInsT
	=77:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [77]
		Do OneDrvInsT
	=78:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [78]
		Do OneDrvInsT
	=79:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [79]
		Do OneDrvInsT
	=80:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [80]
		Do OneDrvInsT
	=81:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [81]
		Do OneDrvInsT
	=82:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [82]
		Do OneDrvInsT
	=83:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [83]
		Do OneDrvInsT
	=84:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [84]
		Do OneDrvInsT
	=85:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [85]
		Do OneDrvInsT
	=86:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [86]
		Do OneDrvInsT
	=87:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [87]
		Do OneDrvInsT
	=88:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [88]
		Do OneDrvInsT
	=89:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [89]
		Do OneDrvInsT
	=90:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [90]
		Do OneDrvInsT
	=91:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [91]
		Do OneDrvInsT
	=92:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [92]
		Do OneDrvInsT
	=93:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [93]
		Do OneDrvInsT
	=94:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [94]
		Do OneDrvInsT
	=95:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [95]
		Do OneDrvInsT
	=96:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [96]
		Do OneDrvInsT
	=97:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [97]
		Do OneDrvInsT
	=98:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [98]
		Do OneDrvInsT
	=99:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [99]
		Do OneDrvInsT
	=100:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [100]
		Do OneDrvInsT
	=101:Textout @xy(300,400) Driver Selected 
	   [String9] := [Array2] [101]
		Do OneDrvInsT
	=102:TextOut @xy(300,400) Driver Selected
	    [String9] := [Array2] [102]
		Do OneDrvInsT
	=103:TextOut @xy(300,400) Driver Selected
	    [String9] := [Array2] [103]
		Do OneDrvInsT
	=104:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [104]
		Do OneDrvInsT
	=105:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [105]
		Do OneDrvInsT
	=106:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [106]
		Do OneDrvInsT
	=107:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [107]
		Do OneDrvInsT
	=108:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [108]
		Do OneDrvInsT
	=109:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [109]
		Do OneDrvInsT
	=110:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [110]
		Do OneDrvInsT
	=111:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [111]
		Do OneDrvInsT
	=112:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [112]
		Do OneDrvInsT
	=113:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [113]
		Do OneDrvInsT
	=114:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [114]
		Do OneDrvInsT
	=115:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [115]
		Do OneDrvInsT
	=116:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [116]
		Do OneDrvInsT
	=117:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [117]
		Do OneDrvInsT
	=118:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [118]
		Do OneDrvInsT
	=119:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [119]
		Do OneDrvInsT
	=120:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [120]
		Do OneDrvInsT
	=121:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [121]
		Do OneDrvInsT
	=122:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [122]
		Do OneDrvInsT
	=123:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [123]
		Do OneDrvInsT
	=124:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [124]
		Do OneDrvInsT
	=125:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [125]
		Do OneDrvInsT
	=126:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [126]
		Do OneDrvInsT
	=127:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [127]
		Do OneDrvInsT
	=128:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [128]
		Do OneDrvInsT
	=129:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [129]
		Do OneDrvInsT
	=130:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [130]
		Do OneDrvInsT
	=131:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [131]
		Do OneDrvInsT
	=132:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [132]
		Do OneDrvInsT
	=133:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [133]
		Do OneDrvInsT
	=134:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [134]
		Do OneDrvInsT
	=135:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [135]
		Do OneDrvInsT
	=136:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [136]
		Do OneDrvInsT
	=137:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [137]
		Do OneDrvInsT
	=138:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [138]
		Do OneDrvInsT
	=139:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [139]
		Do OneDrvInsT
	=140:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [140]
		Do OneDrvInsT
	=141:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [141]
		Do OneDrvInsT
	=142:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [142]
		Do OneDrvInsT
	=143:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [143]
		Do OneDrvInsT
	=144:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [144]
		Do OneDrvInsT
	=145:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [145]
		Do OneDrvInsT
	=146:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [146]
		Do OneDrvInsT
	=147:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [147]
		Do OneDrvInsT
	=148:TextOut @xy(300,400) Driver Selected
		[String9] := [Array2] [148]
		Do OneDrvInsT

EndInCase
  DetermineInstallationDirectory [InstallationDirectory] QueSize
GetQuedFiles

;;Popup "Install Driver only - Last Milestone" ;; Remove before release !!!


EndProcedure

Procedure OneDrvInsT

;;Popup "Install Driver only - Third Milestone" ;; Remove before release !!!
;;Popup " The selected driver is [String9]"

If [String9] = BlankString
 Dialog
	.cNo driver was selected, Or driver is Invalid. Process aborted.
	.cTry to select another driver.  
 EndDialog
  Goto [Point1]
EndIf
	QueFiles
	[String9].*
	EndQueFiles
;;Popup " end of selection, driver [String9].*"

EndProcedure

Procedure ByeBye

;;Popup "Bye Bye - First Milestone" ;; Remove before release !!!

  DeleteFiles from ShadowDirectory
   SCANVEC.BMP
   CAS_WIN.BMP
   DRVLIST.TXT
   DRDESCR.TXT
   TTY.DRV
   TTY.HLP
   TTY_OLD.DRV
   TTY_OLD.HLP
   CTL3DV2.DLL
   README.WRI
  EndDeleteFiles
UnloadBitMap 1
  Dialog PressAKey WhiteOnBrown
	.cCASmate For Windows has been sucessfully installed.
	.c
	.cPlease Exit Windows and reboot your System
	.cbefore you start CASmate, so that the configuration
	.cchanges to your system can take place.
	.c
	.cTo run CASmate, open the program manager group called
	.c'ScanVec Products' and double-click the CASmate icon.
	.c
  EndDialog

EndProcedure


EndScript
