/*
 INSTALL.DAT

 Project: panaStation Classic
 Version: 1.0

*/

// To place a @pause in the center of the display page,
// space in 38 spaces and then type @pause.  To make sure
// that the @pause is at the bottom of the display, the
// @pause should be at line 21 or better of the display.

// Standard header here...

@DefineProject
	@Name = "panaStation Classic"
	@Version = "1.00"
	@Subdir = "\\USTATION\\DRIVERS"
	@OutDrive = C
	@Group = "A"
	@InDiskBell = 1
@EndProject

// Define all the vars you need here
// Init all strings with "" or a hard coded string
// Init all Integers with 0 or 1

@DefineVars
	@Integer @DDrive = 99
	@Integer @StrLens = 0
	@Integer @bannercol = 0
	@Integer @Version5Flag = 1
	@Integer @OurCol = 0
	@Integer @XX = 0
	@Dir @USTATIONDir  = "\\USTATION"
	@Drive @USTATIONDrive  = C
	@qstring @redprogram = "PANASTN.RED"
	@qstring @thisprogram = "PANASTN.EXP"
	@qstring @namethisprogram = "panaStation Classic"
	@qstring @helpcontact = "Spacetec IMC Corp."
	@qstring @ourhomeexp = ""
	@qstring @ourhomered = ""
	@qstring @tempstring = ""
	@qstring @bannername = " p a n a S t a t i o n   C l a s s i c   I n s t a l l "
@EndVars

// setup some of the local var defs

// Used to display the banner on all screens

@xx = @strlen("@bannername")
@bannercol = (38 - @xx/2)

// get the correct string for the EXP and the RED files

@ourhomeexp = @wherearewe(@thisprogram)

@ourhomered = @wherearewe(@redprogram)

@tempstring = " utility for @namethisprogram ! "
@xx = @strlen(@tempstring)
@ourcol = (40 - @xx/2)

@movecstr(0,0,63,"ษออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออป")
@movecstr(1,0,63,"บ                                                                            บ")
@movecstr(2,0,63,"บ                                                                            บ")
@movecstr(3,0,63,"บ                                                                            บ")
@movecstr(3,25,48," Welcome to the installation ")
@movecstr(4,0,63,"บ                                                                            บ")
@movecstr(4,@ourcol,48,@tempstring)
@movecstr(5,0,63,"บ                                                                            บ")
@movecstr(6,0,63,"บ                                                                            บ")
@movecstr(7,0,63,"บ                                                                            บ")
@movecstr(8,0,63,"บ                                                                            บ")
@movecstr(8,32,63,"Developed by:")
@movecstr(9,0,63,"บ                                                                            บ")
@movecstr(10,0,63,"บ                                                                            บ")
@movecstr(10,30,49,"Spacetec IMC Corp.")
@movecstr(11,0,63,"บ                                                                            บ")
@movecstr(11,25,49,"  100 Foot of John Street")
@movecstr(12,0,63,"บ                                                                            บ")
@movecstr(12,28,49,"  Lowell, MA  01854")
@movecstr(13,0,63,"บ                                                                            บ")
@movecstr(13,37,49,"USA")
@movecstr(14,0,63,"บ                                                                            บ")
@movecstr(15,0,63,"บ                                                                            บ")
@movecstr(16,0,63,"บ                                                                            บ")
@movecstr(17,0,63,"บ                                                                            บ")
@movecstr(18,0,63,"บ                                                                            บ")
@movecstr(19,0,63,"บ                                                                            บ")
@movecstr(20,0,63,"บ                                                                            บ")
@movecstr(21,0,63,"บ                                                                            บ")
@movecstr(22,0,63,"บ                                                                            บ")
@movecstr(23,0,63,"บ                                                                            บ")
@movecstr(24,0,63,"บ                                                                            บ")
@movecstr(25,0,63,"ศออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออผ")


@OurPause

@Display
   @cls
@EndDisplay

// clear the options first
@clearoption(1000)
@clearoption(2000)

@GetOption @cls
@LocalWindow(14,40)

@movecstr(1,8,62,"ษอออออออออออออออออออออออออออออออออออออออออออออออออออออออออออป")
@movecstr(2,8,62,"บ                                                           บ")
@movecstr(3,8,62,"ศอออออออออออออออออออออออออออออออออออออออออออออออออออออออออออผ")
@Movecstr(2, @bannercol, 48, @bannername)

@move(8,0)
	   Please enter the Version of MircoStation you are running:

	@Option 1000 = "    Version 5     "
	@Option 2000 = "    Version 4     "

@EndOption

@If(2000 [= @Option)
   @Version5Flag = 0
@Else
   @Version5Flag = 1
@EndIf



Get_USTATION:

@GetOutDrive @USTATIONDrive

	Install needs to know which drive you would like to copy 
	@namethisprogram files to. Please select an available 
	drive from the list below.

    @LocalWindow(16,56)   
  
	Use the [Up Arrow], [Down Arrow], 
	[Pg Up], & [Pg Dn] keys to highlight 
	your selection and then press the 
	[Enter] key to continue.
  
@EndOutDrive

@GetSubDir @USTATIONDir

    @Cls
    @LocalWindow(14,40)

    @movecstr(1,8,62,"ษอออออออออออออออออออออออออออออออออออออออออออออออออออออออออออป")
    @movecstr(2,8,62,"บ                                                           บ")
    @movecstr(3,8,62,"ศอออออออออออออออออออออออออออออออออออออออออออออออออออออออออออผ")
    @Movecstr(2, @bannercol, 48, @bannername)

    @movecstr(7,5,31,"      Enter The MicroStation directory located on @USTATIONDrive:")

@EndSubDir

// Clear the options out
@clearoption(10)
@clearoption(20)

@If (@DirExists("@USTATIONDrive:\\@USTATIONDir"))
  @GoTo Report
@Else
  @GoTo NoDirExist
@Endif

// Now we display path not found message and ask the user to try again.

NoDirExist:
    @LocalWindow(14,40)
    @movecstr(1,8,62,"ษอออออออออออออออออออออออออออออออออออออออออออออออออออออออออออป")
    @movecstr(2,8,62,"บ                                                           บ")
    @movecstr(3,8,62,"ศอออออออออออออออออออออออออออออออออออออออออออออออออออออออออออผ")
    @Movecstr(2, @bannercol, 48, @bannername)


    @movecstr(7,5,31,"     @USTATIONDrive:@USTATIONDir does not exist. ")
    @movecstr(9,5,31,"     Please re-enter the information. ")

    @clearoption(10)
    @clearoption(20)

@Display
    @move(18,20)
    @pause
    @cls
@EndDisplay

@GoTo Get_USTATION



// Now we know where to install panaStation Classic, tell the user whats going on

Report:

@clearoption(10)
@clearoption(20)

@tempstring = " @USTATIONDrive:@USTATIONDir exists, do you wish to use it? "
@xx = @strlen(@tempstring)
@ourcol = (38 - @xx/2)

@Getoption
@localwindow(14,40)

@movecstr(1,8,62,"ษอออออออออออออออออออออออออออออออออออออออออออออออออออออออออออป")
@movecstr(2,8,62,"บ                                                           บ")
@movecstr(3,8,62,"ศอออออออออออออออออออออออออออออออออออออออออออออออออออออออออออผ")
@Movecstr(2, @bannercol, 48, @bannername)

@movecstr(9,@ourcol,48,@tempstring)
	 @Option 10 = "Yes, Continue"
	 @Option 20 = "No; re-enter the information"
@Endoption

@If(20 [= @Option)
   @Goto Get_USTATION
@Endif

// we get here from building the dir\sub-dir and not asking if they want to use it.

WeBuiltPath:

// Test the amount of free room left on the dest drive

@Display @Cls

   @if (@diskfree(@USTATIONDrive) < 600000)

      @move(7,0)
      The selected output disk drive only has @diskfree(@USTATIONDrive) bytes.

      @namethisprogram requires a minumum of 0.6mb.

      The Install program will now exit, please correct this problem

      and re-run the Install program.
      @move(21,0)
	 @pause
      @exit
   @endif
@enddisplay

@tempstring = " @USTATIONDrive:@USTATIONDir "
@xx = @strlen(@tempstring)
@ourcol = (40 - @xx/2)

@movecstr(12,@ourcol,63,@tempstring)

@tempstring = " @Name will be installed in: "
@xx = @strlen(@tempstring)
@ourcol = (40 - @xx/2)

// Clear the options out
@clearoption(10)
@clearoption(20)

@GetOption

@LocalWindow(17,40)

@movecstr(1,8,62,"ษอออออออออออออออออออออออออออออออออออออออออออออออออออออออออออป")
@movecstr(2,8,62,"บ                                                           บ")
@movecstr(3,8,62,"ศอออออออออออออออออออออออออออออออออออออออออออออออออออออออออออผ")
@Movecstr(2, @bannercol, 48, @bannername)

@movecstr(8,@ourcol,63,@tempstring)
	 @Option 10 = "Yes, this is the correct path"
	 @Option 20 = "No; re-enter the information"
@endoption

@If(10 [= @Option)
   @Goto Start_Copy
@Else
   @Goto Get_USTATION
@Endif

Start_Copy:

@If (@DirExists("@USTATIONDrive:\\@USTATIONDir\\DRIVERS"))
  @GoTo Got_Allsubs
@Else
   @MkDir("@USTATIONDrive:@USTATIONDir\\DRIVERS")
@Endif

Got_Allsubs:

@If (@Version5Flag == 1)
// Here if Version 5 of MicroStaiton
@DefineDisk
   @Label = "Disk #1"
   @BeginLib @ourhomered
     @File PANASTN.EXP  @OUT @USTATIONDrive:\\@USTATIONDir\\DRIVERS\\panastnp.*
     @File PANASTN.MA   @OUT @USTATIONDrive:\\@USTATIONDir\\DRIVERS\\panastnp.*
     @File PANASTNp.MGL  @OUT @USTATIONDrive:\\@USTATIONDir\\DRIVERS\\*.*
     @File PANASTN.EXP  @OUT @USTATIONDrive:\\@USTATIONDir\\DRIVERS\\panastns.*
     @File PANASTN.MA   @OUT @USTATIONDrive:\\@USTATIONDir\\DRIVERS\\panastns.*
     @File PANASTNs.MGL  @OUT @USTATIONDrive:\\@USTATIONDir\\DRIVERS\\*.*
     @File PSCONFIG.EXE @OUT @USTATIONDrive:\\@USTATIONDir\\DRIVERS\\*.*
     @File READ.ME      @OUT @USTATIONDrive:\\@USTATIONDir\\DRIVERS\\*.*
     @File PSTATION.HLP @OUT @USTATIONDrive:\\@USTATIONDir\\*.*
   @EndLib
@EndDisk

@Else
// Here if Version 4 of MicroStaiton
@DefineDisk
   @Label = "Disk #1"
   @BeginLib @ourhomered
     @File PANASTN.EXP  @OUT @USTATIONDrive:\\@USTATIONDir\\DRIVERS\\panastn.*
     @File PANASTN.MA   @OUT @USTATIONDrive:\\@USTATIONDir\\DRIVERS\\panastn.*
     @File PANASTN.MGL  @OUT @USTATIONDrive:\\@USTATIONDir\\DRIVERS\\*.*
     @File PSCONFIG.EXE @OUT @USTATIONDrive:\\@USTATIONDir\\DRIVERS\\*.*
     @File READ.ME      @OUT @USTATIONDrive:\\@USTATIONDir\\DRIVERS\\*.*
     @File PSTATION.HLP @OUT @USTATIONDrive:\\@USTATIONDir\\*.*
   @EndLib
@EndDisk
@Endif

@Finish @cls

   @move(2,0)
     You have successfully installed @namethisprogram.


     Thank you again for using @namethisprogram.  We appreciate
     your support and welcome any comments you may have concerning
     our products. To register this software and be eligible for 
     discounts on upgrades and other Spacetec IMC products, you may 
     contact us by phone at 508-970-0440, or by Fax at, 508-970-0199. For
     Technical Support, please contact your graphics board manufacturer.

 @move(21,0)
     @pause

@EndFinish

// end-of-file

