
/* Installation script for VIS */

@SubDir	"C:\\VRT4-00"
@User ""
@Org ""
@DName ""

@Position 1,1
@Print	"\n                        Superscape Visualiser 4.00\n"
	  "                               Installation\n"

/* Get user name and organisation */

@Position 1,8
@Print "              Please enter your name and organisation below."

@OpenWindow 4,12,72,3,0,15
:GETUSER
@Position 2,2
@Print            	"Enter your organisation : "
@Position 2,1
@GetSString {User}	"Enter your name         : "
@IF (ERROR=-1)
  @Goto {GETUSER}
@ENDIF
@Position 2,1
@Print "      Y"

:GETORG
@Position 2,2
@GetSString {Org}	"Enter your organisation : "
@IF (ERROR=-1)
  @Goto {GETORG}
@ENDIF
@Position 2,2
@Print "      Y"

@Position 2,4
@GetOption [14 "  Are these correct? (Y/N)" y
            15 "" Y
            16 "" n
            17 "" N]

@IF ((Option 16) || (Option 17))
  @ClearLine 1
  @ClearLine 2
  @ClearLine 4
  @Goto {GETUSER}
@ENDIF

@CloseWindow
@ClearLine 8

:GETDIR

/* Get installation directory */

@OpenWindow 4,13,72,1,0,15
@Position 2,1
@GetString {SubDir}	"Select installation directory : "
@CloseWindow

/* Check what user wants */

@OpenWindow 17,8,46,9,0,15
@Print        "            Choose what to install\n"
              " Use cursor keys and spacebar to toggle Yes/No\n"
              "          Press ENTER when finished\n\n"
@Position 1,10
@Print        "     50Mb required for full installation"

@Position 1,5
@CheckList [1 "    Visualiser software (1.5Mb)       ___\n" 1
	    2 "    Benchmarks (1.5Mb)                ___\n" 1
	    3 "    Examples (9.0Mb)                  ___\n" 1
	    4 "    Applications (38.0Mb)             ___"   1
	   ]
@CloseWindow

/* Install program and drivers if required */

@IF (Option 1)

  @CreateDir "{SubDir}\\PROGRAMS"
  @IF (ERROR=-1)
    @OpenWindow 24,15,32,3,4,15
    @Print " Cannot create directory\n {SubDir}\\PROGRAMS\n\n"
           "          Press a key"
    @Pause
    @CloseWindow
    @Goto {BENCH}
  @ENDIF

  /* Copy VRT program files to PROGRAMS directory */

  @ClearLine 5
  @ClearLine 7
  @ClearLine 8
  @ClearLine 9
  @ClearLine 11
  @Position  5,9
  @Print	"Installing Visualiser 4.00 to {SubDir}"

  @File   ".\\VIS.ARJ"	>	"{SubDir}\\PROGRAMS\\"
  @File   ".\\VISDRV.ARJ"	>	"{SubDir}\\PROGRAMS\\"
  @UnArj  "{SubDir}\\PROGRAMS\\VIS.ARJ"
  @UnArj  "{SubDir}\\PROGRAMS\\VISDRV.ARJ"
  @Delete "{SubDir}\\PROGRAMS\\VIS.ARJ"
  @Delete "{SubDir}\\PROGRAMS\\VISDRV.ARJ"
  @BinRep "{SubDir}\\PROGRAMS\\VIS.EXE","{Sys0}","{User}",50
  @BinRep "{SubDir}\\PROGRAMS\\VIS.EXE","{Sys1}","{Org}",50
  @File   "{SubDir}\\PROGRAMS\\VIS_SVGA.CFG" > "{SubDir}\\PROGRAMS\\VIS.CFG"
@ENDIF


/* Install benchmarks if required */

:BENCH
@IF (Option 2)

  @CreateDir "{SubDir}\\BENCH"
  @IF (ERROR=-1)
    @OpenWindow 24,15,32,3,4,15
    @Print " Cannot create directory\n {SubDir}\\BENCH\n"
           "          Press a key"
    @Pause
    @CloseWindow
    @Goto {EXAMPLES}
  @ENDIF

  @Position  5,9
  @Print  "Installing the Benchmark files to {SubDir}\\BENCH"
  @File   ".\\BENCH.ARJ"	>	"{SubDir}\\BENCH\\"
  @UnArj  "{SubDir}\\BENCH\\BENCH.ARJ"
  @Delete "{SubDir}\\BENCH\\BENCH.ARJ"
  @ClearLine 9
@ENDIF

/* Install examples if required */

:EXAMPLES
@IF (Option 3)

  @CreateDir "{SubDir}\\EXAMPLES"
  @IF (ERROR=-1)
    @OpenWindow 24,15,32,3,4,15
    @Print " Cannot create directory\n {SubDir}\\EXAMPLES\n"
           "          Press a key"
    @Pause
    @CloseWindow
    @Goto {APPS}
  @ENDIF

  :EXAM0
  @EXISTS ".\\EXAMPLE1.ARJ"
  @IF (ERROR=-1)
    @VolName {DName}
    @IF(DName != "VRT4 DIS.K2")
      @OpenWindow 25,10,30,0,2,15
      @Print  " Insert DISK 2 and press a key"
      @Beep
      @Pause
      @CloseWindow
      @Goto {EXAM0}
    @ENDIF
  @ENDIF

  @Position  5,9
  @Print  "Installing the Example files to {SubDir}\\EXAMPLES"
  @File	  ".\\EXAMPLE1.ARJ"	>	"{SubDir}\\EXAMPLES\\"
  @UnArj  "{SubDir}\\EXAMPLES\\EXAMPLE1.ARJ"
  @Delete "{SubDir}\\EXAMPLES\\EXAMPLE1.ARJ"

  :EXAM1
  @EXISTS ".\\EXAMPLE2.ARJ"
  @IF (ERROR=-1)
    @VolName {DName}
    @IF(DName != "VRT4 DIS.K3")
      @OpenWindow 25,10,30,0,2,15
      @Print  " Insert DISK 3 and press a key"
      @Beep
      @Pause
      @CloseWindow
      @Goto {EXAM1}
    @ENDIF
  @ENDIF

  @Position  5,9
  @Print  "Installing the Example files to {SubDir}\\EXAMPLES"
  @File	  ".\\EXAMPLE2.ARJ"	>	"{SubDir}\\EXAMPLES\\"
  @UnArj  "{SubDir}\\EXAMPLES\\EXAMPLE2.ARJ"
  @Delete "{SubDir}\\EXAMPLES\\EXAMPLE2.ARJ"

  :EXAM2
  @EXISTS ".\\EXAMPLE3.ARJ"
  @IF (ERROR=-1)
    @VolName {DName}
    @IF(DName != "VRT4 DIS.K4")
      @OpenWindow 25,10,30,0,2,15
      @Print  " Insert DISK 4 and press a key"
      @Beep
      @Pause
      @CloseWindow
      @Goto {EXAM2}
    @ENDIF
  @ENDIF

  @Position  5,9
  @Print  "Installing the Example files to {SubDir}\\EXAMPLES"
  @File	  ".\\EXAMPLE3.ARJ"	>	"{SubDir}\\EXAMPLES\\"
  @UnArj  "{SubDir}\\EXAMPLES\\EXAMPLE3.ARJ"
  @Delete "{SubDir}\\EXAMPLES\\EXAMPLE3.ARJ"
  @ClearLine 9
@ENDIF

/* Install applications if required */

:APPS
@IF (Option 4)

  @CreateDir "{SubDir}\\APPS"
  @IF (ERROR=-1)
    @OpenWindow 24,15,32,3,4,15
    @Print " Cannot create directory\n {SubDir}\\APPS\n"
           "          Press a key"
    @Pause
    @CloseWindow
    @Goto {AUTO}
  @ENDIF

  :APPS0
  @EXISTS ".\\APPS1.ARJ"
  @IF (ERROR=-1)
    @VolName {DName}
    @IF(DName != "VRT4 DIS.K5")
      @OpenWindow 25,10,30,0,2,15
      @Print  " Insert DISK 5 and press a key"
      @Beep
      @Pause
      @CloseWindow
      @Goto {APPS0}
    @ENDIF
  @ENDIF

  @Position  5,9
  @Print  "Installing the Application files to {SubDir}\\APPS"
  @File	  ".\\APPS1.ARJ"	>	"{SubDir}\\APPS\\"
  @UnArj  "{SubDir}\\APPS\\APPS1.ARJ"
  @Delete "{SubDir}\\APPS\\APPS1.ARJ"

  :APPS1
  @EXISTS ".\\APPS2.ARJ"
  @IF (ERROR=-1)
    @VolName {DName}
    @IF(DName != "VRT4 DIS.K6")
      @OpenWindow 25,10,30,0,2,15
      @Print  " Insert DISK 6 and press a key"
      @Beep
      @Pause
      @CloseWindow
      @Goto {APPS1}
    @ENDIF
  @ENDIF

  @Position  5,9
  @Print  "Installing the Application files to {SubDir}\\APPS"
  @File	  ".\\APPS2.ARJ"	>	"{SubDir}\\APPS\\"
  @UnArj  "{SubDir}\\APPS\\APPS2.ARJ"
  @Delete "{SubDir}\\APPS\\APPS2.ARJ"

  :APPS2
  @EXISTS ".\\APPS3.ARJ"
  @IF (ERROR=-1)
    @VolName {DName}
    @IF(DName != "VRT4 DIS.K7")
      @OpenWindow 25,10,30,0,2,15
      @Print  " Insert DISK 7 and press a key"
      @Beep
      @Pause
      @CloseWindow
      @Goto {APPS2}
    @ENDIF
  @ENDIF

  @Position  5,9
  @Print  "Installing the Application files to {SubDir}\\APPS"
  @File	  ".\\APPS3.ARJ"	>	"{SubDir}\\APPS\\"
  @UnArj  "{SubDir}\\APPS\\APPS3.ARJ"
  @Delete "{SubDir}\\APPS\\APPS3.ARJ"

  :APPS3
  @EXISTS ".\\APPS4.ARJ"
  @IF (ERROR=-1)
    @VolName {DName}
    @IF(DName != "VRT4 DIS.K8")
      @OpenWindow 25,10,30,0,2,15
      @Print  " Insert DISK 8 and press a key"
      @Beep
      @Pause
      @CloseWindow
      @Goto {APPS3}
    @ENDIF
  @ENDIF

  @Position  5,9
  @Print  "Installing the Application files to {SubDir}\\APPS"
  @File	  ".\\APPS4.ARJ"	>	"{SubDir}\\APPS\\"
  @UnArj  "{SubDir}\\APPS\\APPS4.ARJ"
  @Delete "{SubDir}\\APPS\\APPS4.ARJ"

  :APPS4
  @EXISTS ".\\APPS5.ARJ"
  @IF (ERROR=-1)
    @VolName {DName}
    @IF(DName != "VRT4 DIS.K9")
      @OpenWindow 25,10,30,0,2,15
      @Print  " Insert DISK 9 and press a key"
      @Beep
      @Pause
      @CloseWindow
      @Goto {APPS4}
    @ENDIF
  @ENDIF

  @Position  5,9
  @Print  "Installing the Application files to {SubDir}\\APPS"
  @File	  ".\\APPS5.ARJ"	>	"{SubDir}\\APPS\\"
  @UnArj  "{SubDir}\\APPS\\APPS5.ARJ"
  @Delete "{SubDir}\\APPS\\APPS5.ARJ"

  :APPS5
  @EXISTS ".\\APPS6.ARJ"
  @IF (ERROR=-1)
    @VolName {DName}
    @IF(DName != "VRT4 DIS.K10")
      @OpenWindow 25,10,31,0,2,15
      @Print  " Insert DISK 10 and press a key"
      @Beep
      @Pause
      @CloseWindow
      @Goto {APPS5}
    @ENDIF
  @ENDIF

  @Position  5,9
  @Print  "Installing the Application files to {SubDir}\\APPS"
  @File	  ".\\APPS6.ARJ"	>	"{SubDir}\\APPS\\"
  @UnArj  "{SubDir}\\APPS\\APPS6.ARJ"
  @Delete "{SubDir}\\APPS\\APPS6.ARJ"

  :APPS6
  @EXISTS ".\\APPS7.ARJ"
  @IF (ERROR=-1)
    @VolName {DName}
    @IF(DName != "VRT4 DIS.K11")
      @OpenWindow 25,10,31,0,2,15
      @Print  " Insert DISK 11 and press a key"
      @Beep
      @Pause
      @CloseWindow
      @Goto {APPS6}
    @ENDIF
  @ENDIF

  @Position  5,9
  @Print  "Installing the Application files to {SubDir}\\APPS"
  @File	  ".\\APPS7.ARJ"	>	"{SubDir}\\APPS\\"
  @UnArj  "{SubDir}\\APPS\\APPS7.ARJ"
  @Delete "{SubDir}\\APPS\\APPS7.ARJ"

  @EXISTS ".\\APPS8.ARJ"
  @IF (ERROR!=-1)
    @Position  5,9
    @Print  "Installing the Application files to {SubDir}\\APPS"
    @File   ".\\APPS8.ARJ"	>	"{SubDir}\\APPS\\"
    @UnArj  "{SubDir}\\APPS\\APPS8.ARJ"
    @Delete "{SubDir}\\APPS\\APPS8.ARJ"
  @ENDIF

  @ClearLine 9
@ENDIF

/* If user wants AUTOEXEC.BAT updated, do it */

:AUTO
@IF (Option 1)

@OpenWindow 4,9,72,6,0,15
@Print	"  In order to run Visualiser, the PATH needs to be extended with\n"
        "  ;{SubDir}\\PROGRAMS\n\n"
	"  An environment variable also needs to be set up as follows\n"
        "  SET VIS={SubDir}\\PROGRAMS\n\n"
@GetOption [10 "  Add these changes to your AUTOEXEC.BAT now? (Y/N)" y
            11 "" Y
            12 "" n
            13 "" N]
@CloseWindow

@IF ((Option 10) || (Option 11))
  @File  "C:\\AUTOEXEC.BAT"  > "C:\\AUTOEXEC.SS2"
  @VIS "$VIS$"
  @SetLine    "C:\\AUTOEXEC.BAT","SET VIS","SET VIS={SubDir}\\PROGRAMS"
  @IF(VIS!="")
    @SearchRep "C:\\AUTOEXEC.BAT",";{VIS}",";{SubDir}\\PROGRAMS",1
    @IF(ERROR=0)
      @VIS ""
    @ENDIF
  @ENDIF
  @IF(VIS="")
    @AppendLine "C:\\AUTOEXEC.BAT","PATH",";{SubDir}\\PROGRAMS"
  @ENDIF
@ENDIF

@ENDIF

/* Tidy up screen and wait for a key before exit */

@ClearLine 5
@ClearLine 6
@ClearLine 7
@ClearLine 8
@ClearLine 9
@ClearLine 10
@ClearLine 11
@Position 1,6
@Print	 "                 Finished installation of Visualiser 4.00\n\n"
@IF (Option 1)
@IF ((Option 10) || (Option 11))
  @Print "                You must reboot for changes to take effect\n"
	 "         Your original AUTOEXEC.BAT has been saved as AUTOEXEC.SS2\n\n"
@ENDIF
@ENDIF
@Print	 "                               Press A Key\n\n"

@Pause

/* Installation finished */
