/* Installation for IBM OrCAD/Install */

@DefineProject
    @Name       = "OrCAD/Install"
    @Version    = "V1.30"
    @InDrive    = A
    @OutDrive   = C
    @SubDir     = "\\ORCADESP\\"
@EndProject

@DefineVars
    @Dir @ORCADPROJ = "\\ORCAD"
    @Dir @ORCADEXE = "\\ORCADEXE"
    @Dir @ORCADESP = "\\ORCADESP"
@EndVars

@If ( (@Exists "@OutDrive:@ORCADEXE\\SDT_C.EXE"
||     @Exists "@OutDrive:@ORCADEXE\\VST_C.EXE"
||     @Exists "@OutDrive:@ORCADEXE\\PLD_C.EXE"
||     @Exists "@OutDrive:@ORCADEXE\\PCB_C.EXE")
&&   ( @Exists "@OutDrive:@ORCADEXE\\ORINSTAL.EXE") )
    @DefineVars
        @Integer @ProductFlag = 1
    @EndVars
@Else 
    @DefineVars
        @Integer @ProductFlag = 0
    @EndVars
@EndIf

@If (@ProductFlag == 0)
    @GetOption
        @CheckBox
        @Cls
             Select one or more tool sets to install onto your system.
                               OrCAD TOOL SETS











        The SPACE BAR toggles the selection between yes and no. 
        The arrow keys and PGUP/PGDN keys move the selection up and down.
        'Y' sets all entries to YES, 'N' sets all to NO.
        Press <ENTER> when you have finished selecting.
        @Option 10 = "     OrCAD ESP Design Environment    "
        @Option 11 = "     OrCAD Schematic Design Tools    "
        @Option 12 = "    OrCAD Digital Simulation Tools   "
        @Option 13 = "      OrCAD PC Board Layout Tools    "
        @Option 14 = "OrCAD Programmable Logic Design Tools"
        @Option 15 = "         OrCAD Modeling Tools        "
    @EndOption
@Else
    @GetOption
        @CheckBox
        @Cls
        Select ONE or MORE items to install or update on your system.
                               Available Items











        The SPACE BAR toggles the selection between yes and no. 
        The arrow keys and PGUP/PGDN keys move the selection up and down.
        'Y' sets all entries to YES, 'N' sets all to NO.
        Press <ENTER> when you have finished selecting.
        @Option 16 = "OrCAD Printer, Plotter and Display Drivers   "
        @Option 10 = "       OrCAD ESP Design Environment          "
        @Option 11 = "       OrCAD Schematic Design Tools          "
        @Option 12 = "      OrCAD Digital Simulation Tools         "
        @Option 13 = "        OrCAD PC Board Layout Tools          "
        @Option 14 = "   OrCAD Programmable Logic Device Tools     "
        @Option 15 = "           OrCAD Modeling Tools              "
    @EndOption
@EndIf

@If ( 10 [! @Option
&&    11 [! @Option
&&    12 [! @Option
&&    13 [! @Option        /* If no products were chosen abort install */
&&    14 [! @Option
&&    15 [! @Option
&&    16 [! @Option )

    @Display
        @Cls



    *** ERROR - No installation options were chosen. INSTALL aborting...





        @Abort
    @EndDisplay

@EndIf
 
@GetOption
    @CheckBox
    @Cls
        Do you want to modify ONE or MORE of the following items?
                      CURRENT INSTALLATION PARAMETERS












        The SPACE BAR toggles the selection between yes and no. 
        The arrow keys and PGUP/PGDN keys move the selection up and down.
        'Y' sets all entries to YES, 'N' sets all to NO.
        Press <ENTER> when you have finished selecting.
    @Option 1 = "Change Source Floppy Drive from:           @InDrive: "
    @Option 2 = "Change Target Harddrive from:              @OutDrive:"
    @Option 3 = "Change Main Driver/Library directory from: @ORCADESP "
    @Option 4 = "Change Project directory from:             @ORCADPROJ"
    @Option 5 = "Change Executable program directory from:  @ORCADEXE "
    @Option 6 = "Check and/or modify AUTOEXEC batch file:             "
@EndOption

@If ( 1 [= @Option )
    @GetInDrive
        @CLS

    Which disk drive will contain the floppy disk?
    @EndInDrive
@EndIf

@If ( 2 [= @Option )
    @GetOutDrive
        @CLS

    Where do you want to install the software?
    @EndOutDrive
@EndIf

@If ( 3 [= @Option )
    @GetSubdir @ORCADESP  
    The @ORCADESP directory contains a subdirectory for each of the OrCAD
    tools.  Those subdirectories contain files that are not particular
    to a specific design, but are global in nature like libraries and
    device models.  The default name for this directory is @ORCADESP.
        @Prompt = "What directory for ORCADESP ([Enter] = @ORCADESP) ?"
    @EndSubDir
@EndIf

@If ( 4 [= @Option )
    @GetSubdir @ORCADPROJ
    The @ORCADPROJ directory contains a subdirectory for each design
    that you will be working with.  It will also contain the TEMPLATE
    design directory.  The default name for this directory is @ORCADPROJ 
        @Prompt = "What subdirectory for OrCAD designs ([Enter] = @ORCADPROJ) ?"
    @EndSubDir
@EndIf

@If ( 5 [= @Option )
    @GetSubdir @ORCADEXE
    The @ORCADEXE directory contains the executable files for every OrCAD
    tool you have (or will have) installed.  The default name for this
    directory is @ORCADEXE
        @Prompt = "What subdirectory for ALL OrCAD executables ([Enter] = @ORCADEXE) ?"
    @EndSubDir
@EndIf

@If ( 6 [= @Option )
    @Display
        @Cls
    If your AUTOEXEC.BAT file needs to be updated, this installation
    process can update it for you.  If you choose to update your
    AUTOEXEC.BAT file yourself, this installation will show you 
    what to add to the file.  If you choose to have the installation
    update your AUTOEXEC.BAT file, a backup file AUTOEXEC.BAK will
    be created before any changes are implemented.
        @Pause
    @EndDisplay

    @SetAutoexec
        @AskOverwrite
        @Verbatim "SET ORCADEXE=@OutDrive:@ORCADEXE\\"
        @Verbatim "SET ORCADESP=@OutDrive:@ORCADESP\\"
        @Verbatim "SET ORCADPROJ=@OutDrive:@ORCADPROJ\\"
        @Verbatim "SET ORCADUSER=@OutDrive:@ORCADESP\\"
        @Path "@OutDrive:@ORCADEXE"
    @EndAutoexec
@EndIf

@If ( @Exists "@OutDrive:@ORCADEXE\\SDT_C.EXE"     /* SDT installed */
||    @Exists "@OutDrive:@ORCADEXE\\VST_C.EXE"     /* VST installed */
||    @Exists "@OutDrive:@ORCADEXE\\PLD_C.EXE"     /* PLD installed */
||    @Exists "@OutDrive:@ORCADEXE\\PCB_C.EXE"     /* PCB installed */
||    6 [= @Option                                 /* User selected check */
||    @Exists "@OutDrive:@ORCADEXE\\ORINSTAL.EXE"  /* INSTALL installed */
||   (@ProductFlag == 1) )                         /* Product previously
                                                        found before menu
                                                        choices */

    /*  Do nothing. The AUTOEXEC check has been done or an installation
        was done previously and I'll assume it worked.
    */

@Else
    @Display
        @Cls

    Be sure that the OrCAD environment variables are added to your 
    AUTOEXEC.BAT file. To do this you must have a text editor available.
    A typical set of variables will look as follows:

                   Set ORCADEXE=@OutDrive:@ORCADEXE\\
                   Set ORCADESP=@OutDrive:@ORCADESP\\
                   Set ORCADPROJ=@OutDrive:@ORCADPROJ\\

    To make the variables take effect, reboot your PC.

    Or if you'd prefer, run this installation again and change the
    "Check and/or modify AUTOEXEC batch file" selection to yes.   

        @Pause
    @EndDisplay
@EndIf

@Display
    @Cls
    The items you have selected will be installed onto
    your @OutDrive disk from your @InDrive diskette. @ORCADEXE will
    contain the executable files.  The @ORCADPROJ directory
    is where the design directories will be located.  The
    files that are global in nature (like libraries) will be
    installed in the @ORCADESP directory.  
 
    @If ( 6 [= @Option )
    NOTE:  This install process may update your AUTOEXEC.BAT file 
           You must re-boot your system after the install is completed 
           to make these changes take effect.
    @EndIf



    Type a key to continue or the ESCape key to abort the install.



    @Pause
    
@EndDisplay

@DefineDisk
    @Label = "Install Master Disk"
    @File   INSTALL.DAT @Option 999
@EndDisk

@Finish
    @ChDrive    @InDrive

    @Cls

    @If (10 [= @Option)
        @Install "OrCAD/ESP" "IBM ESP Framework Diskette"
    @EndIf

    @Cls
    @If (11 [= @Option)
        @Install "OrCAD/SDT" "SDT Disk 1"
    @EndIf

    @Cls
    @If (12 [= @Option)
        @Install "OrCAD/VST" "VST Disk 1"
    @EndIf

    @Cls
    @If (13 [= @Option)
        @Install "OrCAD/PCB" "PCB Disk 1"
    @EndIf
    
    @Cls
    @If (14 [= @Option)
        @Install "OrCAD/PLD" "PLD Disk 1"
    @EndIf

    @Cls
    @If (15 [= @Option)
        @Install "OrCAD/MOD" "MOD Disk 1"
    @EndIf

    @Cls
    @If (16 [= @Option)
        @Install "OrCAD/Install" "IBM Install Master Disk"
    @EndIf

    @Cls






                              Installation complete




    @If ( 6 [= @Option )
    NOTE: If this installation updated your AUTOEXEC.BAT file, you must 
          re-boot your machine to make those changes take effect.
    @EndIf


    @Pause

@EndFinish
