
@DefineProject
    @Name                       = "TRA LexiCAT"         /* Product Textual Name */
    @Version                    = "1.03"
    @Subdir                     = "LEXICAT"             /* this is where files are put */
    @OutDrive                   = C
    @Group                      = "A"
    @Verify                                             /* this turns on CRC verification */
@EndProject

@DefineVars
    @QString@RunMe              = "LEXICAT.HLP"
    @QString@RunREADME          = "NOTEPAD.EXE @OutDrive:\\@SubDir\\README.1ST"
    @QString@Iconname           = "TRA LexiCAT"
    @QString@READMEIcon         = "TRA LexiCAT README 1st"
    @QString@Helpexe            = "WINHELP.EXE"
    @QString@NotepadExe         = "NOTEPAD.EXE"
    @Qstring @UserName          = ""
   @Qstring @Company            = ""
   @Qstring @UserAgree          = ""
   @Integer @Red                = @RGB(255,0,0)
   @Integer @Green              = @RGB(0,255,0)
   @Integer @Blue               = @RGB(0,0,255)
   @Integer @Black              = @RGB(0,0,1)
   @Integer @TRAHI              = @RGB(0,0,1)
   @Integer @TRALO              = @RGB(0,255,255)
@EndVars

@BackgroundMode(3,@TRAHI,@TRALO)

@Display

    @Cls
    This program will install @Name Version @Version on your
    computer system and verify the integrity of the distribution
    disk(s). You may press the [Esc] key or Cancel button at any
    time to abort the installation. wInstall will ask you several
    questions about your installation preferences before 
    installation begins.

    Each question has a default answer.  If the default answer is
    correct, press the ENTER key or OK button in response to the
    question. Otherwise, type the answer and then press the ENTER key
    or OK button.

    If you make a mistake while typing, press the BACKSPACE key
    and then retype the answer.

    IMPORTANT! Please make sure your @Name floppy disk is not write  
    protected before continuing!!                                        

    @Prompt="Welcome to TRA LexiCAT Install!"  

    @TitlePause                               

@EndDisplay

/* @ProgramManager("[DeleteGroup(@name)]") */

@Write("@StartUpDrive:\\check.txt","wt","undeeded file - delete me\n")
@Delete("@StartUpDrive:\\check.txt")

DRIVE:
@GetOutDrive
   @Suppress(0,1)  // suppress removeable (floppies) from drive list
   @Suppress(0,4)  // suppress network drives
   @Suppress(0,16) // suppress CD-ROM drives
   @Cls
   On which drive do you wish to install @Name?

@EndOutDrive

@If(@DiskFree(@OutDrive) < 3000000)
  @Display
    That disk only has @DiskFree(@OutDrive) bytes
    free. @Name requires 3,000K free disk space.
    Please select another drive.
    
    @Prompt="Not Enough Space to Install!"
    @TitlePause
  @EndDisplay
  @Goto DRIVE
@endif


@GetSubdir
   @Cls
    Now you need to specify the disk destination directory.
    The directory is the location on your disk where the @Name
    system will be installed.  If you don't know what a
    "directory" is, you probably need not worry about it -
    just press the ENTER key to accept the default path.

    @Prompt = "Select directory -> [Enter] = @Subdir "  
   
@EndSubdir

@if (@Exists("@OutDrive:\\@SubDir\\LEXICAT.HLP"))
  
  @Display
  
    @Name is already installed on your computer!
    Do you wish to overwrite with LexiCAT version @Version?

    @Prompt="@Name is already installed!"
    @TitlePause
  @EndDisplay

@endif

/**************************************************************/

DOIAGREE:
@GetString @UserAgree
  If you agree to ALL the terms of the enclosed TRA LexiCAT
  license agreement, please type AGREE and press OK to
  continue the installation.

  If you do NOT accept ALL the License terms, please type NO
  and press OK to stop the installation. You may return the 
  software as stated in the License agreement or start the 
  installation process again.

  To see the license terms onscreen, please type VIEW to 
  bring up the license in Windows NOTEPAD.

  Type AGREE, VIEW, or NO
@LocalWindow(15,1) 
@Prompt = "Type AGREE, VIEW, or NO"
@EndString

@IF ("VIEW"=="@UserAgree")
  @Goto IWANNAVIEW
@EndIf

@IF ("NO"=="@UserAgree")
  @Goto CHECKAGREE
@EndIf

@If ((@strLen("@UserAgree")>0) && ("AGREE" != "@UserAgree") && ("VIEW" != "@UserAgree"))
  @Display
   You typed @Useragree.
   Please type AGREE, VIEW, or NO at the prompt,
   or select the CANCEL button
   @pause
  @EndDisplay
  @Goto DOIAGREE
@EndIf

@Goto KEEPGOING

IWANNAVIEW:
@WinExec("@WindowsDrive:@WindowsDir\\NOTEPAD.EXE @StartUpDrive:\\license.DOC",3,-1)  
@Goto DOIAGREE

CHECKAGREE:
@If ("AGREE" == "@UserAgree")
  /* OK! we can install! */
@Else
  @ProgramManager("[DeleteGroupGroup(@Name,2)]")  
  @Display
    You did not agree to the License terms.

    If you choose to return the software for a refund,
    please mail the entire package, contents, and
    a copy of your receipt to..

      Telecommunications Research Associates
      505 Bertrand
      Saint Marys, KS  66536-0016
      Telephone (913) 437-3300

    LexiCAT install will now Exit. No files were installed.
    @pause
  @EndDisplay
  @Exit
@Endif

KEEPGOING:

@FileAttr("@OutDrive:\\@SubDir\\license.txt","R-S-H-")
@Delete("@OutDrive:\\@SubDir\\license.txt")

@Display
@Cls
   Now you will be asked for information
   needed to personalize this installation..
   @Pause
@EndDisplay
      
MYNAME:
@GetString @UserName
  Please enter your full name (required).
  @Prompt = "What is your full name?"
@EndString

@if (@StrLen("@userName")<2)
  @Display
    Your Full name is required!
    @Pause
  @EndDisplay
  @Goto MYNAME
@EndIf

MYCOMPANY:
@GetString @Company
  Please enter your company name or NA if not applicable.
  @Prompt = "What is your Company Name?"
@EndString
@if (@StrLen("@COMPANY")<2)
  @Display
    Your COMPANY name is required!
    Enter NA if you are not registering a company purchase.
    @Pause
  @EndDisplay
  @Goto MYCOMPANY
@EndIf

/**************************************************************/

@DefineDisk
	@Label = "Disk #1"
		@F CAT.ICO @O @OutDrive:\\@SubDir\\CAT.ICO
		@F README.1ST @O @OutDrive:\\@SubDir\\README.1ST
	@BeginLib LEXICAT.001
		@F LEXICAT.HLP @O @OutDrive:\\@SubDir\\LEXICAT.HLP
	@EndLib
@EndDisk


@DefineDisk
	@Label = "Disk #2"
	@BeginLib LEXICAT.002
		@F LEXICAT.HLP @O @OutDrive:\\@SubDir\\LEXICAT.HLP
	@EndLib
@EndDisk


@Finish

   @ProgramManager("[DeleteGroup(@name)]")  
   
   
   @if (@Exists("@StartUpDrive:\\INFO.TXT"))
     @FileAttr("@StartUpDrive:\\info.txt","R-H-S-")
     @Write("@StartUpDrive:\\info.txt","at","\n\nName:@UserName responded @UserAgree to license terms\n")
   @Else
     @Write("@StartUpDrive:\\info.txt","wt","\n\nName:@UserName responded @UserAgree to license terms\n")
   @endif

   @Write("@StartUpDrive:\\info.txt","at","Company:@Company\n")
   @Write("@StartUpDrive:\\info.txt","at","@Name is the software being ")
   @Write("@StartUpDrive:\\info.txt","at","installed onto this 80@CPU system on: @DateToStr(@SystemDate()).\n")
   @FileAttr("@StartUpDrive:\\info.txt","R+H+S+")
   
   IF (@programmanager("[creategroup(@name)][Additem(@OutDrive:\\@SubDir\\@RunMe,@IconName,@OutDrive:\\@SubDir\\CAT.ICO)][Additem(@WindowsDrive:@WindowsDir\\@RunREADME,@READMEIcon,@NotepadExe)][ShowGroup(@name,6)]")) @endif 

   @Cls
   
   You now have a LexiCAT Program Group and Icon!
   
   The LexiCAT install process is Finished!

   Press ENTER to exit the install process.

   @Pause
   
   @WinExec("WINHELP.EXE @OutDrive:\\@SubDir\\@RunMe",3,0)  

   @Exit

@EndFinish

/* end-of-file */
