
/* Installation script for VIS */

@SubDir	"C:\\VIS3-60A"

@Position 1,1
@Print	"\n                        Superscape  Visualiser 3.60A\n"
	  "                           Installation Procedure\n"

@OpenWindow 14,10,52,9,0,15
@Print  " This software is protected by Superscape according\n"
        " to the terms and conditions provided with the\n"
	" accompanying electronic documentation LICENSE.\n"
	" If you accept the terms of this license, choose\n"
	" ACCEPT to confirm.\n\n\n\n\n"
	"   Use cursor keys and Enter to make your choice."
@Position 1,7
@CheckOne  [1 "                ACCEPT\n"
            2 "                CANCEL INSTALLATION"
           ]
@CloseWindow
@IF (Option 2)
 @GOTO {EXIT}
@ENDIF

/* Get installation directory */

@Position 2,10
@GetString {SubDir}	"Select installation directory : "

@ClearLine 10

/* Install program and drivers if required */

@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 {AUTO}
@ENDIF

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

@Graphics "SVGA"

/* Copy VRT program files to PROGRAMS directory */

@ClearLine 5
@ClearLine 7
@ClearLine 8
@ClearLine 9
@ClearLine 11
@Position  5,9
@Print	"Installing Visualiser 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"
@File   "{SubDir}\\PROGRAMS\\VIS_{Graphics}.CFG" > "{SubDir}\\PROGRAMS\\VIS.CFG"
@File   ".\\LICENSE"	>	"{SubDir}\\PROGRAMS\\"
@File   ".\\*.VRT"	>	"{SubDir}\\DEMOS\\"
@File   ".\\*.TXT"	>	"{SubDir}\\DEMOS\\"

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

:AUTO
@OpenWindow 28,10,23,3,0,15
@Print	" Update AUTOEXEC.BAT ?\n\n"
@CheckOne  [10 "       YES\n"
            11 "       NO    "
           ]
@CloseWindow

@IF	(Option 10)
  @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

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

@ClearLine 8
@ClearLine 9
@ClearLine 10
@ClearLine 11
@ClearLine 12

@Position 1,6
@Print   "                    Finished installation of Visualiser\n\n"
@IF	(Option 10)
  @Print "                You must reboot for changes to take affect\n\n"
@ENDIF
@Print   "                                Press A Key\n\n"

@Pause

:EXIT

/* Installation finished */
