@DefineProject
	@Name     = "Generic CADD"
	@Version  = "6.1"
	@OutDrive = C
	@SubDir   = "CADD6"
	@Group    = "z"
	@Terse
@EndProject

@GetOutDrive
	@Cls
		On which drive should @Name be installed?
	@Suppress A
	@Suppress B
@EndOutDrive

//blj
@If (@DriveRemote(@OutDrive))
	@Display
	  Be aware that you are installing to a network drive.
	  Your AUTOEXEC.BAT file will be automatically updated.
	@Pause
	@EndDisplay
@EndIf

@GetSubDir
	@Prompt = "ÍWhere should @Name 6.1 be installed?"
@EndSubDir

@DefineVars
	@Dir @Drawing  = "@SubDir\\GCD"
	@Dir @Comp     = "@SubDir\\CMP"
	@Dir @Hatch    = "@SubDir\\HCH"
	@Dir @Font     = "@SubDir\\FNT"
	@Dir @Macros   = "@SubDir\\MCR"
//blj
	@Drive @LocalDrive = C
	@Dir @LocalDir = "CADD6"
@EndVars

@GetSubDir  @Drawing
	@Prompt = "ÍWhere should the sample drawings be installed?"
@EndSubDir

@GetSubDir  @Comp
	@Prompt = "ÍWhere should the sample components be installed?"
@EndSubDir

@GetSubDir  @Hatch
	@Prompt = "ÍWhere should the hatches be installed?"
@EndSubDir

@GetSubDir  @Font
	@Prompt = "ÍWhere should the fonts be installed?"
@EndSubDir

@GetSubDir  @Macros
	@Prompt = "ÍWhere should the sample macros be installed?"
@EndSubDir

@If (@DriveRemote(@OutDrive))
	@GetOutDrive @LocalDrive
		@Suppress A
		@Suppress B
		@If (@DriveRemote(C)) @Suppress C @EndIf
		@If (@DriveRemote(D)) @Suppress D @EndIf
		@If (@DriveRemote(E)) @Suppress E @EndIf
		@If (@DriveRemote(F)) @Suppress F @EndIf
		@If (@DriveRemote(G)) @Suppress G @EndIf
		@Cls
			 Verifying local drives...
		@If (@DriveRemote(H)) @Suppress H @EndIf
		@If (@DriveRemote(I)) @Suppress I @EndIf
		@If (@DriveRemote(J)) @Suppress J @EndIf
		@If (@DriveRemote(K)) @Suppress K @EndIf
		@If (@DriveRemote(L)) @Suppress L @EndIf
		@If (@DriveRemote(M)) @Suppress M @EndIf
		@If (@DriveRemote(N)) @Suppress N @EndIf
		@If (@DriveRemote(O)) @Suppress O @EndIf
		@If (@DriveRemote(P)) @Suppress P @EndIf
		@If (@DriveRemote(Q)) @Suppress Q @EndIf
		@If (@DriveRemote(R)) @Suppress R @EndIf
		@If (@DriveRemote(S)) @Suppress S @EndIf
		@If (@DriveRemote(T)) @Suppress T @EndIf
		@If (@DriveRemote(U)) @Suppress U @EndIf
		@If (@DriveRemote(V)) @Suppress V @EndIf
		@If (@DriveRemote(W)) @Suppress W @EndIf
		@If (@DriveRemote(X)) @Suppress X @EndIf
		@If (@DriveRemote(Y)) @Suppress Y @EndIf
		@If (@DriveRemote(Z)) @Suppress Z @EndIf
		@Cls
	  On which drive should @Name local files be installed?
	@EndOutDrive

	@GetSubDir  @LocalDir
		@Prompt = "ÍWhere do you want your local files placed?"
	@EndSubDir

	@SetAutoexec 
		@Overwrite
		@Terse
		@SetReplace ("GCADD_FIL", "@LocalDrive:\\@Localdir")
		@If (100 [= @Option)
			@SetReplace ("GCADD_OVR", "@OutDrive:\\@Localdir")
		@Else
			@SetReplace ("GCADD_OVR", "@LocalDrive:\\@Localdir")
		@EndIf
	@EndAutoexec

	@ChDrive(@LocalDrive)
	@If (@DirExists("@LocalDir"))
		@Display
		Be aware that you are installing to an existing directory.
		You may not to want mix @Name with older versions.
		@Pause
		@EndDisplay
	@Else
		@ChDrive(@LocalDrive)
		@MkDir("@LocalDir")
		@ChDrive(@StartupDrive)
	@EndIf

	@GetOption
		@LocalWindow(10,40)
		@Option 100 = "Locally, for speed"
		@Option 101 = "Remotely, to save local drive space"
		@Cls
	 Some speed may be gained by copying the file 
	 GCADD.OVR file to your local directory.
	 Select the option that best suits your environment.
	@EndOption
@EndIf

@GetGroups
	@CheckBox
	@Cls

		Select Which parts of @Name 6.1 to install















    **   Use cursor keys to move to item. Press <SPACEBAR> to select.   **
    **   Press [ENTER] when done selecting to continue installing.      **
     @Set z = "FULL INSTALLATION                               (11974190 bytes)"
     @Set c = "CORE FILES - ALWAYS INSTALL FIRST TIME!          (3430867 bytes)"
     @Set a = "AutoCAD Import/Export (DXF, DWG) utilities        (657049 bytes)"
     @Set b = "Bill of Material Program                          (361408 bytes)"
     @Set x = "AutoCAD style fonts                              (1661031 bytes)"
     @Set o = "Fillable outline fonts                           (2149637 bytes)"
     @Set r = "Architectural Sample Symbols                      (376407 bytes)"
     @Set e = "Electronic Sample Symbols                        (1294335 bytes)"
     @Set n = "Engineering Sample Symbols                         (68897 bytes)"
     @Set u = "Business Sample Symbols                           (794855 bytes)"
     @Set h = "On-line, context sensitive Help system            (407203 bytes)"
     @Set d = "Sample Drawings and Template Drawings             (672696 bytes)"
     @Set p = "HPGL Import                                        (99805 bytes)"
     @EndGroups

@If ('c' [= @Group || 'z' [= @Group || 'd' [= @Group)
	@ChDrive @OutDrive
	@MkDir ("@Drawing")
	@ChDir "@Drawing"
		  //blj 
	//@ChangeExt ("DWG", "GCD", "Rename existing DWG files to Generic CADD 6.0 GCD files? (Y/N)")
	@ChDrive @InDrive
@EndIf

@If ('c' [= @Group || 'z' [= @Group)

	@GetOption
			       Pick default units.
		   @Option 1 = "English (inches)"
		   @Option 2 = "Metric (mm)"
	@EndOption
@EndIf
@DefineDisk
@Label = "Disk 1 (1.44M)"

   @File bomzip.exe @Group bz @Size 384066
   @File pointer.exe @Group cz @Size 28809  
   @File fontstuf.exe @Group cz @Size 49700 
   @File macros.exe @Out \@Macros\*.* @Group cz @Size 42439
   @File aconzip.exe @Group az @Size 703253
   @File hpzip.exe @Group pz @Size 99805
   @File engcmps.exe @Out \@Comp\*.* @Group nz @Size 68897
   @File paper.exe @Group cz @Size 107016
   @File smvideo.exe @Group cz @Size 417979 
   @File lgvideo.exe @Group cz @Size 607496 
   @File aconzip.exe @Group az @Size 390830        
   @File archcmps.exe @Out \@Comp\*.* @Group rz @Size 376407
   @File sampgcds.exe @Out \@Drawing\*.* @Group dz @Size 672696
   @File hches.exe @Out \@Hatch\*.* @Group cz @Size 35236
	

@EndDisk
@DefineDisk
@Label = "Disk 2 (1.44M)"
	
   @File tutcmps.exe @Out \@Comp\*.* @Group cz @Size 15824
   @File misc.exe @Group cz @Size 512875
   @File helpzip.exe @Group hz @Size 424886
   @File acadfnts.exe @Out \@Font\*.* @Group xz @Size 1661031
   @File eleccmps.exe @Out \@Comp\*.* @Group ez @Size 1294335
   @File buscmps.exe @Out \@Comp\*.* @Group uz @Size 794855
	

@EndDisk
@DefineDisk
@Label = "Disk 3 (1.44M)"
	
   @File program.exe @Group cz @Size 1192271
   @File outfnts.exe @Out \@Font\*.* @Group oz @Size 2149637
   @File caddfnts.exe @Out \@Font\*.* @Group cz @Size 389999

@If (2 [= @Option)
	@File metric.exe @Group cz @Size 6253
@EndIf
	@EndDisk /* all sizes end here */

@Finish
	@ChDrive @OutDrive
	
	@ChDir "@Font"  
	@If (@Exists "@OutDrive:\\@Font\\outfnts.exe")
		@Cls
			   Extracting Outline fonts
		@If (@System "@OutDrive:\\@Font\\outfnts.exe -o >nul") @EndIf
		@Delete ("@OutDrive:\\@Font\\outfnts.exe")
	@EndIf

	@If (@Exists "@OutDrive:\\@Font\\acadfnts.exe")
		@Cls
			Extracting AutoCAD style fonts
		@If (@System "@OutDrive:\\@Font\\acadfnts.exe -o >nul") @EndIf
		@Delete ("@OutDrive:\\@Font\\acadfnts.exe")
	@EndIf

	@ChDir "@SubDir"
	@If (@Exists "@OutDrive:\\@SubDir\\program.exe")
		@Cls
		     Extracting Generic CADD Program files
		@If (@System "@OutDrive:\\@SubDir\\program.exe -o >nul") @EndIf
		@Delete ("@OutDrive:\\@SubDir\\program.exe")
	@EndIf
	
	@ChDir "@Comp"
	@If (@Exists "@OutDrive:\\@Comp\\buscmps.exe")
		@Cls
			Extracting business components
		@If (@System "@OutDrive:\\@Comp\\buscmps.exe -o -d >nul") @EndIf
		@Delete ("@OutDrive:\\@Comp\\buscmps.exe")
	@EndIf

	@If (@Exists "@OutDrive:\\@Comp\\eleccmps.exe")        
		@Cls
		       Extracting electronic components
		@If (@System "@OutDrive:\\@Comp\\eleccmps.exe -o -d >nul") @EndIf
		@Delete ("@OutDrive:\\@Comp\\eleccmps.exe")
	@EndIf

	@ChDir "@SubDir"
	@If (@Exists "@OutDrive:\\@SubDir\\helpzip.exe")
		@Cls
			       Extracting Help
		@If (@System "@OutDrive:\\@SubDir\\helpzip.exe -o >nul") @EndIf
		@Delete ("@OutDrive:\\@SubDir\\helpzip.exe")
	@EndIf
	@If ('c' [= @Group || 'z' [= @Group)
	
		@If (@Exists "@OutDrive:\\@SubDir\\smvideo.exe")
		@Cls
			     Extracting video info
		@If (@System "@OutDrive:\\@SubDir\\smvideo.exe -o smvideo.tvd >nul") @EndIf
		@If (@System "@OutDrive:\\@SubDir\\smvideo.exe -o vga3.vgd >nul") @EndIf
		@If (@System "@OutDrive:\\@SubDir\\smvideo.exe -o ega3.vgd >nul") @EndIf
		@If (@System "@OutDrive:\\@SubDir\\smvideo.exe -o vesa16.vgd >nul") @EndIf
		@If (@System "@OutDrive:\\@SubDir\\smvideo.exe -o vesa256.vgd >nul") @EndIf
		@EndIf

		@If (@Exists "@OutDrive:\\@SubDir\\lgvideo.exe")
		@If (@System "@OutDrive:\\@SubDir\\lgvideo.exe -o lgvideo.tvd >nul") @EndIf
		@EndIf
	@EndIf
	@ChDir "@Drawing"        
	@If (@Exists "@OutDrive:\\@Drawing\\sampgcds.exe")
		@Cls
		Extracting sample drawings and template drawings
		@If (@System "@OutDrive:\\@Drawing\\sampgcds.exe -o >nul") @EndIf
		@Delete ("@OutDrive:\\@Drawing\\sampgcds.exe")
	@EndIf

	@ChDir "@SubDir"
	@If (@Exists "@OutDrive:\\@SubDir\\misc.exe")
		@Cls
		    Extracting Configuration and Setup files
		@If (@System "@OutDrive:\\@SubDir\\misc.exe -o >nul") @EndIf
		@Delete ("@OutDrive:\\@SubDir\\misc.exe")
	@EndIf

	@If (@Exists "@OutDrive:\\@SubDir\\aconzip.exe")
		@Cls
			    Extracting DXF Utility 
		@If (@System "@OutDrive:\\@SubDir\\aconzip.exe -o >nul") @EndIf
		@Delete ("@OutDrive:\\@SubDir\\aconzip.exe")
	@EndIf

	@If (@Exists "@OutDrive:\\@SubDir\\d2g.exe")
		@Cls
			Extracting AutoCAD DWG Utility
		@If (@System "@OutDrive:\\@SubDir\\d2g.exe -o >nul") @EndIf
		@Delete ("@OutDrive:\\@SubDir\\d2g.exe")
	@EndIf

	@ChDir "@Comp"
	@If (@Exists "@OutDrive:\\@Comp\\archcmps.exe")
		@Cls
		      Extracting architectural components
		@If (@System "@OutDrive:\\@Comp\\archcmps.exe -o -d >nul") @EndIf
		@Delete ("@OutDrive:\\@Comp\\archcmps.exe")
	@EndIf

	@ChDir "@SubDir"        
	@If (@Exists "@OutDrive:\\@SubDir\\bomzip.exe")
		@Cls
			       Extracting BOM
		@If (@System "@OutDrive:\\@SubDir\\bomzip.exe -o >nul") @EndIf
		@Delete ("@OutDrive:\\@SubDir\\bomzip.exe")
	@EndIf

	@ChDir "@Font"  
	@If (@Exists "@OutDrive:\\@Font\\caddfnts.exe")
		@Cls
		      Extracting standard Generic CADD fonts
		@If (@System "@OutDrive:\\@Font\\caddfnts.exe -o >Nul") @EndIf
		@Delete ("@OutDrive:\\@Font\\caddfnts.exe")
	@EndIf

	@ChDir "@SubDir"
	@If (@Exists "@OutDrive:\\@SubDir\\hpzip.exe")
		@Cls
			  Extracting HPGL converter
		@If (@System "@OutDrive:\\@SubDir\\hpzip.exe -o >nul") @EndIf
		@Delete ("@OutDrive:\\@SubDir\\hpzip.exe")
	@EndIf

	@If (@Exists "@OutDrive:\\@SubDir\\fontstuf.exe")
		@Cls
			  Extracting Font utilities
		@If (@System "@OutDrive:\\@SubDir\\fontstuf.exe -o >nul") @EndIf
		@Delete ("@OutDrive:\\@SubDir\\fontstuf.exe")
	@EndIf

	@If (@Exists "@OutDrive:\\@SubDir\\paper.exe")
		@Cls
		      Extracting printer and plotter drivers
		@If (@System "@OutDrive:\\@SubDir\\paper.exe -o >nul") @EndIf
		@Delete ("@OutDrive:\\@SubDir\\paper.exe")
	@EndIf
	@If ('c' [= @Group || 'z' [= @Group)

		@If (@Exists "@OutDrive:\\@SubDir\\pointer.exe")
		@Cls
			 Extracting Pointing Device Info
		@If (@System "@OutDrive:\\@SubDir\\pointer.exe -o pointers.tdg >nul") @EndIf
		@If (@System "@OutDrive:\\@SubDir\\pointer.exe -o dig13.ipd >nul") @EndIf
		@EndIf
	@EndIf

	@ChDir "@Macros"
	@If (@Exists "@OutDrive:\\@Macros\\macros.exe")
		@Cls
			    Extracting sample macros
		@If (@System "@OutDrive:\\@Macros\\macros.exe -o >nul") @EndIf
		@Delete ("@OutDrive:\\@Macros\\macros.exe")
	@EndIf

	@ChDir "@Hatch"
	@If (@Exists "@OutDrive:\\@Hatch\\hches.exe")
		@Cls
			    Extracting Hatch Patterns
		@If (@System "@OutDrive:\\@Hatch\\hches.exe -o >nul") @EndIf
		@Delete ("@OutDrive:\\@Hatch\\hches.exe")
	@EndIf

	@ChDir "@Comp"
	@If (@Exists "@OutDrive:\\@Comp\\tutcmps.exe")
		@Cls
			Extracting tutorial components
		@If (@System "@OutDrive:\\@Comp\\tutcmps.exe -o >nul") @EndIf
		@Delete ("@OutDrive:\\@Comp\\tutcmps.exe")
	@EndIf
	
	@If (@Exists "@OutDrive:\\@Comp\\engcmps.exe")
		@Cls
		       Extracting engineering components
		@If (@System "@OutDrive:\\@Comp\\engcmps.exe -o -d >nul") @EndIf
		@Delete ("@OutDrive:\\@Comp\\engcmps.exe")
	@EndIf

	@ChDir "@SubDir"
	@If (@Exists "@OutDrive:\\@SubDir\\metric.exe")
		@Cls
			 Extracting Metric information
		@If (@System "@OutDrive:\\@SubDir\\metric.exe -o >nul") @EndIf
		@Delete ("@OutDrive:\\@SubDir\\metric.exe")
	@EndIf
@If ('c' [= @Group || 'z' [= @Group)
	//blj modified hooks.c for install.exe
	@OurConfig
	@If (@Spawn ("config.exe")) @EndIf

		//blj  copy local files down from net
		@If (@DriveRemote(@OutDrive))
			@Cls
		   Copying network files to local directory
			@If (@System "copy *.msg        @LocalDrive:\\@LocalDir /v >nul") @EndIf
			@If (@System "copy glogo.*      @LocalDrive:\\@LocalDir /v >nul") @EndIf
			@If (@System "copy environ.fil  @LocalDrive:\\@LocalDir /v >nul") @EndIf
			@If (@System "copy macrocmd.fil @LocalDrive:\\@LocalDir /v >nul") @EndIf
			@If (@System "copy config6.fil  @LocalDrive:\\@LocalDir /v >nul") @EndIf
			@If (@System "copy acon6.fil    @LocalDrive:\\@LocalDir /v >nul") @EndIf
			@If (@System "copy config.exe   @LocalDrive:\\@LocalDir /v >nul") @EndIf
			@If (@System "copy *.vgd        @LocalDrive:\\@LocalDir /v >nul") @EndIf
			@If (@System "copy *.mnu        @LocalDrive:\\@LocalDir /v >nul") @EndIf
			@If (@System "copy *.mcr        @LocalDrive:\\@LocalDir /v >nul") @EndIf
			@If (@System "copy jobrem.exe   @LocalDrive:\\@LocalDir /v >nul") @EndIf
			@If (@System "copy prtmgr.exe   @LocalDrive:\\@LocalDir /v >nul") @EndIf

			@If (@Exists("@OutDrive:\\@SubDir\\environ.gcd"))
				@If (@System "copy  environ.gcd  @LocalDrive:\\@LocalDir >nul") @EndIf
			@EndIf

			@If (100 [= @Option)
				@If (@System "copy @OutDrive:\\@SubDir\\*.ovr @LocalDrive:\\@LocalDir >nul") @EndIf
			@EndIf
		@EndIf
@EndIf
@Cls
    Install complete!  At DOS prompt, type "CADD" and press <ENTER> to run
    Generic CADD.
@If ('c' [=@Group || 'z' [=@Group)
    
    NOTE: You may need to re-boot for video and/or network configuration 
	   changes to take effect.
@EndIf
@Pause
@EndFinish

