

;==ProVector® 3 INSTALLATION SCRIPT - USE WITH INSTALLER TOOL

;=========================TODOOZ========================
;==Special configuration options, ie. video, sign-cutting, etc.
;==A "Relocate" procedure for moving ANYTHING?
;==Check for RexxMast loaded --- done sorta' (?)

;=====================FOR DEBUGGING!==================
;(set @default-dest "RAM:")


;==Disable novice mode.  A Tool Type also blocks this.
;==   Novice is TOO novice. Can not even use (askbool).
(if (= @user-level 0)
    (abort "\n\nSorry, \"Novice\" mode is not supported.  This "
        "would copy over 2.3 megs of files to an arbitrary "
        "location on your hard drive.  We do not feel you "
        "would have found this satisfactory.")
)


;==Set variables for the size of each installation unit,
;==  so I can change them all in one place.
(set pv881-tot 510)
(set pvffp-tot 520)
(set st-tot 279)
(set pref-tot 64)       ;==drivers:
(set ilbm-tot 67)
(set ilbm24-tot 62)
(set ps-tot 93)
(set ai-tot 43)
(set hpgl-tot 41)
(set hpgltile-tot 48)
(set psimp-tot 108)     ;==importers:
(set hpglimp-tot 52)
(set pvt-tot 63)        ;==Two font groups:
(set pvtex-tot 142)
(set pvh-tot 288)       ;==Three help groups:
(set sth-tot 104)
(set rxrqh-tot 19)
(set rexx-tot 148)      ;== Macros (126K) rexxrequest (17K), rexxmathlib.library (8K), PV palettes (8K) and ST filters (5K)
(set dr2d-tot 160)
(set ag-tot 76)         ;==amigaguide not added to prog-tot, since go in SYS:
(set tf-tot 19)         ;==textfield.gadget; likewise textfield.gadget not added

;==Set other vars
(set Compute 0)
(set icon-help (cat "    Configuration information is stored in the icon file.  Even when run "
    "from the command line, ProVector will read this information.  Thus, you should "
    "install the icon, whether you use the Workbench, or not."))

;(debug icon-help)

;==Copyright notices.
(message
    "All files on the disks \"PV1\" and \"PV2\" are Copyright © 1989-95 Stylus, Inc. "
    "except as noted below:\n\n"
    "AmigaGuide, AmigaGuide.info, amigaguide.library, "
    "Installer and Installer.info © Copyright 1991-93 "
    "Commodore-Amiga, Inc.  All Rights Reserved.  "
    "Reproduced and distributed under license.\n\n"
    "AMIGAGUIDE AND INSTALLER SOFTWARE ARE PROVIDED \"AS-IS\" "
    "AND SUBJECT TO CHANGE; NO WARRANTIES ARE MADE.  ALL USE "
    "IS AT YOUR OWN RISK.  NO LIABILITY OR RESPONSIBILITY IS ASSUMED.\n\n"
    "\(continued\)"
)
(message
    "\ntextfield.gadget is © 1994 Mark Thomas\n"
    "All rights reserved.  Used with permission.\n\n"
    "rexxmathlib.library © 1989 Willy Langeveld\n"
    "All rights reserved.  Used with permission.\n\n"
    "Thank you, Willy and Mark!"
)

(complete 0)

;==Is there a math coprocessor?
(set SYSFPU (run "cpu check fpu" (safe)))
(if (= SYSFPU 0)
    (set SYSFPU 1)  ;=="cpu check fpu" RC=0 means FPU=True
    (set SYSFPU 0)  ;=="cpu check fpu" RC=5 means FPU=False
)

;==Store any existing PV assigns
(set pv-save (getassign "PV" "a"))
(set pvd-save (getassign "PV_Drivers" "a"))
(set pvi-save (getassign "PV_Import" "a"))
(set pvt-save (getassign "PV_Type" "a"))
(set pvh-save (getassign "PV_Help" "a"))

; Cleanup on error
(onerror
    (delete "RAM:LHex")
)

; Create the default destination name
(if pv-save
    (set prog-dest pv-save)
; else
    (set prog-dest @default-dest)
)

(set prog-dest
    (askdir
        (prompt "Where should the ProVector® drawer be created?")
        (help @askdir-help)
        (newpath prog-dest)
        (default prog-dest)
    )
)
;== Check for NULL STRING.
(if (= prog-dest "")
    (set prog-dest @default-dest)
)

;==Get this now 'cause getdiskspace() breaks with ~exist dir
;== even though device/volume of path is available.
(set disk-avail (getdiskspace prog-dest))

;==Procedure must be defined before call.
;==WHY DID I DO THIS AS A PROCEDURE? (oh well, it works...)
(procedure MakePV
    (set prog-dest (tackon prog-dest "ProVector"))
    (if (not (exists prog-dest)) (makedir prog-dest (infos)))
    (tooltype (dest prog-dest) (noposition))
)
(if (<> pv-save prog-dest)
    (MakePV)
)
(set @default-dest prog-dest)

;==Set default dest tackon's to variables since used more than once.
(set driv-dflt (tackon prog-dest "PV_Drivers"))
(set imp-dflt (tackon prog-dest "PV_Import"))
(set type-dflt (tackon prog-dest "PV_Type"))
(set help-dflt (tackon prog-dest "PV_Help"))
(set rexx-dflt (tackon prog-dest "REXX"))

;==Compare default dests to any existing user assignment.
(if pvd-save
    (set driv-dest pvd-save)
    ;==else
    (set driv-dest driv-dflt)
)
(if pvd-save
    (set imp-dest pvi-save)
    ;==else
    (set imp-dest imp-dflt)
)
(if pvt-save
    (set type-dest pvt-save)
    ;==else
    (set type-dest type-dflt)
)
(if pvh-save
    (set help-dest pvh-save)
    ;==else
    (set help-dest help-dflt)
)

;==***
(set samp-dest (tackon prog-dest "DR2D_Drawings"))
(set rexx-dest (tackon prog-dest "REXX"))

;==***
(procedure ReAssign
    (set Done 0)
    (while (<> Done 1)
        (if (= space-ok "sufficient.")
            (set space-prompt "However, if you wish, you may")
            (set space-prompt "You should")
        )
        (set new-dest
            (askchoice
                (prompt ("\nSpace on \"%s:\" is %s\n\n%s relocate some of the following files.\n" (getdevice prog-dest) space-ok space-prompt))
                (help   "    If space is insufficient support directories may be moved "
                        "to other devices.  ProVector will then require logical "
                        "device assignments to find them; however, this installation "
                        "script will automatically add them to you 'User-Startup,' "
                        "if you wish.\n\n" @askchoice-help)
                (choices
                    "Relocate output drivers"
                    "Relocate import modules"
                    "Relocate typefaces"
                    "Relocate help files"
                    "Relocate ARexx macros"
                    "Copy files to locations specified above")
                    (default 5)
            ) ;==end askchoice
        ) ;==end set new-dest

        ;==set driver destination
        (if (= new-dest 0)
            (set driv-dest
                (askdir
                    (prompt ("\nWhere should the output drivers be installed?\n" @askdir-help))
                    (help   "   Normally this directory should be in the same directory "
                            "as ProVector.  This option allows you to install it "
                            "elsewhere, and then add an 'Assign' command to your "
                            "'User-Startup' script so ProVector can find the "
                            "directory.\n\n" @askdir-help)
                    (newpath driv-dflt)
                    (default driv-dflt)
                ) ;==end ask driv-dest
            ) ;==end set driv-dest
            ;== Check for NULL STRING.
            (if (= driv-dest "")
                (set driv-dest driv-dflt)
            ) ;==end if NULL STR
        ) ;==end if new-dest=0

        ;==set import destination
        (if (= new-dest 1)
            (set imp-dest
                (askdir
                    (prompt ("\nWhere should the import modules be installed?\n" @askdir-help))
                    (help   "   Normally this directory should be in the same directory "
                            "as ProVector.  This option allows you to install it "
                            "elsewhere, and then add an 'Assign' command to your "
                            "'User-Startup' script so ProVector can find the "
                            "directory.\n\n" @askdir-help)
                    (newpath imp-dflt)
                    (default imp-dflt)
                ) ;==end ask imp-dest
            ) ;==end set imp-dest
            ;== Check for NULL STRING.
            (if (= imp-dest "")
                (set imp-dest imp-dflt)
            ) ;==end if NULL STR
        ) ;==end if new-dest=1

        ;==set typeface destination
        (if (= new-dest 2)
            (set type-dest
                (askdir
                    (prompt ("\nWhere should the ProVector® fonts be installed?\n" @askdir-help))
                    (help   "   Normally this directory should be in the same directory "
                            "as ProVector.  This option allows you to install it "
                            "elsewhere, and then add an 'Assign' command to your "
                            "'User-Startup' script so ProVector can find the "
                            "directory.\n\n" @askdir-help)
                    (newpath type-dflt)
                    (default type-dflt)
                ) ;==end ask type-dest
            ) ;==end set type-dest
            ;== Check for NULL STRING.
            (if (= type-dest "")
                (set type-dest type-dflt)
            ) ;==end if NULL STR
        ) ;==end if new-dest=2

        ;==set help destination
        (if (= new-dest 3)
            (set help-dest
                (askdir
                    (prompt ("\nWhere should the AmigaGuide help files be installed?\n" @askdir-help))
                    (help   "   Normally this directory should be in the same directory "
                            "as ProVector.  This option allows you to install it "
                            "elsewhere, and then add an 'Assign' command to your "
                            "'User-Startup' script so ProVector can find the "
                            "directory.\n\n" @askdir-help)
                    (newpath help-dflt)
                    (default help-dflt)
                ) ;==end ask help-dest
            ) ;==end set help-dest
            ;== Check for NULL STRING.
            (if (= help-dest "")
                (set help-dest help-dflt)
            ) ;==end if NULL STR
        ) ;==end if new-dest=3

        ;==set ARexx destination
        (if (= new-dest 4)
            (set rexx-dest
                (askdir
                    (prompt ("\nWhere should the ARexx macros be installed?\n" @askdir-help))
                    (help   "   Normally this directory should be in the same directory "
                            " as ProVector.  You may also install them in your standard "
                            "'REXX:' logical device \(directory\).\n\n" @askdir-help)
                    (newpath rexx-dflt)
                    (default rexx-dflt)
                ) ;==end ask rexx-dest
            ) ;==end set rexx-dest
            ;== Check for NULL STRING.
            (if (= rexx-dest "")
                (set rexx-dest rexx-dflt)
            ) ;==end if NULL STR
        ) ;==end if new-dest=4

        ;==DO IT!
        (if (= new-dest 5)
            (set Done 1))

    ) ;==end 'ReAssign' while
) ;==end 'ReAssign' procedure


; Default action - perform installation ("Proceed" button selected)
(set what-install 6)
;==These four are mask values
(set prog-install 3)    ;== 3 for both PV & ST; *.881 v. *.FFP is automagic
(set driv-install 127)  ;== ALL drivers
(set imp-install 3) ;== PSImp, HPGLImp
(set misc-install 15)   ;== ALL; 13 to exclude stroke fonts by default
(set samp-install 3)    ;== ALL (Macros and artwork)

(set Done 0)

;== Installation summary?
(message "\nBy default all programs and support files are installed.  "
            "This will require approximately 2.3 Megs of disk space.  "
            "However, many of these files are not required by the "
            "average user.  The next requester will give you options "
            "for selecting only those files you need."
)

(while (<> Done 1)
    (set what-install
        (askchoice
            (prompt "Select 'Proceed' to install default files; or choose an action, then select 'Proceed' (for each of the five 'Choose...' options) for selective installation.")
            (help   "    Selecting 'Proceed' with 'Perform Installation' "
                    "will install the default files; however, by selecting one of the "
                    "choices then clicking 'Proceed', that action will be "
                    "performed.\n\n    If you select 'Choose programs,' you "
                    "will be able to select which application programs "
                    "will be installed.  If you select 'Choose output drivers,' "
                    "you will be able to select which output drivers to "
                    "install.  If you select 'Choose misc files,' you may "
                    "elect not to install the various "
                    "auxilliary files that ProVector uses (such as "
                    "font sets and help files).  If you select 'Choose "
                    "examples,' you may request that sample artwork and "
                    "ARexx scripts be installed.  If you select 'Disk space "
                    "required...,' the installation program will tell you "
                    "how much space you will need on the destination "
                    "device.\n\n    If you select 'Install files...', the "
                    "installation will proceed.\n\n" @askchoice-help)
            (choices    "Choose programs"
                    "Choose output drivers"
                    "Choose import modules"
                    "Choose misc files"
                    "Choose examples"
                    "Disk space required by files selected above"
                    "Install files set by 'Choose...' options above")
            (default what-install)
        )
    )

    (if (= what-install 0) (
        (set prog-install
            (askoptions
                (prompt "ProVector® Programs...")
                (help   "    By default, both ProVector and StylusTracer will be "
                        "installed.  By deselecting the check boxes, you may choose "
                        "not to install either one.\n\n    The install script tests "
                        "your system for the presence of a 68881 or greater math "
                        "coprocessor \(FPU\).  If found, a version of ProVector that "
                        "supports the FPU will be installed.  Otherwise, a Fast "
                        "Floating Point version of ProVector will be installed.\n\n"
                        "    StylusTracer is an auto-tracing utility "
                        "with a complete set of image-processing, "
                        "and touch-up tools.\n\n"
                        "    These files will be installed directly in the "
                        "destination drawer you have chosen.\n\n"
                        @askoptions-help)
                (choices    "ProVector (FFP or 881)"
                        "StylusTracer")
                (default prog-install)
            )
        )
    ))

    (if (= what-install 1) (
        (set driv-install
            (askoptions
                (prompt "ProVector® Drivers:")
                (help   "    The Preferences driver will enable you to "
                    "produce output on the printer that you "
                    "specify with the system Preferences program.  "
                    "Since this is the type of printer most users "
                    "own, you will probably want to install this "
                    "driver.\n\n"
                    "    The ILBM driver will enable you to create "
                    "high-resolution bitmap output in a format compatible "
                    "with all Amiga® painting programs.  This format "
                    "is also compatible with most desktop publishing "
                    "programs and graphic word processors.  You will "
                    "probably want to install this driver as well.\n\n"
                    "    The ILBM24 driver will create 24-bit (16-million-color) "
                    "ILBM bitmaps with optional anti-aliasing.  This driver is "
                    "ideal for producing high-resolution bitmap output, character "
                    "generation, etc.  If you are using ProVector for professional "
                    "graphics or video, you will want this driver.\n\n"
                    "    The PostScript® driver can drive PostScript printers, and "
                    "produce PostScript files that may be transferred to a service "
                    "bureau to output on a high-resolution imagesetter.  Also, it "
                    "can create Encapsulated PostScript files for importing into "
                    "most desktop publishing programs.\n\n"
                    "   The AI_EPS driver can be used to export ProVector drawings "
                    "in Adobe Illustrator format.\n\n"
                    "    The HPGL driver produces output compatible "
                    "with many pen plotters.  It supports HP-GL2.  This is a fairly "
                    "specialized application, so you will probably "
                    "not need this driver.\n\n"
                    "    The HPGL_Tile driver allows you to create output larger "
                    "than your HP-GL device supports by plotting in sections.  This "
                    "driver is particularly useful for sign-cutters.  Unlike the "
                    "HPGL driver, this driver does not support HP-GL2.  "
                    "This also is a fairly specialized application, so you will "
                    "probably not need this driver.\n\n"
                    "    By default, the drivers are installed in the "
                    "PV_Drivers drawer in the destination drawer you "
                    "have selected.  If you chose to install them "
                    "elsewhere, you must make sure that the PV_Drivers: "
                    "assignment is set up properly \(the Installer script can do "
                    "this for you\).\n\n"
                    @askoptions-help)
                (choices    "Preferences"
                        "ILBM"
                        "ILBM24"
                        "PostScript"
                        "AI_EPS"
                        "HPGL"
                        "HPGL_Tile")
                (default driv-install)
            )
        )
    ))

    (if (= what-install 2) (
        (set imp-install
            (askoptions
                (prompt "ProVector® Import Modules...")
                (help   "    The PSImport module will enable you to "
                    "import, view, and edit PostScript® and "
                    "EPS files from virtually any program.\n\n"
                    "    The HPGLImport module enables similar "
                    "importing of HP-GL files.\n\n"
                    @askoptions-help)
                (choices    "PSImport"
                    "HPGLImport")
                (default imp-install)
            )
        )
    ))

;== Install OFNT outline and stroke fonts, *.guide files?
    (if (= what-install 3) (
        (set misc-install
            (askoptions
                (prompt "ProVector® Misc files...")
                (help   "    The Basic fonts are in IFF-OFNT format.  ProVector also "
                        "supports PostScript Type-1 fonts.  If you have a collection "
                        "of Type-1 fonts you may not wish to install these fonts, but "
                        "use the Font Manager to add your fonts to the ProVector "
                        "fontlist.  In general, Type-1 fonts will yield better "
                        "quality output; however, the basic fonts will be faster and "
                        "use less memory.  Thus, you may find both useful.\n\n"
                        "    By default, fonts are installed in a drawer named "
                        "PV_Type in the destination drawer that you have chosen "
                        "for ProVector.  If you choose NOT to install the PV_Type "
                        "drawer there, you should make sure that the PV_Type: "
                        "assignment is properly set up \(this Installer will help "
                        "you with this\).\n\n    NOTE:  The ProVector Font Manager "
                        "will allow you to locate fonts wherever you wish.  It is "
                        "the file 'PV_FontList' that is MUST be located in PV_Type "
                        "\(the directory or logical device\).\n\n    The Extra "
                        "fonts are a collection of stroke fonts \(ie. simple line "
                        "rather than outline fonts\).  These fonts are most "
                        "useful with HP-GL plotters.\n\n"
                        "    The Help files are in AmigaGuide(tm) format.\n\n"
                        @askoptions-help)
                (choices    "Basic fonts"
                        "Extra fonts"
                        "ProVector On-Line Help"
                        "StylusTracer On-Line Help")
                (default misc-install)
            )
        )
    ))

    (if (= what-install 4) (
        (set samp-install
            (askoptions
                (prompt "ProVector® Samples...")
                (help   "Over 30 ARexx macros are included with "
                    "ProVector.  ARexx is a powerful scripting "
                    "language shippped with release 2.0 and greater "
                    "of the system software.  In addition to being "
                    "useful extensions of the ProVector capabilities, "
                    "they are also good examples to follow when "
                    "learning the ProVector ARexx commands.  "
                    "A REXX drawer will be created in the "
                    "ProVector drawer by default.\n\n"
                    "The Artwork is a small collection of pictures "
                    "drawn with ProVector.  They are good to use "
                    "when you are learning your way around the "
                    "program.  You may also use them as clip-art "
                    "in your own drawings.  By default, these will be "
                    "placed in a drawer named Samples in the "
                    "destination drawer you have chosen.\n\n"
                    @askoptions-help)
                (choices    "ARexx macros"  ;==Implies RexxRequest, RexxMath, PVpal and STfilt drawers.
                        "Artwork")
                (default samp-install)
            )
        )
    ))

    ;==Compute installation size
    (if (AND (= Compute 0) (or (= what-install 5) (= what-install 6))) (
        (set prog-tot 0)
        ;==AG and TF don't install in prog-dest usually; so would throw off "space
        ;== available" test
        ;(set prog-tot (+ ag-tot tf-tot))
        (if (IN prog-install 0)
            ; ProVector.881
            (if (= SYSFPU 1) (set prog-tot (+ prog-tot pv881-tot)))
            ; else ProVector.FFP
            (if (= SYSFPU 0) (set prog-tot (+ prog-tot pvffp-tot)))
        )
        ; StylusTracer
        (if (IN prog-install 1) (set prog-tot (+ prog-tot st-tot)))
        ; PV_Drivers/Preferences
        (if (IN driv-install 0) (set prog-tot (+ prog-tot pref-tot)))
        ; PV_Drivers/ILBM
        (if (IN driv-install 1) (set prog-tot (+ prog-tot ilbm-tot)))
        ; PV_Drivers/ILBM24
        (if (IN driv-install 2) (set prog-tot (+ prog-tot ilbm24-tot)))
        ; PV_Drivers/PostScript
        (if (IN driv-install 3) (set prog-tot (+ prog-tot ps-tot)))
        ; PV_Drivers/AI_EPS
        (if (IN driv-install 4) (set prog-tot (+ prog-tot ai-tot)))
        ; PV_Drivers/HPGL driver
        (if (IN driv-install 5) (set prog-tot (+ prog-tot hpgl-tot)))
        ; PV_Drivers/HPGL_Tile driver
        (if (IN driv-install 6) (set prog-tot (+ prog-tot hpgltile-tot)))
        ; PSImport import module
        (if (IN imp-install 0) (set prog-tot (+ prog-tot psimp-tot)))
        ; HPGLImport import module
        (if (IN imp-install 1) (set prog-tot (+ prog-tot hpglimp-tot)))
        ; Basic Fonts - simple_stroke, PV_Sans, PV_Roman
        (if (IN misc-install 0) (set prog-tot (+ prog-tot pvt-tot)))
        ; Extra fonts
        (if (IN misc-install 1) (set prog-tot (+ prog-tot pvtex-tot)))
        ; ProVector Help files
        (if (IN misc-install 2) (set prog-tot (+ prog-tot pvh-tot)))
        ; StylusTracer Help files
        (if (IN misc-install 3) (set prog-tot (+ prog-tot sth-tot)))
        ; ARexx examples and RexxRequest (and RexxRequest.guide)
        (if (IN samp-install 0) (set prog-tot (+ prog-tot (+ rexx-tot rxrqh-tot))))
        ; DR2D drawings
        (if (IN samp-install 1) (set prog-tot (+ prog-tot dr2d-tot)))
        (set Compute 1)

        ;==Is there enough disk space?
        (if (> (* prog-tot 1000) disk-avail)
            (set space-ok "insufficient!")
            (set space-ok "sufficient.")
        )
    )) ;==End compute if

    (if (= what-install 5) (
        (askbool
            (prompt "\n\nYou have selected "
                ("%ld" (* prog-tot 1000))
                " bytes for installation; the destination "
                "disk has "
                ("%ld" disk-avail)
                " bytes available; "
                "space is "
                (space-ok)
                "  If space is insufficient, "
                "you will be prompted to relocate files before "
                "the installation proceeds.")
            ;==(choices "OK" "OK")
            (help "")
        )
    )) ;=end if 5 true; end if 5

    (if (= what-install 6) (
        (set Done 1)
        (if (= space-ok "insufficient!")
            (reassign)
        )
    )) ;==end if 6 true; end if 6

) ; end 'What-Install' while

;==If expert level and they haven't already; let them move files around
(if (AND (= @user-level 2) (<> space-ok "insufficient!")) (ReAssign))

(set num-done 0)
(if (= prog-tot 0) (set prog-tot 1))    ;***WHY?

;==Install from PV1:
(if (or
    (or (IN prog-install 0) (IN misc-install 0 1 2 3))
    (IN samp-install 1))
    (askdisk    (prompt "\n\nInsert the distribution disk labelled 'PV1:' into any drive.")
            (dest "PV1")
            (help @askdisk-help))
)

(set copy-prompt "Copying file(s)")

;==*** NEED TO DELETE THE LOG ICON FILE from RAM: - Installer forgets?...if aborted?
;==This causes temporary log file in RAM:
;==  but Installer moves it to @default-dest.
(copyfiles
    (source "PV1:LHex")
    (dest "RAM:"))


;==Install ProVector.881
(if (AND (IN prog-install 0) (= SYSFPU 1)) (
    ;==Build arg string
    (set @execute-dir prog-dest)
    (set RunStr "RAM:LHex -af x PV1:PV881.lha ProVector.881")
    (working "\nUncompressing and installing Math Coprocessor Version of ProVector.")
    (run RunStr (confirm) (prompt ("\n\n\nCopy Math Coprocessor Version of ProVector to %s?" prog-dest)) (help ""))
    (if (not (exists (tackon prog-dest "ProVector.881.info"))) (
        (set RunStr "RAM:LHex -af x PV1:PV881.lha ProVector.881.info")
        (run RunStr
            (confirm)
            (prompt "\n\n\nCopy ProVector icon?")
            (help icon-help))
        (tooltype (dest (tackon prog-dest "ProVector.881")) (noposition))
    ))
    (rename (tackon prog-dest "ProVector.881") (tackon prog-dest "ProVector")
        (prompt "Rename 'ProVector.881' to 'ProVector?'")
        (help "ProVector doesn't care what its name is.")
        (confirm)
    )
    (rename (tackon prog-dest "ProVector.881.info") (tackon prog-dest "ProVector.info")
        (prompt "Rename 'ProVector.881.info' to 'ProVector.info?'")
        (help "Rename the ProVector icon file also.")
        (confirm)
    )
    (set num-done (+ num-done pv881-tot))
))
(complete (/ (* 100 num-done) prog-tot))


;== Install TextField gadget
;== *** DO TEST FIRST?
;== Copy textfield.gadget to RAM: then copylib() to verify version
(set @execute-dir "RAM:")
(set RunStr "RAM:LHex -af x PV1:SYS.lha textfield.gadget")
(working "\nUncompressing textfield.gadget, testing version before installing.")
(run RunStr (confirm) (prompt "\n\n\nDecompress textfield.gadget?") (help "This file is REQUIRED for ProVector text entry!"))
(if (exists "SYS:Classes/Gadgets" (noreq))
    (set txtfld-dest "SYS:Classes/Gadgets")
    ((set txtfld-dest (tackon prog-dest "Gadgets"))
    (makedir txtfld-dest (infos))
))
(if (exists "RAM:textfield.gadget" (noreq)) (
    ;==copylib will not report matching version errors, only greater or lesser.
    (copylib
        (source "RAM:textfield.gadget")
        (dest txtfld-dest)
        (confirm)
        (prompt "\n\nCopying textfield.gadget")
        (help "REQUIRED for text entry!\n\n" @copylib-help))
    (delete "RAM:textfield.gadget")
))
;==Throws off complete if not added into prog-tot; see "Compute"...
;(set num-done (+ num-done tf-tot))
;(complete (/ (* 100 num-done) prog-tot))


;==Install Basic fonts
(if (IN misc-install 0) (
    (if (not (exists type-dest)) (makedir type-dest (prompt "") (help "") (infos)))
    ;==Build arg string
    (set @execute-dir type-dest)
    (if (exists (tackon type-dest "PV_FontList"))
        (set RunStr "RAM:LHex -af x PV1:PVtyp.lha Simple_Stroke PV_Sans PV_Roman Acknowledgement.txt")
    ;== else
        (set RunStr "RAM:LHex -af x PV1:PVtyp.lha PV_FontList Simple_Stroke PV_Sans PV_Roman")
    )
    (working "\nUncompressing and installing basic fonts.")
    (run RunStr (confirm) (prompt ("\n\n\nCopy ProVector Fonts to %s?" type-dest))
        (help   "These fonts are in IFF-OFNT format, "
                "a format related to IFF-DR2D.  ProVector "
                "also supports PostScript Type 1 fonts."))
    (set RunStr "RAM:LHex -af x PV1:PVtyp.lha PV_FontList.info Simple_Stroke.info PV_Sans.info PV_Roman.info")
    (run RunStr
        (confirm)
        (prompt "\n\n\nCopy Font Icons?")
        (help "These icons are only a convenience for Workbench users."))
    (tooltype (dest (tackon type-dest "Simple_Stroke")) (noposition))
    (tooltype (dest (tackon type-dest "PV_Sans")) (noposition))
    (tooltype (dest (tackon type-dest "PV_Roman")) (noposition))
    (tooltype (dest (tackon type-dest "PV_FontList")) (noposition))
    (set num-done (+ num-done pvt-tot))
))
(complete (/ (* 100 num-done) prog-tot))

;==Install Stroke Fonts
(if (IN misc-install 1) (
    (if (not (exists type-dest)) (makedir type-dest (prompt "") (help "") (infos)))
    ;==Build arg string
    (set @execute-dir type-dest)
    (if (exists (tackon type-dest "PV_FontList"))
        (set RunStr "RAM:LHex -af x PV1:PVtyp.lha Sans_Stroke Serif_Stroke English_Stroke Greek_Stroke Cyrillic_Stroke")
    ;== else
        (set RunStr "RAM:LHex -af x PV1:PVtyp.lha PV_FontList Sans_Stroke Serif_Stroke English_Stroke Greek_Stroke Cyrillic_Stroke")
    )
    (working "\nUncompressing and installing stroke fonts.")
    (run RunStr
        (confirm)
        (prompt ("\n\n\nCopy ProVector Stroke Fonts to %s?" type-dest))
        (help   "These are simple stroke \(straight-line, not outline\) "
                "fonts, in IFF-OFNT format.  They are most useful "
                "with plotters and similar non-raster \(ie. vector\) "
                "output devices."))
    (set RunStr "RAM:LHex -af x PV1:PVtyp.lha Sans_Stroke.info Serif_Stroke.info English_Stroke.info Greek_Stroke.info Cyrillic_Stroke.info")
    (run RunStr
        (confirm)
        (prompt "\n\n\nCopy Font Icons?")
        (help "These icons are only a convenience for Workbench users."))
    (tooltype (dest (tackon type-dest "Sans_Stroke")) (noposition))
    (tooltype (dest (tackon type-dest "Serif_Stroke")) (noposition))
    (tooltype (dest (tackon type-dest "English_Stroke")) (noposition))
    (tooltype (dest (tackon type-dest "Greek_Stroke")) (noposition))
    (tooltype (dest (tackon type-dest "Cyrillic_Stroke")) (noposition))
    (set num-done (+ num-done pvtex-tot))
))
(complete (/ (* 100 num-done) prog-tot))


;==Define a procedure for installing AmigaGuide.
(procedure InstallAG
    (set @execute-dir "RAM:")
    (set RunStr "RAM:LHex -af x PV1:SYS.lha amigaguide.library AmigaGuide AmigaGuide.info help.guide")
    (run RunStr)
    (if (exists "RAM:amigaguide.library" (noreq)) (
        ;==copylib will not report matching version errors, only greater or lesser.
        (copylib
            (source "RAM:amigaguide.library")
            (dest "libs:")
            (confirm)
            (prompt "\n\nCopying amigaguide.library - versions compared. ")
            (help "REQUIRED for on-line help!\n\n" @copylib-help))
        (delete "RAM:amigaguide.library")
    ))
    (if (exists "RAM:AmigaGuide" (noreq)) (
        (copyfiles
            (source "RAM:")
            (pattern "AmigaGuide#?")
            (dest "SYS:Utilities")
            (confirm)
            (prompt "\n\nCopying AmigaGuide to SYS:Utilities")
            (help "Useful, but not required for on-line help.\n\n" @copyfiles-help))
        (delete "RAM:AmigaGuide")
    ))
    (if (exists "RAM:help.guide" (noreq)) (
        (copyfiles
            (source "RAM:help.guide")
            (dest "s:")
            (confirm)
            (prompt "\n\nCopying help.guide to s:")
            (help "REQUIRED for on-line help on-line help \(that wasn't a typo...  :-\)\)!\n\n" @copyfiles-help))
        (delete "RAM:help.guide")
    ))
    ;==Throws off complete if not in prog-tot; see "Compute"...
    ;(set num-done (+ num-done ag-tot))
    ;(complete (/ (* 100 num-done) prog-tot))
);==End InstallAG procedure

;==Install ProVector *.guide files; and, if necessary, AmigaGuide.
(if (IN misc-install 2) (
    (if (not (exists "libs:amigaguide.library")) (InstallAG))
    (if (not (exists help-dest)) (makedir help-dest (prompt "") (help "") (infos)))
    ;==Build arg string
    (set @execute-dir help-dest)
    (set RunStr "RAM:LHex -af x PV1:PVhlp.lha P*.guide")
    (working "\nUncompressing and installing ProVector help files.")
    (run RunStr (confirm) (prompt ("\n\n\nCopy ProVector Help Files to %s?" help-dest)) (help ""))
    ;==Don't NEED (exists) test here (but not worth the trouble to edit out).
    (if (not (exists (tackon prog-dest "ProVector.guide.info"))) (
        (set RunStr "RAM:LHex -af x PV1:PVhlp.lha P*.guide.info")
        (run RunStr
            (confirm)
            (prompt "\n\n\nCopy ProVector help icon files?")
            (help   "    The icon files will allow you to run AmigaGuide and load "
                    "help files when ProVector is not running."))
        (tooltype (dest (tackon prog-dest "ProVector.guide")) (noposition))
        (tooltype (dest (tackon prog-dest "PV_Export.guide")) (noposition))
        (tooltype (dest (tackon prog-dest "PV_Import.guide")) (noposition))
        (tooltype (dest (tackon prog-dest "PVRX.guide")) (noposition))
        (tooltype (dest (tackon prog-dest "PVRX_Commands.guide")) (noposition))
    ))
    (set num-done (+ num-done pvh-tot))
))
(complete (/ (* 100 num-done) prog-tot))

;==Install RexxRequest.guide; and, if necessary AmigaGuide
(if (AND (IN samp-install 0) (OR (IN misc-install 2) (IN misc-install 3))) (
    (if (not (exists "libs:amigaguide.library")) (InstallAG))
    (if (not (exists help-dest)) (makedir help-dest (prompt "") (help "") (infos)))
    ;==Build arg string
    (set @execute-dir help-dest)
    (set RunStr "RAM:LHex -af x PV1:PVhlp.lha RexxRequest.guide")
    (working "\nUncompressing and installing RexxRequest help files.")
    (run RunStr (confirm) (prompt ("\n\n\nCopy RexxRequest Help Files to %s?" help-dest)) (help ""))
    (if (not (exists (tackon prog-dest "RexxRequest.guide.info"))) (
        (set RunStr "RAM:LHex -af x PV1:PVhlp.lha RexxRequest.guide.info")
        (run RunStr
            (confirm)
            (prompt "\n\n\nCopy RexxRequest help icon files?")
            (help   "    The icon files will allow you to run AmigaGuide and load "
                    "help files when ProVector is not running."))
        (tooltype (dest (tackon prog-dest "RexxRequest.guide")) (noposition))
    ))
    (set num-done (+ num-done rxrqh-tot))
))
(complete (/ (* 100 num-done) prog-tot))

;==Install StylusTracer.guide; and, if necessary AmigaGuide
(if (IN misc-install 3) (
    (if (not (exists "libs:amigaguide.library")) (InstallAG))
    (if (not (exists help-dest)) (makedir help-dest (prompt "") (help "") (infos)))
    ;==Build arg string
    (set @execute-dir help-dest)
    (set RunStr "RAM:LHex -af x PV1:PVhlp.lha S*.guide")
    (working "\nUncompressing and installing StylusTracer help files.")
    (run RunStr (confirm) (prompt ("\n\n\nCopy StylusTracer Help Files to %s?" help-dest)) (help ""))
    (if (not (exists (tackon prog-dest "StylusTracer.guide.info"))) (
        (set RunStr "RAM:LHex -af x PV1:PVhlp.lha S*.guide.info")
        (run RunStr
            (confirm)
            (prompt "\n\n\nCopy StylusTracer help icon files?")
            (help   "    The icon files will allow you to run AmigaGuide and load "
                    "help files when StylusTracer is not running."))
        (tooltype (dest (tackon prog-dest "StylusTracer.guide")) (noposition))
        (tooltype (dest (tackon prog-dest "STRX.guide")) (noposition))
        (tooltype (dest (tackon prog-dest "STRX_Commands.guide")) (noposition))
    ))
    (set num-done (+ num-done sth-tot))
))
(complete (/ (* 100 num-done) prog-tot))


;==Install Sample Drawings
(if (IN samp-install 1) (
    (makedir samp-dest (prompt "") (help "") (infos))
    ;==Build arg string
    (set @execute-dir samp-dest)
    (set RunStr "RAM:LHex -af x PV1:Samp.lha *.dr2d")
    (working "\nUncompressing and installing sample drawings.")
    (run RunStr (confirm) (prompt ("\n\n\nCopy sample drawings to %s?" samp-dest)) (help ""))
    (set RunStr "RAM:LHex -af x PV1:Samp.lha *.dr2d.info")
    (run RunStr (confirm) (prompt "\n\n\nCopy icons for drawings?")
            (help "These icons are only a convenience to Workbench users."))
    (tooltype (dest (tackon samp-dest "DR2D_Drawings/#?.dr2d")) (noposition))
    (set num-done (+ num-done dr2d-tot))
))
(complete (/ (* 100 num-done) prog-tot))


;== SWAP DISKS HERE.
(if (or
    (or (OR (= SYSFPU 0)(IN prog-install 1)) (IN driv-install 0 1 2 3 4 5 6 7))
    (or (IN imp-install 0 1) (IN samp-install 0)))
    (askdisk    (prompt "\n\nInsert the distribution disk labelled 'PV2:' into any drive.")
            (dest "PV2")
            (help ""))
)


;==Install ProVector.FFP
(if (AND (IN prog-install 0) (= SYSFPU 0)) (
    ;==Build arg string
    (set @execute-dir prog-dest)
    (set RunStr "RAM:LHex -af x PV2:PVffp.lha ProVector.FFP")
    (working "\nUncompressing and installing ProVector.FFP.")
    (run RunStr (confirm) (prompt ("\n\n\nCopy ProVector.FFP to %s?" prog-dest)) (help ""))
    (if (not (exists (tackon prog-dest "ProVector.FFP.info"))) (
        (set RunStr "RAM:LHex -af x PV2:PVffp.lha ProVector.FFP.info")
        (run RunStr
            (confirm)
            (prompt "\n\n\nCopy ProVector.FFP icon?")
            (help icon-help))
        (tooltype (dest (tackon prog-dest "ProVector.FFP")) (noposition))
    ))
    (rename (tackon prog-dest "ProVector.FFP") (tackon prog-dest "ProVector")
        (prompt "Rename 'ProVector.FFP' to 'ProVector?'")
        (help "ProVector doesn't care what its name is.")
        (confirm)
    )
    (rename (tackon prog-dest "ProVector.FFP.info") (tackon prog-dest "ProVector.info")
        (prompt "Rename 'ProVector.FFP.info' to 'ProVector.info?'")
        (help "Rename the ProVector icon file also.")
        (confirm)
    )
    (set num-done (+ num-done pvffp-tot))
))
(complete (/ (* 100 num-done) prog-tot))


;==Install StylusTracer
(if (IN prog-install 1) (
    ;==Build arg string
    (set @execute-dir prog-dest)
    (set RunStr "RAM:LHex -af x PV2:ST.lha StylusTracer")
    (working "\nUncompressing and installing StylusTracer.")
    (run RunStr (confirm) (prompt ("\n\n\nCopy StylusTracer to %s?" prog-dest)) (help ""))
    (if (not (exists (tackon prog-dest "StylusTracer.info"))) (
        (set RunStr "RAM:LHex -af x PV2:ST.lha StylusTracer.info")
        (run RunStr
            (confirm)
            (prompt "\n\n\nCopy StylusTracer icon?")
            (help icon-help))
        (tooltype (dest (tackon prog-dest "StylusTracer")) (noposition))
    ))
    (set num-done (+ num-done st-tot))
))
(complete (/ (* 100 num-done) prog-tot))


;==Install Preferences driver
(if (IN driv-install 0) (
    (if (not (exists driv-dest)) (makedir driv-dest (prompt "") (help "") (infos)))
    ;==Build arg string
    (set @execute-dir driv-dest)
    (set RunStr "RAM:LHex -af x PV2:PVdrv.lha Preferences")
    (working "\nUncompressing and installing drivers.")
    (run RunStr (confirm) (prompt ("\n\n\nCopy Preferences Driver to %s?" driv-dest)) (help ""))
    (if (not (exists (tackon driv-dest "Preferences.info"))) (
        (set RunStr "RAM:LHex -af x PV2:PVdrv.lha Preferences.info")
        (run RunStr
            (confirm)
            (prompt "\n\n\nCopy Preferences icon?")
            (help icon-help))
        (tooltype (dest (tackon driv-dest "Preferences")) (noposition))
    ))
    (set num-done (+ num-done pref-tot))
))
(complete (/ (* 100 num-done) prog-tot))

;==Install ILBM driver
(if (IN driv-install 1) (
    (if (not (exists driv-dest)) (makedir driv-dest (prompt "") (help "") (infos)))
    ;==Build arg string
    (set @execute-dir driv-dest)
    (set RunStr "RAM:LHex -af x PV2:PVdrv.lha ILBM")
    (working "\nUncompressing and installing drivers.")
    (run RunStr (confirm) (prompt ("\n\n\nCopy ILBM Driver to %s?" driv-dest)) (help ""))
    (if (not (exists (tackon driv-dest "ILBM.info"))) (
        (set RunStr "RAM:LHex -af x PV2:PVdrv.lha ILBM.info")
        (run RunStr
            (confirm)
            (prompt "\n\n\nCopy ILBM icon?")
            (help icon-help))
        (tooltype (dest (tackon driv-dest "ILBM")) (noposition))
    ))
    (set num-done (+ num-done ilbm-tot))
))
(complete (/ (* 100 num-done) prog-tot))

;==Install ILBM24 driver
(if (IN driv-install 2) (
    (if (not (exists driv-dest)) (makedir driv-dest (prompt "") (help "") (infos)))
    ;==Build arg string
    (set @execute-dir driv-dest)
    (set RunStr "RAM:LHex -af x PV2:PVdrv.lha ILBM24")
    (working "\nUncompressing and installing drivers.")
    (run RunStr (confirm) (prompt ("\n\n\nCopy ILBM24 Driver to %s?" driv-dest)) (help ""))
    (if (not (exists (tackon driv-dest "ILBM24.info"))) (
        (set RunStr "RAM:LHex -af x PV2:PVdrv.lha ILBM24.info")
        (run RunStr
            (confirm)
            (prompt "\n\n\nCopy ILBM24 icon?")
            (help icon-help))
        (tooltype (dest (tackon driv-dest "ILBM24")) (noposition))
    ))
    (set num-done (+ num-done ilbm24-tot))
))
(complete (/ (* 100 num-done) prog-tot))

;==Install PostScript driver
(if (IN driv-install 3) (
    (if (not (exists driv-dest)) (makedir driv-dest (prompt "") (help "") (infos)))
    ;==Build arg string
    (set @execute-dir driv-dest)
    (set RunStr "RAM:LHex -af x PV2:PVdrv.lha PostScript")
    (working "\nUncompressing and installing drivers.")
    (run RunStr (confirm) (prompt ("\n\n\nCopy PostScript® Driver to %s?" driv-dest)) (help ""))
    (if (not (exists (tackon driv-dest "PostScript.info"))) (
        (set RunStr "RAM:LHex -af x PV2:PVdrv.lha PostScript.info")
        (run RunStr
            (confirm)
            (prompt "\n\n\nCopy PostScript icon?")
            (help icon-help))
        (tooltype (dest (tackon driv-dest "PostScript")) (noposition))
    ))
    (set num-done (+ num-done ps-tot))
))
(complete (/ (* 100 num-done) prog-tot))

;==Install AI_EPS driver
(if (IN driv-install 4) (
    (if (not (exists driv-dest)) (makedir driv-dest (prompt "") (help "") (infos)))
    ;==Build arg string
    (set @execute-dir driv-dest)
    (set RunStr "RAM:LHex -af x PV2:PVdrv.lha AI_EPS")
    (working "\nUncompressing and installing drivers.")
    (run RunStr (confirm) (prompt ("\n\n\nCopy Adobe Illustrator(TM) Driver to %s?" driv-dest)) (help ""))
    (if (not (exists (tackon driv-dest "AI_EPS.info"))) (
        (set RunStr "RAM:LHex -af x PV2:PVdrv.lha AI_EPS.info")
        (run RunStr
            (confirm)
            (prompt "\n\n\nCopy AI_EPS icon?")
            (help icon-help))
        (tooltype (dest (tackon driv-dest "AI_EPS")) (noposition))
    ))
    (set num-done (+ num-done ai-tot))
))
(complete (/ (* 100 num-done) prog-tot))

;==Install HPGL driver
(if (IN driv-install 5) (
    (if (not (exists driv-dest)) (makedir driv-dest (prompt "") (help "") (infos)))
    ;==Build arg string
    (set @execute-dir driv-dest)
    (set RunStr "RAM:LHex -af x PV2:PVdrv.lha HPGL")
    (working "\nUncompressing and installing drivers.")
    (run RunStr (confirm) (prompt ("\n\n\nCopy HPGL Driver to %s?" driv-dest)) (help ""))
    (if (not (exists (tackon driv-dest "HPGL.info"))) (
        (set RunStr "RAM:LHex -af x PV2:PVdrv.lha HPGL.info")
        (run RunStr
            (confirm)
            (prompt "\n\n\nCopy HPGL icon?")
            (help icon-help))
        (tooltype (dest (tackon driv-dest "HPGL")) (noposition))
    ))
    (set num-done (+ num-done hpgl-tot))
))
(complete (/ (* 100 num-done) prog-tot))

;==Install HPGL_Tile driver
(if (IN driv-install 6) (
    (if (not (exists driv-dest)) (makedir driv-dest (prompt "") (help "") (infos)))
    ;==Build arg string
    (set @execute-dir driv-dest)
    (set RunStr "RAM:LHex -af x PV2:PVdrv.lha HPGL_Tile")
    (working "\nUncompressing and installing drivers.")
    (run RunStr (confirm) (prompt ("\n\n\nCopy HPGL_Tile Driver to %s?" driv-dest)) (help ""))
    (if (not (exists (tackon driv-dest "HPGL_Tile.info"))) (
        (set RunStr "RAM:LHex -af x PV2:PVdrv.lha HPGL_Tile.info")
        (run RunStr
            (confirm)
            (prompt "\n\n\nCopy HPGL_Tile icon?")
            (help icon-help))
        (tooltype (dest (tackon driv-dest "HPGL_Tile")) (noposition))
    ))
    (set num-done (+ num-done hpgltile-tot))
))
(complete (/ (* 100 num-done) prog-tot))


;==Install PSImport module
(if (IN imp-install 0) (
    (if (not (exists imp-dest)) (makedir imp-dest (prompt "") (help "") (infos)))
    ;==Build arg string
    (set @execute-dir imp-dest)
    (set RunStr "RAM:LHex -af x PV2:PVimp.lha PSImport PSImport.ps")
    (working "\nUncompressing and installing import modules.")
    (run RunStr (confirm) (prompt ("\n\n\nCopy PSImport(TM) Module to %s?" imp-dest)) (help ""))
    (if (not (exists (tackon imp-dest "PSImport.info"))) (
        (set RunStr "RAM:LHex -af x PV2:PVimp.lha PSImport.info")
        (run RunStr
            (confirm)
            (prompt "\n\n\nCopy PSImport icon?")
            (help icon-help))
        (tooltype (dest (tackon imp-dest "PSImport")) (noposition))
    ))
    (set num-done (+ num-done psimp-tot))
))
(complete (/ (* 100 num-done) prog-tot))

;==Install HPGLImport module
(if (IN imp-install 1) (
    (if (not (exists imp-dest)) (makedir imp-dest (prompt "") (help "") (infos)))
    ;==Build arg string
    (set @execute-dir imp-dest)
    (set RunStr "RAM:LHex -af x PV2:PVimp.lha HPGLImport")
    (working "\nUncompressing and installing import modules.")
    (run RunStr (confirm) (prompt ("\n\n\nCopy HPGLImport Module to %s?" imp-dest)) (help ""))
    (if (not (exists (tackon imp-dest "HPGLImport.info"))) (
        (set RunStr "RAM:LHex -af x PV2:PVimp.lha HPGLImport.info")
        (run RunStr
            (confirm)
            (prompt "\n\n\nCopy HPGLImport icon?")
            (help icon-help))
        (tooltype (dest (tackon imp-dest "HPGLImport")) (noposition))
    ))
    (set num-done (+ num-done hpglimp-tot))
))
(complete (/ (* 100 num-done) prog-tot))


;== IS REXX: EXISTS CHECKED ANYWHERE? - no...
;== Palette & Filter dirs are being made whether wanted or not.
;==     (oh well, implicitly wanted, because the macros use them)
;==Install ARexx macros and related files
(if (IN samp-install 0) (
    (makedir rexx-dest (infos))
    (set @execute-dir rexx-dest)
    ;==Build arg string
    (set RunStr "RAM:LHex -af x PV2:PVRX.lha")
    (working "\nUncompressing and installing ARexx files.")
    (run RunStr (confirm) (prompt ("\n\n\nCopy ARexx Macros to %s?" rexx-dest)) (help ""))
    (set pal-dest (tackon prog-dest "PV_Palette"))
    (if (not (exists pal-dest)) (makedir pal-dest (prompt "") (help "") (infos)))
    (set @execute-dir pal-dest)
    (set RunStr "RAM:LHex -af x PV2:PVplt.lha")
    (run RunStr (confirm) (prompt ("\n\n\nCopy Sample Palette Files to %s?" pal-dest)) (help "These files are used by the SavePalette and LoadPalette macros to save and load custom palettes."))
    (set filt-dest (tackon prog-dest "ST_Filters"))
    (if (not (exists filt-dest)) (makedir filt-dest (prompt "") (help "") (infos)))
    (set @execute-dir filt-dest)
    (set RunStr "RAM:LHex -af x PV2:STflt.lha")
    (run RunStr (confirm) (prompt ("\n\n\nCopy Sample Filter Files to %s?" filt-dest)) (help "These files are used by the Custom macro to save and load custom image processing filters."))

;== *** Needs option to put in prog-dest.
    ;(set rxrq-dest prog-dest)
    (set rxrq-dest "SYS:WBStartup")
    ;(if (not (exists rxrq-dest)) (makedir rxrq-dest (prompt "") (help "") (infos)))
    (set @execute-dir rxrq-dest)
    (set RunStr "RAM:LHex -af x PV2:RxReq.lha")
    (run RunStr (confirm) (prompt "\n\n\nCopy RexxRequest to WBStartup?")
        (help "This program is used to create requesters for ARexx macros. "
            "RexxRequest is REQUIRED by many of the supplied macros!")
    )

    ;==Copy rexxmathlib.library to RAM: then copylib() to verify version
    (set @execute-dir "RAM:")
    (set RunStr "RAM:LHex -af x PV2:rmathlib13.lha rexxmathlib.library")
    (run RunStr (confirm) (prompt "\n\n\nCopy rexxmathlib.library to LIBS: logical device?") (help "This library is used by several macros to access the Amiga® math functions."))
    (if (exists "RAM:rexxmathlib.library" (noreq))
    ;==copylib will not report matching version errors, only greater or lesser.
        (copylib
            (source "RAM:rexxmathlib.library")
            (dest "LIBS:")
            (confirm)
            (prompt "\n\nCopying rexxmathlib.library")
            (help "This file is required by some ProVector macros." @copylib-help))
    )
    (delete "RAM:rexxmathlib.library")

    ;==Test for RexxMast; Build Run String
    (set RunStr "C:Search S:User-Startup RexxMast quiet ")
    (if (AND (not (exists "SYS:WBStartup/RexxMast" (noreq))) (run RunStr)) (
        (copyfiles
            (confirm)
            (prompt "Copy 'RexxMast' to WBStartup?")
            (help "We strongly recommend this; otherwise, the ProVector macros will not work!\n\n" @copyfiles-help)
            (source "SYS:System/RexxMast")
            (dest "SYS:WBStartup")
            (infos))
        (tooltype
            (dest "SYS:WBStartup/RexxMast")
            (settooltype "DONOTWAIT" ""))
        (tooltype
            (dest "SYS:WBStartup/RexxMast")
            (settooltype "STARTPRI" "-128"))
        (if (askbool
            (prompt "Load ARexx and RexxRequest now? \(Recommended.\)")
            (help "This will enable the powerful "
            "macro facilities of ProVector.")) (
            (run "SYS:System/RexxMast" (prompt) (help))
            (set RunStr ("run <NIL: >NIL: %s" (tackon rxrq-dest "RexxRequest")))
            ;(debug "RunStr = " RunStr)
            ;==(run "C:Wait 3")
            ;==(debug "Wait OK.")
            (run RunStr (prompt) (help))
        ))
    ))
    (set num-done (+ num-done rexx-tot))
))
(complete (/ (* 100 num-done) prog-tot))


;==Cheating not necessary; prog-tot and num-done agreeing... :-)
;(complete 100)

(delete "RAM:LHex")


;== Patch User-Startup
;(if (= @user-level 2) (
(if (or (<> driv-dest driv-dflt) (or (<> imp-dest imp-dflt) (or (<> type-dest type-dflt) (<> help-dest help-dflt)))) (
    (set PVassigns ("Assign PV: %s\nAssign PV_Drivers: %s\nAssign PV_Import: %s\nAssign PV_Type: %s\nAssign PV_Help: %s" prog-dest driv-dest imp-dest type-dest help-dest))
    (startup
        "Stylus, Inc."
        (prompt
            "\nThe following commands are recommended for your "
            "'User-Startup' file:\n\n"
            PVassigns
            "\n\n\nAPPEND THEM NOW?")
        (help
            "Without these commands in your startup, ProVector "
            "may not work properly!\n\n"
            "Since you have installed the ProVector support files "
            "elsewhere than the default locations, you will need "
            "to add assignments to your 'User-Startup' file, so "
            "ProVector can find required files.\n\n"
            @startup-help)
        (command PVassigns)
    ) ;==end startup
    (set AssignNow (askbool
        (prompt "\nMake required assignments now?\n\nThis will avoid "
            "the need to reboot, to implement the previous startup changes.)")
        (help @askbool-help)
    )) ;end askbool set
)) ;==end if true parm, end if

;==Do assigns now - SHOULD TEST FOR ~EXISTS *-DEST's
(if (= AssignNow 1) (
    (makeassign "PV" prog-dest)
    (makeassign "PV_Drivers" driv-dest)
    (makeassign "PV_Import" imp-dest)
    (makeassign "PV_Type" type-dest)
    (makeassign "PV_Help" help-dest)
))


(if (IN misc-install 1)
    (message
        "\n\nYou will need to use the 'Settings/Font Manager...' "
        "menu item to add the *_Stroke fonts to PV_FontList."
    )
)

(EXIT)
