/* __________ DEFINE PROJECT __________ */

@DefineProject                      
    @Name       = "MASTERCAM"
    @Version    = "5.5"      
    @Subdir     = "\\MILL55"  
    @OutDrive   = C          
    @Immediate  = @TRUE      
    @InDiskBell = @TRUE      
    @Requires @HardDisk
@EndProject                         

/* __________ INITIALIZE VARIABLES __________ */

@DefineVars
    @Qstring @CGroup  = ""
    @Qstring @AItemH  = ""
    @Integer @Blue    = @RGB(0,0,255) //DEFINE COLOR BLUE
    @Integer @Black   = @RGB(0,0,0)   //DEFINE COLOR BLACK
    @Integer @TempInt = -1
@EndVars

/* __________ SAY HELLO __________ */

@BackgroundMode(3,@Blue,@Black)
@Display
    @Cls
    This program will install TOOLMAKER version @Version on your computer.
    You may press the [Esc] key at any time to abort the installation.

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

    If you make a mistake while typing, press the [BACKSPACE] key
    and then retype the answer.
    @Pause
@EndDisplay

/* __________ GET DRIVE __________ */

NEWDRIVE:                                   // re-select drive if needed
@GetOutDrive
    @Cls
    Select drive on which MASTERCAM was installed ...
    @DlgCtrlSize(0,3,2,8,30)
    @Suppress(0,17)
@EndOutDrive

/* __________ GET DIRECTORY __________ */

NEWDIR:
@GetSubdir
    @Cls
    Specify MASTERCAM main directory ...
    @DlgCtrlSize(0,3,2,4,30)
@EndSubdir

/* __________ REMOVE DRIVE - IF ENTERED __________ */


@TempInt = @StrFind ("@SubDir", ":")
@If (@TempInt >= 0)
    @SubDir = "@StrDel ("@SubDir", 0, (@TempInt+1))"
@EndIf

/* __________ REMOVE PERIOD - IF ENTERED __________ */

@TempInt = @StrFind ("@SubDir", ".")
@If (@TempInt >= 0)
    @Display
        MASTERCAM products do not support
        directories which contain periods.

        Please select another directory.
        @Pause
    @EndDisplay
    @GOTO NEWDIR
@EndIf

/* __________ CHECK MILL5 INSTALLED __________ */

@If (!@Exists "@Outdrive:\\@Subdir\\MILL55.TXT")
    @Display
        MASTERCAM MILL version 5.5 not found!

        Please select another drive.
        @Pause
    @EndDisplay
    @GOTO NEWDRIVE
@EndIf

/* __________ APPLICATION DISK #1 __________ */

@If (5000 [= @OPTION)
    @LocSuffix = "\\DISK1"
    @ChDir ("@LocPrefix@LocMiddle@LocSuffix")
    @Chain ("Disk #1", "DISK1.DAT")
@Else
    @Chain ("Disk #1", "@InDrive:\\disk1.dat")
@EndIf

/* __________ APPLICATION DISK #2 __________ */

@If (5000 [= @OPTION)
    @LocSuffix = "\\DISK2"
    @ChDir ("@LocPrefix@LocMiddle@LocSuffix")
    @Chain ("Disk #2", "DISK2.DAT")
@Else
    @Chain ("Disk #2", "@InDrive:\\disk2.dat")
@EndIf

/* __________ ADD HELP ITEM __________ */

@CGroup = "[CreateGroup(Mastercam)]"
@AItemH = "[AddItem(WINHELP TOOLMKR.HLP,ToolMaker User Guide,,,,,@Outdrive:\\@Subdir)]"
@ProgramManager("@CGroup@AItemH")

/* __________ RETURN TO STARTUP DIRECTORY __________ */

@If (5000 [= @OPTION)
    @ChDrive (@StartupDrive)
    @ChDir ("@StartupDir")
@Endif

/* __________ INSTALLATION COMPLETE __________ */

@Finish
    @Cls
    TOOLMAKER installation complete ...
    @Pause
@EndFinish
