//Installation for Conversion for NYL for 5.2 -- Single and Network Versions
@DefineProject
   @Name = "CAS"
   @Version = "4.0"
   @OutDrive = C
   @Subdir = "\\FDP"
   @InDiskBell = 1
   @Requires @HardDisk
   @Immediate = 1
@EndProject

@DefineVars
   @Integer @TotMem = 0
   @Integer @InsEMS = 0
   @Integer @InsXMS = 0
   @Integer @InsMEM = 0
   @Integer @InsNET = 0
   @Integer @InsDOS = 0
@EndVars

@Display

   This program will install @Name, Version @Version
   onto your machine.  You will be asked for the drive
   and directory where your current @Name has been
   installed.


   Depending on the type of installation you are running,
   you might be asked to skip diskettes.   Please follow
   the instructions on the screen.

   @Pause
@EndDisplay

@GetOption
  @LocalWindow(10,40)
  This installation should not be run from Windows.  If you
  are in an MS-DOS Window in Windows you should exit the
  installation, exit Windows, and run the installation again
  Do you wish to continue?
        @Option 5 = "Yes"
        @Option 6 = "No"
@EndOption

@If (6 [=@Option)
    @Exit
@Endif

@GetOption
  @LocalWindow(10,40)
  It is absolutely necessary that you have a complete backup of
  ALL @Name Version 3.2 database files before running
  this conversion.
  Do you have a backup of ALL database files:
        @Option 1 = "Yes"
        @Option 2 = "No"
@EndOption

@If (2 [= @Option)
   @Display
      You should perform an automatic backup through the Backup
      All Files option in the Utilities Menu on your @Name
      Version 3.2 system before attempting a conversion to @Version.
      After you have done a backup, run the installation again.
      @Pause
      @Exit
   @EndDisplay
@EndIf

@If (@XMSAvail >= 2800000)
    @InsXMS = 1
@Else
   @InsEMS = 1
@Endif

@If (@InsEMS == 1)
@If (@RAMAvail < 565000)
   @GetOption
   @LocalWindow(10,40)
        You only have @RAMAvail bytes of memory available for
        installation of @Name.  We RECOMMEND
        that you run the installation with at least 565,000 bytes
        of memory free.  Please refer to our Update Notes for hints
        on configuring your memory to meet this requirement.


        @Option 3 = "Continue with Installation"
        @Option 4 = "Exit Installation"
   @EndOption
@EndIf

@If (4 [= @Option)
   @Exit
@EndIf
@EndIf

@GetOption
  @LocalWindow(10,40)
  Do you wish to install the Single User Version or the Network Version?
        @Option 3 = "Single User Version"
        @Option 4 = "Network Version"
@EndOption

@GetOutDrive
   @Suppress A
   @Suppress B
   @Cls
   @LocalWindow(15,40)
   In which drive is your @Name Version 3.2 located?
@EndOutDrive

@GetSubdir
     @Cls
     @LocalWindow(10,40)
     In which directory is your @Name Version 3.2 located?
     @Prompt = "Which directory ([Enter] = @Subdir)?"
@EndSubdir

@If (!@Exists "@OutDrive:\\@SubDir\\agency.exe")
   @Display
      This is not a valid @Name directory!  Please verify the name
      of your @Name directory, type install again, and enter the
      correct name of the directory.
      @Pause
      @Exit
   @EndDisplay
@Else
@Delete("@Outdrive:\\@Subdir\\drvmgr.exe")
@Delete("@Outdrive:\\@Subdir\\drivemgr.bat")
@Delete("@Outdrive:\\@Subdir\\whatisxx.exe")
@Delete("@Outdrive:\\@Subdir\\options.ovl")
@Delete("@Outdrive:\\@Subdir\\options.exe")
@Delete("@Outdrive:\\@Subdir\\commissi.exe")
@Delete("@Outdrive:\\@Subdir\\dwnmenu.dbf")
@Delete("@Outdrive:\\@Subdir\\track.exe")
@Delete("@Outdrive:\\@Subdir\\*.stl")
@Delete("@Outdrive:\\@Subdir\\*.dl1")
@Delete("@Outdrive:\\@Subdir\\*.dl2")
@Delete("@Outdrive:\\@Subdir\\*.dl3")
@EndIf

@Display
   @If (@DiskFree @OutDrive < 15000000)
      You only have @DiskFree @OutDrive bytes available of disk space.
      @Name requires at least 15,000,000 bytes available for
      installation.  Please remove unnecessary files and run the
      installation again.
      @Pause
      @Exit
   @Endif
@EndDisplay

@If (@InsXMS == 1)
@DefineDisk
      @Label = "Disk 1 Conversion"
//      @File FDP_CONV.EXE
      @File FDP_CONX.EXE
      @File FDP_CON2.EXE
      @File FDP_RRDB.EXE
      @File UNPACK.BAT
      @File MANUPDAT.BAT
      @File DBRUN.EXE
      @File DBCONV.BAT
      @File DBCONVX.BAT
      @File FDPMEM.EXE
@EndDisk

@Elseif(@InsEMS == 1)

@DefineDisk
      @Label = "Disk 1 Conversion"
      @File FDP_CONV.EXE
//      @File FDP_CONX.EXE
      @File FDP_CON2.EXE
      @File FDP_RRDB.EXE
      @File UNPACK.BAT
      @File MANUPDAT.BAT
      @File DBRUN.EXE
      @File DBCONV.BAT
      @File DBCONVX.BAT
      @File FDPMEM.EXE
@EndDisk
@EndIf

@If (3[=@Option)
@DefineDisk
      @Label = "Disk 2"
      @File FDP_AGS1.EXE
@EndDisk

@ElseIf (4[=@Option)
@DefineDisk
      @Label = "Disk 3"
      @File FDP_AGN1.EXE
      @File FDP_MODE.EXE
@EndDisk
@EndIf

@If (3[=@Option)
@DefineDisk
      @Label = "Disk 4"
      @File FDP_EXOS.EXE
      @File FDP_REL.EXE
      @File FDP_TRAN.EXE
@EndDisk

@DefineDisk
      @Label = "Disk 5"
//      @File FDP_EXON.EXE
      @File FDP_RR1.EXE
      @File FDP_RR2.EXE
      @File NYLINST.INF
      @File NYLINST.EXE
      @File NYLVERS.EXE
@EndDisk
@ElseIf (4[=@Option)

@DefineDisk
      @Label = "Disk 4"
//      @File FDP_EXOS.EXE
      @File FDP_REL.EXE
      @File FDP_TRAN.EXE
@EndDisk

@DefineDisk
      @Label = "Disk 5"
      @File FDP_EXON.EXE
      @File FDP_RR1.EXE
      @File FDP_RR2.EXE
      @File NYLINST.INF
      @File NYLINST.EXE
      @File NYLVERS.EXE
@EndDisk
@Endif

@DefineDisk
      @Label = "Disk 6"
      @File FDP_CAL.EXE
      @File FDP_MAIL.EXE
      @File FDP_EDIT.EXE
      @File FDP_REPM.EXE
@EndDisk


@Finish
   @Cls
   @ChDrive @OutDrive
   @ChDir "@SubDir"
   @If (@InsEMS == 1)
     @Execute "dbrun", "dbconv.bat "
   @ElseIf (@InsXMS == 1)
     @Execute "dbrun", "dbconvx.bat "
   @Endif
@EndFinish
