home *** CD-ROM | disk | FTP | other *** search
- ; $VER: Install_FetchRefs 1.3 (4.7.99)
- ; By Anders Melchiorsen & Roland Florac
-
- (message (cat
- " \n"
- "FetchRefs 2.1 \n"
- "By Anders Melchiorsen & Roland Florac \n"
- " \n"
- "A feature packed utility that provides you with \n"
- "the most comfortable access to your AutoDoc and \n"
- "include file references. \n"
- " \n"
- "Using: \n"
- "· gtlayout.library, copyright Olaf Olsen Barthel\n"
- "· reqtools.library, copyright Nico François \n"
- " \n"
- "FetchRefs is freely distributeable, providing \n"
- "that the distribution is left unchanged. \n"
- ))
-
- ; Don't bother to install on pre-2.04 machines
- (if (< (/ (getversion) 65536) 37)
- (
- (message (cat
- "You need at least Kickstart 2.04 to use FetchRefs.\n"
- "\n"
- "Therefore it would be a complete waste of both \n"
- "your time and disk space to install it. \n"
- )
- )
- (exit (quiet))
- )
- )
-
- (set @default-dest "")
- (welcome)
-
- ; Install FetchRefs (default: in SYS:WBStartup)
- (set frto "SYS:WBStartup")
-
- (if (= @user-level 2)
- (set frto (askdir (prompt "Select drawer to place FetchRefs in")
- (default frto)
- (help (cat
- "You now have to select where to put FetchRefs.\n"
- "\n"
- "Installing FetchRefs in your WBStartup drawer "
- "is a good idea as you then do not have to do "
- "anything further; it will start itself "
- "automatically everytime you reboot.\n"
- "\n"
- "If you select to put FetchRefs somewhere else, "
- "then you will have to edit your s:user-startup "
- "file if you want to start FetchRefs "
- "automatically. This is obviously not as "
- "convenient but may be handy if you do not plan "
- "to start FetchRefs on every boot-up."
- )
- )
- )
- )
- )
-
- (copyfiles (source "FetchRefs")
- (dest frto)
- (infos)
- (optional "force")
- )
-
- (tooltype (dest (tackon frto "FetchRefs"))
- (noposition)
- )
-
- ; Install GenerateIndex (default: in SYS:Tools)
- (set grto "SYS:Tools")
-
- (if (= @user-level 2)
- (set grto (askdir (prompt "Select drawer to place GenerateIndex in")
- (default grto)
- (help (cat
- "GenerateIndex is the index file generator "
- "for FetchRefs and you need to run it before you "
- "can use FetchRefs at anything. The default "
- "is to put GenerateIndex in your SYS:Tools drawer.\n"
- "\n"
- "If you choose not to install GenerateIndex in "
- "the SYS:Tools drawer then you will have to "
- "specify somewhere else to put it. It is not "
- "important where you put it; it is entirely up "
- "to you and your taste/disk structure."
- )
- )
- )
- )
- )
-
- (copyfiles (source "GenerateIndex")
- (dest grto)
- (infos)
- (optional "force")
- )
-
- (tooltype (dest (tackon grto "GenerateIndex"))
- (noposition)
- )
-
- ; Install script for editor
- (set editor 0)
-
- (if (< 0 (exists "GNUEMACS:" (noreq)) )
- (set editor 3)
- )
- (if (< 0 (exists "FrexxEd:" (noreq)) )
- (set editor 4)
- )
- (if (< 0 (exists "GOLDED:" (noreq)) )
- (set editor 5)
- )
-
- (if (OR (= editor 0) (= @user-level 2))
- (set editor
- (askchoice (prompt "Which text editor are you using?")
- (choices "None/unsupported editor" "CygnusEd" "Edge" "EMACS" "FrexxEd" "GoldED" "TurboText" "Amitex")
- (default editor)
- (help (cat
- "You need to specify what editor you are using because "
- "FetchRefs relies on external scripts in order to "
- "interface correctly to the editor. These scripts are "
- "different for all editors and therefore it is vital "
- "to install the right one.\n"
- "\n"
- "If you currently use an editor that is not "
- "supported, you may be able to create a "
- "script yourself. An existing script may be "
- "helpful so you could cheat and install one "
- "of the existing scripts (e.g. GoldED is fairly "
- "average for this purpose)."
- )
- )
- )
- )
- )
-
- (if (<> editor 3)
-
- ; then
- (set scriptto "REXX:")
-
- ; else
- (
- (set scriptto "GNUEMACS:lisp")
-
- (if (OR (= @user-level 2) (= 0 (exists scriptto (noreq)) ) )
- (set scriptto (askdir (prompt "Select drawer to place EMACS script in")
- (default "GNUEMACS:lisp")
- (help (cat
- "The default is to place the EMACS script in "
- "the GNUEMACS:lisp drawer. This is what the "
- "author suggests in the script.\n"
- "\n"
- "I do not know anything about EMACS so perhaps "
- "this is all wrong. In that case you are free "
- "to correct it."
- )
- )
- )
- )
- )
- )
- )
-
- (if (<> editor 0)
- (
- (if (and (= @user-level 2) (<> editor 3))
- (set scriptto (askdir (prompt "Select drawer to place ARexx script in")
- (default scriptto)
- (help (cat
- "If you select to put the ARexx scripts in "
- "your REXX: drawer, you will probably do just fine.\n"
- "\n"
- "However, some prefer to have a seperate drawer "
- "for scripts to each and every program and in "
- "such a case you will need to specify where you "
- "want the FetchRefs script to be (which is "
- "in the drawer for your editor, naturally)."
- )
- )
- )
- )
- )
-
- (set patt (select editor "" ; None
- "GoFetchRefs.ced" ; CygnusEd
- "GoFetchRefs.edge" ; Edge
- "FetchRefs.el" ; EMACS
- "GoFetchRefs.frexxed" ; FrexxEd
- "GoFetchRefs.ged" ; GoldED
- "GoFetchRefs.ttx" ; TurboText
- "FetchRefs.Amitex" ; Amitex
- )
- )
-
- (copyfiles (source "Scripts")
- (dest scriptto)
- (pattern patt)
- (optional "force")
- )
- )
- )
-
- ; Special message for EMACS users
- (if (= editor 3)
- (message (cat "The 'FetchRefs.el' script has now been installed "
- ("in your '%s' drawer. However, you need to make " scriptto)
- "some additions to your 's:.emacs' file also!\n"
- "\n"
- "Please read the notes in 'FetchRefs.el' when you "
- "have finished this installation!"
- )
- )
- )
-
- ; Additional action for FrexxEd
- (if (= editor 4)
- (
- (set fplto "FrexxEd:FPL")
-
- (if (OR (= @user-level 2) (= 0 (exists fplto (noreq)) ) )
- (set fplto (askdir (prompt "Select drawer to place GoFetchRefs.FPL in")
- (default fplto)
- (help (cat
- "When using FrexxEd you normally have FrexxEd: "
- "assigned to a directory which contains the "
- "FPL drawer. If your system is set up in "
- "another way, specify the correct directory here.\n"
- "\n"
- "Remember to take a look at the FetchRefsPrefs() "
- "function when using FetchRefs for the first time."
- )
- )
- )
- )
- )
-
- (copyfiles (source "Scripts/FPL")
- (dest fplto)
- (pattern "#?FPL#?")
- (optional "force")
- )
- )
- )
-
- (if (= editor 7)
- (if (askbool (prompt (cat "Do you want to install an ARexx "
- "script to quit FetchRefs ?"
- )
- )
- (help (cat
- "This script is used if you want to make "
- "FetchRefs quit. So you can free some "
- "memory.\n"
- "The script: 'FetchQuit.Amitex' makes that "
- "from Amitex."
- )
- )
- )
- ; then
- ( copyfiles (source "Scripts/FetchQuit.Amitex")
- (dest scriptto)
- (optional "force")
- )
- )
- )
-
- ; Install ARexx script for Shell usage
- (set shell_rxto "REXX:")
- (set shell_rexx 1)
-
- (if (= @user-level 2)
- (if (askbool (prompt (cat "Install the ARexx script to use\n"
- "FetchRefs from the Shell?"
- )
- )
-
- (help (cat
- "This script is used if you want to interface "
- "FetchRefs from your Shell. It will simply print "
- "the reference to the Shell window when you use "
- "the script: 'rx GoFetchRefs <reference>'. You do not "
- "even need an editor to use FetchRefs this way!"
- )
- )
- )
-
- ; then
-
- (set shell_rxto (askdir (prompt "Select drawer to place the Shell ARexx script in")
- (default shell_rxto)
- (help (cat
- "You must now select where you want the "
- "ARexx script of FetchRefs to be placed. "
- "The most logical place is REXX:"
- )
- )
- )
- )
-
- ; else
-
- (set shell_rexx 0)
- )
- )
-
- (if (= shell_rexx 1)
- (copyfiles (source "Scripts/GoFetchRefs.rexx")
- (dest shell_rxto)
- (optional "force")
- )
- )
-
-
- ; Install documentation (if wanted)
- (set docto "HELP:")
- (set doc 1)
-
- (if (= @user-level 2)
- (if (= 0 (askbool (prompt "Install the documentation?")
- (help (cat "You must now select whether you want the "
- "documentation copied. It probably is a "
- "good idea to have it handy until you "
- "get to learn FetchRefs.\n"
- "\n"
- "If you install the documentation in a "
- "drawer which is in the AmigaGuide/path "
- "ENV:ironment variable, FetchRefs and "
- "GenerateIndex will provide context "
- "sensitive help."
- )
- )
- )
- )
-
- ; then
- (set doc 0)
- )
- )
-
- (if (= doc 1)
- (
- (if (OR (= @user-level 2) (= 0 (exists docto (noreq)) ) )
- (set docto (askdir (prompt "Select drawer to place the guides in")
- (default docto)
- (help (cat
- "You must now select where you want the guides "
- "installed. This depends pretty much on the "
- "organisation of you harddisk.\n"
- "\n"
- "If you install the documentation in a "
- "drawer which is in the AmigaGuide/path "
- "ENV:ironment variable, FetchRefs and "
- "GenerateIndex will provide context "
- "sensitive help."
- )
- )
- )
- )
- )
-
- (copyfiles (source "Documentation")
- (dest docto)
- (pattern "FetchRefs#?guide")
- (infos)
- (optional "force")
- )
-
- (foreach docto "FetchRefs#?guide"
- (tooltype
- (dest (tackon docto @each-name))
- (noposition)
- )
- )
-
- )
- )
-
- ; Check for reqtools.library v38
- (set extramsg (cat
- "\n"
- "reqtools.library is freely distributeable \n"
- "and available from PD sources everywhere. \n"
- "\n"
- "Note that reqtools.library is only required \n"
- "if you intend to use the GUI of the index \n"
- "file generator for FetchRefs (see guide). \n"
- "However, you probably *do* want to use the \n"
- "GUI! \n"
- )
- )
-
- (if (exists "LIBS:reqtools.library" (noreq))
-
- ; then
- (if ( < (/ (getversion "LIBS:reqtools.library") 65536) 38)
- (message (cat
- "Your version of reqtools.library is too old!\n"
- "\n"
- "You should look around for a newer version \n"
- "of reqtools.library - at least version 38 \n"
- "(release 2) is required. \n"
- extramsg
- )
- )
- )
-
- ; else (does not exist)
- (message (cat
- "You do not have reqtools.library installed! \n"
- extramsg
- )
- )
-
- )
-
- ; Print final status report
- (message (cat
- "FetchRefs is installed in \n"
- ("%-50s\n" frto)
-
- (if (= frto "SYS:WBStartup")
- "(You need to reboot for FetchRefs to auto-load) \n"
- ; else
- "(Modify your s:user-startup to make it auto-start)\n"
- )
-
- "\n"
-
- "GenerateIndex is installed in \n"
- ("%-50s\n" grto)
- "\n"
-
- ("Installed scripts for: %-27s\n"
- (select editor
- "No editor"
- "CygnusEd"
- "Edge"
- "EMACS"
- "FrexxEd"
- "GoldED"
- "TurboText"
- "Amitex"
- )
- )
-
- (if (= shell_rexx 1)
- " The Shell \n"
- )
-
- "\n"
-
- (if (= doc 1)
- (cat
- "Documentation is installed in \n"
- ("%-50s\n" docto)
- "\n"
- )
- )
-
- "Happy fetching! \n"
- )
- )
-
- (exit (quiet))
-
-