@DefineProject
    @Name = "Professional Write"
    @Version = "3.0"
    @OutDrive = C
    @Requires @HardDisk
    @Subdir = "\\PW3"
    @Label = "Professional Write Disk 1"
@EndProject

/* the next option is for diskette sizes */
@SetOption 720

/* make sure we have DOS 3.1 or higher */
@If ((@OsMajor < 3) || ((@OsMajor == 3) && (@OsMinor < 1)))
     @Display
        @TopLine = "Press Enter to return to DOS."
        @Message = "@Name @Version requires DOS version 3.1 or higher."
        @Abort
     @EndDisplay
@EndIf

@Display
   @TopLine = "Press Enter to continue"
   @Message = "                                             "
              "            @Name @Version    "
              "                                             "
              "                                             "
              "Welcome to Install.  Use this program to     "
              "install all files needed to run Professional "
              "Write.  The disk space required is 3.5 MB.   "
              "                                             "
              "If any problem messages appear while you're  "
              "installing, see your User's Guide.           "
@EndDisplay

/* Top-level repeat loop.  This loop allows the user to  */
/*  specify the drive and the path for the installation. */
@Repeat
   @ClearOption 1-300

   /* First get drive to install files to. */
   @GetOutDrive
      @EscapeBack
      @Title = "@Name @Version Install"
      @TopLine = " , Press Enter to continue"
      @Suppress A               /* don't display A: */
      @Suppress B               /* or B: */
      @Cls















                     Use the arrow keys to select the drive 
                     you want to install to, and press Enter. 
   @EndOutDrive

   /* Now get the sub-directory. */
   @GetSubDir
      @EscapeBack
      @Cls




      @PROMPT = "@Name @Version Install"




             Press Enter to install the files in the \PW3 directory    
             (@Name install creates this directory for you).      

             To enter a different directory, use the Backspace key to
             erase PW3 and enter your own directory name.  If the    
             directory doesn't exist, @Name install creates     
             it for you.                                                
                                                                     
             If you have @Name 2.2 (or earlier) installed 
             on your computer, avoid confusion by installing this    
             version in a separate directory.                        
   @EndSubDir

   @If (@Exists "@OutDrive:@SubDir\\PW3.COM")
        /* Inform the user that we are about to write over */
        /*  their current version of PW.                   */
        @GetOption
        @Cls















         You already have a version of @Name 3.0 (or later)
         installed in this directory.  Use the arrow keys to select
         either "Yes" or "No".  Choose "Yes" to install over the
         existing version.  Choose "No" to specify a new drive and 
         subdirectory.                                       
            @ClearOption 201-202
            @TopLine = " , Press Enter to continue"
            @Title = "Install over existing version?"
            @Option 201 = "Yes"
            @Option 202 = "No"
        @EndOption
   @EndIf

   @If (@Exists "@OutDrive:@SubDir\\PW.COM")
        /* They are trying to overwrite an old PW version. */
        @If (@DiskFree @OutDrive < 2508092)
            /* Not enough space for an upgrade. */
            @SetOption 99
        @Else
            /* Inform the user that we are about to write over */
            /*  their current version of PW.                   */
            @GetOption
            @Cls















         You already have a version of @Name 2.2 (or earlier)
         installed in this directory.  Use the arrow keys to select
         either "Yes" or "No".  Choose "Yes" to install over the
         existing version.  Choose "No" to specify a new drive and 
         subdirectory.                                       
                @ClearOption 201-202
                @TopLine = " , Press Enter to continue"
                @Title = "Install over existing version?"
                @Option 201 = "Yes"
                @Option 202 = "No"
            @EndOption

            /* Delete the previous PW files. */
            /*
            @If (201 [= @Option)
                @System "DEL @Outdrive:\\@SubDir\\HG3*.OVL >nul"
            @EndIf
            */
        @EndIf
   @Else
        /*  New install                                   */
        @If (@DiskFree @OutDrive < 3500000)
            /* Not enough space for entire product. */
            @SetOption 99
        @EndIf
   @EndIf

   @If (99 [= @Option)
        /* Not enough disk space for the install so inform the user. */
        @GetOption
        @Cls














                   There is not enough space on drive @OutDrive: to
                   install the files.  Do you want to select
                   a different drive, or return to DOS?
        @ClearOption 211-212
        @Option 211 = "Select a different drive"
        @Option 212 = "Return To DOS"
        @EndOption
   @EndIf

   @If (202 [= @Option || 211 [= @Option)  /* try again */
   @ElseIf (212 [= @Option)
        /* The user wants to exit. */
        @ExitRepeat
   @Else
        /* do the file decompressing */
        @DefineDisk
            @Label = "Professional Write Disk 1"

	        @BeginLib PW30_1.720
               @File BX000011.SPD
               @File BX000100.SPD
               @File BX000483.SPD
               @File PW3.FNT
               @File MACDUMP.EXE
               @File MASTER2.SPC
               @File MASTER3.SPC
               @File MASTER5.SPC
               @File MASTER6.SPC
               @File MHG2.EXE
               @File PFMAIN1.OVL
               @File PFMAIN2.OVL
               @File PFMAIN3.OVL
               @File PFMAIN4.OVL
               @File PFMAIN5.OVL
               @File PROWRIT3.ICO
               @File PW3.COM
               @File PW3.INF
               @File PW3.NET
               @File PW3.PRI
               @File PW3.PS
               @File PW3.SCL
               @File PW3.STR
               @File PW3.WPC
               @File PW34.OVL
               @File PW3COUNT.EXE
               @File PW3LOGOC.ASC
               @File PW3LOGOE.PCX
               @File PW3LOGOV.PCX
               @File PW3NETST.EXE
               @File PWP.EXE
               @File SAMPLE.LTR
	        @EndLib
        @EndDisk

        @DefineDisk
           @Label = "Professional Write Disk 2"

	        @BeginLib PW30_2.720
               @File DCA.EXE
               @File LOT.EXE
               @File MASTER4.SPC
               @File PFMAIN.EXE
               @File PW3.HLP
               @File PW3.TAB
               @File PW32.OVL
               @File PW33.OVL
               @File PW35.OVL
	        @EndLib
        @EndDisk

        @DefineDisk
           @Label = "Professional Write Disk 3"

	        @BeginLib PW30_3.720
               @File MASTER1.SPC
               @File MHG1.EXE
               @File PW3.PRG
               @File PW31.OVL
	        @EndLib
        @EndDisk

        @Install
        @EndInstall
        @SetOption 300

        @ExitRepeat
   @EndIf

@EndRepeat /* drive/directory repeat loop */

@If (300 [= @Option)
    /* Inform the user how to invoke PW.   */
    /* Remind them about Help provided with the product. */
    @Welcome
    @TopLine = "Press Enter to return to DOS."
    @Message = "  @Name @Version installation complete."
                "                                                   "
                "To start Professional Write, type PW3 at the DOS   "
                "prompt and press Enter.                            "
                "                                                   "
                "For information on using Professional Write, see   "
                "your User's Guide.                                 "
                "                                                   "
                "For online Help wherever you are in the program,   "
                "press F1. For a list of Help topics, press Ctrl-F1."
    @EndWelcome
@EndIf

@Finish
   @If (300 [= @Option)
      /* Make the drive/directory that contains PW3 the */
      /* current directory.                             */
      @ChDrive @OutDrive
      @ChDir   "@SubDir"
   @EndIf
@EndFinish
