/*
 *  Designer installation DAT file - media control for 3 1/2 (1.44) meg
 *  floppy disks.
 *  This DAT file can be used with either the full AutoCAD R12c2, R12AS 
 *  installation or as a stand alone AutoCAD Designer installation.
 *
 *  MODIFICATION LOG:
 *  -----------------
 *  12/13/1993  : RNF   - initial completion, ready for QA testing
 *  12/31/1993  : RNF	- added @Finish block for post install processing and user 
 *			  messaging.
 *  01/02/1993	: RNF	- added adasfcnv.dcl to support list, also modified where
 *			  release directories exist for installation building.
 *  01/18/1994	: RNF	- added the Finish block, here all post install menu
 *			  modification is performed.  Also, if AutoSurf was detected
 *			  need to modify there menu file as well.
 *  01/27/1994	: RNF	- added 3 new files, ACADUS.LIN - which is the english LINETYPE  file
 *			  AD_AS_AV.BAT - this is a script file for combining Designer, AutoSurf
 *			  and AutoVision so they all autoload and remain well behaved.
 *			- removed the SAMPLE directory and files from installation.
 *			- extracted text from Finish block, however, @DATXMSG's cannot be
 *			  called from within this block.
 *  01/31/1994	: RNF	- added a check to the bottom text output that if Designer is installed
 *			  outside of the default AutoCAD directories, it both Subdir and Subdir2
 *			  are the same, only output the added path needed once.
 * 02/06/1994	: RNF	- added ADISO.DWG to the SUPPORT.LIB installation into the support
 *                        directory, this is the European protoype drawing file.
 * 02/10/1994	: RNF	- added ACD_API.DOC to the SUPPORT.LIB installation into the support
 *                        directory, this is the API function documentation.
 */


@DefineProject
   @If (@FULLINST == 0)
	@NAME           = "AutoCAD Designer"  /* Must match ADESIGN disks */
	@VERSION        = "R1"
	@Language       = @EN @Endlang
	@ABANNER        = "       AutoCAD Designer       "
	@SUBDIR         = "\\ACAD"
	@BATCHFILE	= "ACADR12.BAT"
	@OUTDRIVE       = C
	@GROUP          = "U"
	@Requires         @HardDisk
	@UPDATE         = (0)    /* Bugfix = 1, Regular = 0 */
	/* For updates,  set disk label in @if at end of file */
   @Endif
@EndProject

@If (@FullINST == 0)
@DefineVars
	@Dir            @Subdir2        = "@Subdir\\SUPPORT"    /* SUPPORT directory type */
	@Dir            @Subdir3        = "acdbonus"            /* ACDBONUS directory type */

/* For updates,  set disk label in @if at end of file */

/* Remember to also update the space requirements in the user messages */
	@Integer        @ACDEXE         =  5000000
	@Integer        @ACDXTRA        =  1500000
	@Integer        @Temp           =        0
	@Integer        @Free           =        0
	@Integer        @International  =        0

	@Integer        @SKIP_FILES     =        0
@EndVars

@WELCOME
	@CLS
@if (@Language == @EN)
	@DATXMSG(1, "This program will install the ENGLISH version of Designer")
	@DATXMSG(2, "on your computer.")
@endif


  @pause
    @If (@CPU < 386)
	@DATXMSG(3, "Designer requires an 80386 or 80486 CPU.")
	@DATXMSG(4, "Your computer is running on a 80@CPU CPU.")


	@Pause
    @Endif

     @If ((@OSMajor * 100 + @OSMinor) < 330)
	@DATXMSG(5, "Designer requires DOS version 3.30 or higher.")

	@Pause
     @Endif

	@CLS

	@DATXMSG(6,"This program will install AutoCAD Designer on your computer system")
	@DATXMSG(7,"and checks the distribution disks for errors.")

	@DATXMSG(8,"You must specify the drive and directory where AutoCAD was installed.")
	@DATXMSG(9,"Designer requires either AutoCAD R12c2 or R12AS and will not run with")
	@DATXMSG(10,"an earlier version.  If you have not yet installed AutoCAD, hit escape")
	@DATXMSG(11,"now and install AutoCAD before proceeding.")


	@PAUSE
	@cls

	@DATXMSG(12,"Each screen of this program offers a choice and a default response.")
	@DATXMSG(13,"Press the RETURN key to accept the default.  Otherwise, type or ")
	@DATXMSG(14,"select another response and then press the RETURN key.")

	@DATXMSG(15,"If you make a mistake while typing, press the BACKSPACE key and")
	@DATXMSG(16,"retype the entry.")

	@DATXMSG(17,"You can press the ESC key at any time to cancel the installation")
	@DATXMSG(18,"and return to the operating system.")



	@PAUSE
@EndWelcome

@IF (@update == 1)
    @SetGroup(A)    /* Install all files on Updates */
@Else

SELECTDESIGNER:
   @Getgroups
	@CheckBox
	@DATXMSG(19,"Here you select the parts of Designer you want to install.")







	@SET U = "@DATXMSG(20,"Install all Designer files              ( 6500000 bytes)")"
	@SET P = "@DATXMSG(21,"Designer Executables/Support files      ( 5000000 bytes)")"
	@SET X = "@DATXMSG(22,"Designer Tutorials/Samples/Bonus files  ( 1500000 bytes)")"

	@DATXMSG(23,"Use the up and down cursor keys to scroll through the list.")
	@DATXMSG(24,"The SPACE_BAR key is used to toggle the YES/NO state of the")
	@DATXMSG(25,"current selection.  Press the RETURN key to accept the selection(s).")

	@DATXMSG(26,"Press the ESC key to abort.")
    @EndGroups

    @Display
	@Cls
	@If ('U' [= @Group || 'P' [= @Group || 'X' [= @Group || 'T' [= @Group)


	@DATXMSG(27,"SELECTED FOR INSTALLATION:")

	@If ('U' [= @Group)    @DATXMSG(28,"Install all Designer files.")             @EndIf
	@If ('P' [= @Group)    @DATXMSG(29,"Designer Executables/Support files.")     @EndIf
	@If ('X' [= @Group)    @DATXMSG(30,"Designer Tutorials/Samples/Bonus files.") @EndIf
	@If ('T' [= @Group)    "  No Files to Install - just testing script!"	      @EndIf

	@Pause
	@IF ('U' [= @GROUP)
	    @SETGROUP(P)
	    @SETGROUP(X)
	@Endif
	@ELSE
	@DATXMSG(31,"No Designer files were selected for installation.  If you do not")
	@DATXMSG(32,"want to install Designer at this time, press the ESC key to abort.")


	   @Pause
	   @GOTO SELECTDESIGNER
	@Endif
    @EndDisplay

	/* Compute amount of disk space needed to install selected files */
    @If ('P' [= @Group)
	@Equal(@FREE = @ACDEXE)
    @Endif

    @If ('X' [= @Group)
	@Equal(@TEMP = @ACDXTRA + @FREE)
	@Equal(@FREE = @TEMP)
    @Endif
@Endif /* Not an update */

SelectDrv:
@GetOutDrive
	@Suppress A      /* don't display A: */
	@Suppress B      /* or B:            */
	@CLS
	@DATXMSG(33,"On which disk drive do you want to install the selected files?")
















	@DATXMSG(34,"Use the up and down cursor keys to scroll through the")
	@DATXMSG(35,"list of disk drives.  Press the RETURN key when you have ")
	@DATXMSG(36,"selected a drive.")

@EndOutDrive

@If (@WriteDisk @OutDrive == 1)  /* Is selected drive writeable? */
       @GetOption

	@DATXMSG(37,"The selected output disk drive is read only.")
	@DATXMSG(38,"Do you want to select another drive?")
       @LocalWindow(12,40)
	     @Option  20 = "@DATXMSG(39,"Abort Install")"
	     @option  21 = "@DATXMSG(40,"Select another drive")"
       @EndOption

   @If(21 [= @Option)
	 @ClearOption(21)
	 @GoTO SelectDRV
   @Else
	 @Abort
   @Endif
@EndIf

@If (@update == 0)   /* Can't check space avaiable on updates */

   @If (@DiskFree  @OutDrive < @FREE)
	   @GetOption

	@DATXMSG(41,"The selected output disk drive only has @DiskFree @OutDrive bytes free.")
	@DATXMSG(42,"To install the files you have selected, @FREE bytes are ")
	@DATXMSG(43,"required.")

	@DATXMSG(44,"Do you want to install on this drive anyway or select another drive?")
	   @LocalWindow(12,40)
		 @Option  10 = "@DATXMSG(45,"Continue")"
		 @option  11 = "@DATXMSG(46,"Select another drive")"
	   @EndOption
   @EndIf

   @If(11 [= @Option)
	 @ClearOption(11)
	 @GoTO SelectDRV
   @Endif
@Endif

Selectsubdir:
@GetSubdir
	@CLS

	@DATXMSG(47,"Here you specify the name of the directory where the selected files")
	@DATXMSG(48,"will be installed.  By default, the name of this directory is:")
	      @SUBDIR.

	@DATXMSG(49,"Designer requires the AutoCAD application and unless AutoCAD was")
	@DATXMSG(50,"previously installed on a different disk drive, or under a")
	@DATXMSG(51,"different root directory, choose the default by pressing the")
	@DATXMSG(52,"RETURN key.")

	@DATXMSG(53,"To change the directory name, backspace over the directory name")
	@DATXMSG(54,"and type a new name.  Press the RETURN key when you have finished")
	@DATXMSG(55,"typing the name.")

	@PROMPT = "@DATXMSG(56," Which subdirectory ? ")"
@EndSubdir


@If ('P' [= @Group || 'T' [= @Group)  /* Need SUPPORT */
@GetSubdir @Subdir2
	@Default = "@Subdir\\SUPPORT\\"
	@CLS

	@DATXMSG(57,"Here you specify the name of the directory where Designer")
	@DATXMSG(58,"support files will be installed.  By default, the name of")
	@DATXMSG(59,"this directory is:")
	      @SUBDIR2

	@DATXMSG(60,"The program locates it below the root directory of the disk")
	@DATXMSG(61,"drive you selected.  If you have no preference, choose the")
	@DATXMSG(62,"default by pressing the RETURN key.")

	@DATXMSG(63,"To change the directory name, backspace over the directory name")
	@DATXMSG(64,"and type a new name.  Press the RETURN key when you have finished")
	@DATXMSG(65,"typing the name.")

	@PROMPT = "@DATXMSG(66," Support files subdirectory ? ")"
@EndSubdir

@Endif /* Support directory needed */
@ENDIF /* Not Full Install */


@IF ( @Exists "@OutDrive:@SubDir2\\ACAD.HLP"    ||
      @Exists "@OutDrive:@SubDir2\\ACAD.MNU"    ||
      @Exists "@OutDrive:@SubDir2\\ACADR12.LSP" )
	@GetOption
	@DATXMSG(67,"The Designer installation program has detected the existance of the")
	@DATXMSG(68,"following files in:  ") @OutDrive:@SubDir2
	@IF ( @Exists "@OutDrive:@SubDir2\\ACAD.HLP"   )        ACAD.HLP        @Endif
	@IF ( @Exists "@OutDrive:@SubDir2\\ACAD.MNU"   )        ACAD.MNU        @Endif
	@IF ( @Exists "@OutDrive:@SubDir2\\ACADR12.LSP")        ACADR12.LSP     @Endif

	@DATXMSG(69,"This installation program needs to append information to the bottom")
	@DATXMSG(70,"of these files to enable automatic loading of the Designer application")
	@DATXMSG(71,"at the time AutoCAD is launched.")

	@DATXMSG(72,"If you select the 'Manually update' option below, you will need to")
	@DATXMSG(73,"explicitly load the Designer application before attempting to ")
	@DATXMSG(74,"access any of the Designer commands, or append the information to")
	@DATXMSG(75,"these files yourself at a later time.  For more information on")
	@DATXMSG(76,"appending see the Designer Installation Guide - Loading Designer.")

	@DATXMSG(77,"It is recommended that you append the information at this time.")

	@LocalWindow(20,38)


	   @Option 114 = "@DATXMSG(78,"Automatically append")"
	   @Option 115 = "@DATXMSG(79,"  Manually update   ")"
	@EndOption
@Endif


@If ('T' [= @Group)
	@Goto FINISHBLOCK
@Endif

	/* Designer Disk 1 - EXECUTABLES */
@DefineDisk
       @LABEL = "ADESIGN 1"
       @File    ADESIGN1.MID             @Group APX @Out ADESIGN.MID
       @File    README.ACD               @Group APX @Out README.ACD
       @File    ADESIGN.PT1      @Packed @Group AP  @Out ADESIGN.EXP
@EndDisk


	/* Designer Disk 2 - EXECUTABLES / SAMPLES / TUTORIALS  */
@DefineDisk
       @LABEL = "ADESIGN 2"
       @File    ADESIGN2.MID             @Group APX @Out      ADESIGN.MID
       @File    ADESIGN.PT2      @Packed @Group AP  @AppendTo ADESIGN.EXP

      @BeginLib TUTORIAL.LIB
	  @File   LESSON1.DWG    @Packed @Group AX  @Out TUTORIAL\\*.*
	  @File   LESSON2.DWG    @Packed @Group AX  @Out TUTORIAL\\*.*
	  @File   LESSON3.DWG    @Packed @Group AX  @Out TUTORIAL\\*.*
	  @File   LESSON4.DWG    @Packed @Group AX  @Out TUTORIAL\\*.*
	  @File   LESSON4.SLD    @Packed @Group AX  @Out TUTORIAL\\*.*
      @EndLib
@EndDisk


	/* ADESIGN Disk 3 - SUPPORT */
@DefineDisk
       @LABEL =  "ADESIGN 3"
       @File     ADESIGN3.MID            @Group AX  @Out ADESIGN.MID

       @BeginLib SUPPORT.LIB
	  @File   ACDLOAD.LSP    @Packed @Group AP  @Out \\@Subdir2\\*.*
	  @File   ADASFCNV.DCL   @Packed @Group AP  @Out \\@Subdir2\\*.*
	  @File   ADHATCH.DCL    @Packed @Group AP  @Out \\@Subdir2\\*.*
	  @File   ADESIGN.DCL    @Packed @Group AP  @Out \\@Subdir2\\*.*
	  @File   ADESIGN.DWG    @Packed @Group AP  @Out \\@Subdir2\\*.*
	  @File   ADESIGN.HLP    @Packed @Group AP  @Out \\@Subdir2\\*.*
	  @File   ADESIGN.LSP    @Packed @Group AP  @Out \\@Subdir2\\*.*
	  @File   ADESIGN.MNL    @Packed @Group AP  @Out \\@Subdir2\\*.*
	  @File   ADESIGN.MNU    @Packed @Group AP  @Out \\@Subdir2\\*.*
	  @File   ADESIGN.MSG    @Packed @Group AP  @Out \\@Subdir2\\*.*
	  @File   ADESIGN.PGP    @Packed @Group AP  @Out \\@Subdir2\\*.*
	  @File   ADESIGN.SLB    @Packed @Group AP  @Out \\@Subdir2\\*.*
	  @File   ADISO.DWG      @Packed @Group AP  @Out \\@Subdir2\\*.*

	  @IF (114 [= @Option)          /*  APPEND to existing files - See Finish block  */
		/*  create the ACAD.MNU file in Finish block  */
	      @File   ADESIGN.HLP    @Packed @Group AP  @AppendTo \\@Subdir2\\ACAD.HLP
	      @File   ACDR12.LSP     @Packed @Group AP  @AppendTo \\@Subdir2\\ACADR12.LSP
	  @ElseIf (115 [= @Option)      /*  MANUALLY update file, source files installed below  */
	  @Else                         /*  Files NOT found, create them now  */
	      @File   ACD_ONLY.MNU   @Packed @Group AP  @OUT      \\@Subdir2\\ACAD.MNU
	      @File   ACAD.MNU       @Packed @Group AP  @AppendTo \\@Subdir2\\ACAD.MNU

	      @File   ACAD.HLP       @Packed @Group AP  @OUT      \\@Subdir2\\ACAD.HLP
	      @File   ADESIGN.HLP    @Packed @Group AP  @AppendTo \\@Subdir2\\ACAD.HLP
	      @File   ACAD.MNL       @Packed @Group AP  @OUT      \\@Subdir2\\ACAD.MNL
	      @File   ACADR12.LSP    @Packed @Group AP  @OUT      \\@Subdir2\\ACADR12.LSP
	      @File   ACDR12.LSP     @Packed @Group AP  @AppendTo \\@Subdir2\\ACADR12.LSP
	  @Endif  /*  SKIP_FILES  */
 
	  @File   ACADUS.LIN     @Packed @Group AP  @Out 	  \\@Subdir2\\ACADUS.LIN
	  @File   ACD_API.DOC    @Packed @Group AP  @Out 	  \\@Subdir2\\ACD_API.DOC
	  @File   ADBONUS1.LSP   @Packed @Group AP  @Out	  \\@Subdir2\\ADBONUS1.LSP
	  @File   ADBONUS2.LSP   @Packed @Group AP  @Out	  \\@Subdir2\\ADBONUS2.LSP
	  @File   AD_AS_AV.BAT   @Packed @Group AP  @Out 	  \\@Subdir2\\AD_AS_AV.BAT
	  @File   UPDMNU.EXE     @Packed @Group AP  @Out 	  \\@Subdir2\\UPDMNU.EXE

		/*  Install the Designer support source file  */
	  @File   ACDR12.LSP       @Packed @Group AP  @OUT \\@Subdir2\\source\\*.*
	  @File   ACD_ONLY.MNU     @Packed @Group AP  @OUT \\@Subdir2\\source\\*.*
	  @File   ADESIGN.MNC      @Packed @Group AP  @OUT \\@Subdir2\\source\\*.*
	  @File   ADESIGN.MND      @Packed @Group AP  @OUT \\@Subdir2\\source\\*.*
      @EndLib
@EndDisk


FINISHBLOCK:

@Finish
	@ChDrive @OutDrive
	@ChDir "@Subdir"
	@Cls

	AutoCAD Designer has been successfully installed on your hard drive.

	@IF ( "@Subdir" != "\\ACAD" && @Exists "@OutDrive:@SubDir\\ACAD.EXE" == @False  &&
	      @Exists "@OutDrive:@SubDir\\ACADR12.BAT" == @False )
	    However, Designer appears to have been installed in a location
	    other than where AutoCAD exists.  The 'ACAD' environment var-
	    iable must contain the following path information:
	    @IF ( "@Subdir2" == "@Subdir" )
		set ACAD=@OutDrive:@SubDir; ...original
	    @Else
		set ACAD=@OutDrive:@SubDir;@OutDrive:@SubDir2; ...original
	    @Endif
	    Where '...original' is the path information that is currently
	    set to the 'ACAD' environment variable.

	    You will need to update your ACADR12.BAT file, or whatever
	    you use to set the 'ACAD' environment variable, before run-
	    ning AutoCAD in order for Designer to autoload at startup.
	@Pause
	@Cls
	@EndIf
            /*  Auto APPEND Option - Create the new ACAD.MNU file  */
	@IF (114 [= @Option)	@ChDir "@Subdir2"
	    ***  NOTE  ***

	    In order to preserve the ability to load your previous
	    menu configuration, in particular, what was defined for
	    the 9th menu location, your current ACAD.MNU file is being
	    renamed to P9-SAVE.MNU.
		    @Copy("ACAD.MNU","P9-SAVE.MNU")   @Copy("SOURCE\\ACD_ONLY.MNU","ACAD.MNU")   @System "type P9-SAVE.MNU >> ACAD.MNU"
		@IF ( @Exists "@OutDrive:@SubDir2\\ASURF.MNU" )
	    Also, this installation program has detected the AutoSurf
	    menu file (ASURF.MNU).  For Designer and AutoSurf compatible
	    autoloading, the Designer menu definition will be prepended
	    to this file.  As a result of limited menubar space avail-
	    ability, the 'AutoSurf' menu button label will be replaced
	    with 'ASurf'.
	    	   @System "updmnu ASURF.MNU 0"
		@EndIF

	@Pause
	@Cls
	@ElseIF (115 [= @Option)
	    ***  REMINDER  ***

	    You elected to 'Manually' update your AutoCAD ACAD.MNU,
	    ACAD.HLP and ACADR12.LSP files.  The source files for
	    the Designer product that will need to be edited into
	    the AutoCAD files, are located in:
		 @OutDrive:@SubDir2\SOURCE
	    
	    See the AutoCAD Designer Installation Guide for infor-
	    mation on how to update the necessary support files.

	@Pause
	@Cls
	@EndIF


	AutoCAD Designer installation is now complete, enjoy your new
	system, see the README.ACD file for any last minute information
	that did not make the printed documentation.

    @Pause
@EndFinish
