home *** CD-ROM | disk | FTP | other *** search
/ Magazyn Exec 5 / CD_Magazyn_EXEC_nr_5.iso / Programy / Programowanie / FetchRefs2.1.lha / FetchRefs2.1 / Install < prev    next >
Encoding:
Text File  |  2001-01-28  |  11.8 KB  |  474 lines

  1. ; $VER: Install_FetchRefs 1.3 (4.7.99)
  2. ; By Anders Melchiorsen & Roland Florac
  3.  
  4. (message (cat
  5.     "                                                \n"
  6.     "FetchRefs 2.1                                   \n"
  7.     "By Anders Melchiorsen & Roland Florac           \n"
  8.     "                                                \n"
  9.     "A feature packed utility that provides you with \n"
  10.     "the most comfortable access to your AutoDoc and \n"
  11.     "include file references.                        \n"
  12.     "                                                \n"
  13.     "Using:                                          \n"
  14.     "· gtlayout.library, copyright Olaf Olsen Barthel\n"
  15.     "· reqtools.library, copyright Nico François     \n"
  16.     "                                                \n"
  17.     "FetchRefs is freely distributeable, providing   \n"
  18.     "that the distribution is left unchanged.        \n"
  19. ))
  20.  
  21. ; Don't bother to install on pre-2.04 machines
  22. (if (< (/ (getversion) 65536) 37)
  23.     (
  24.       (message (cat
  25.     "You need at least Kickstart 2.04 to use FetchRefs.\n"
  26.     "\n"
  27.     "Therefore it would be a complete waste of both    \n"
  28.     "your time and disk space to install it.           \n"
  29.     )
  30.       )
  31.       (exit (quiet))
  32.     )
  33. )
  34.  
  35. (set @default-dest "")
  36. (welcome)
  37.  
  38. ; Install FetchRefs (default: in SYS:WBStartup)
  39. (set frto "SYS:WBStartup")
  40.  
  41. (if (= @user-level 2)
  42.     (set frto (askdir (prompt "Select drawer to place FetchRefs in")
  43.               (default frto)
  44.               (help (cat
  45.                 "You now have to select where to put FetchRefs.\n"
  46.                 "\n"
  47.                 "Installing FetchRefs in your WBStartup drawer "
  48.                 "is a good idea as you then do not have to do "
  49.                 "anything further; it will start itself "
  50.                 "automatically everytime you reboot.\n"
  51.                 "\n"
  52.                 "If you select to put FetchRefs somewhere else, "
  53.                 "then you will have to edit your s:user-startup "
  54.                 "file if you want to start FetchRefs "
  55.                 "automatically. This is obviously not as "
  56.                 "convenient but may be handy if you do not plan "
  57.                 "to start FetchRefs on every boot-up."
  58.                )
  59.               )
  60.         )
  61.     )
  62. )
  63.  
  64. (copyfiles (source "FetchRefs")
  65.        (dest frto)
  66.        (infos)
  67.        (optional "force")
  68. )
  69.  
  70. (tooltype (dest (tackon frto "FetchRefs"))
  71.       (noposition)
  72. )
  73.  
  74. ; Install GenerateIndex (default: in SYS:Tools)
  75. (set grto "SYS:Tools")
  76.  
  77. (if (= @user-level 2)
  78.     (set grto (askdir (prompt "Select drawer to place GenerateIndex in")
  79.               (default grto)
  80.               (help (cat
  81.                 "GenerateIndex is the index file generator "
  82.                 "for FetchRefs and you need to run it before you "
  83.                 "can use FetchRefs at anything. The default "
  84.                 "is to put GenerateIndex in your SYS:Tools drawer.\n"
  85.                 "\n"
  86.                 "If you choose not to install GenerateIndex in "
  87.                 "the SYS:Tools drawer then you will have to "
  88.                 "specify somewhere else to put it. It is not "
  89.                 "important where you put it; it is entirely up "
  90.                 "to you and your taste/disk structure."
  91.                 )
  92.               )
  93.           )
  94.     )
  95. )
  96.  
  97. (copyfiles (source "GenerateIndex")
  98.        (dest grto)
  99.        (infos)
  100.        (optional "force")
  101. )
  102.  
  103. (tooltype (dest (tackon grto "GenerateIndex"))
  104.       (noposition)
  105. )
  106.  
  107. ; Install script for editor
  108. (set editor 0)
  109.  
  110. (if (< 0 (exists "GNUEMACS:" (noreq)) )
  111.     (set editor 3)
  112. )
  113. (if (< 0 (exists "FrexxEd:" (noreq)) )
  114.     (set editor 4)
  115. )
  116. (if (< 0 (exists "GOLDED:" (noreq)) )
  117.     (set editor 5)
  118. )
  119.  
  120. (if (OR (= editor 0) (= @user-level 2))
  121.     (set editor
  122.     (askchoice (prompt "Which text editor are you using?")
  123.            (choices "None/unsupported editor" "CygnusEd" "Edge" "EMACS" "FrexxEd" "GoldED" "TurboText" "Amitex")
  124.            (default editor)
  125.            (help (cat
  126.             "You need to specify what editor you are using because "
  127.             "FetchRefs relies on external scripts in order to "
  128.             "interface correctly to the editor. These scripts are "
  129.             "different for all editors and therefore it is vital "
  130.             "to install the right one.\n"
  131.             "\n"
  132.             "If you currently use an editor that is not "
  133.             "supported, you may be able to create a "
  134.             "script yourself. An existing script may be "
  135.             "helpful so you could cheat and install one "
  136.             "of the existing scripts (e.g. GoldED is fairly "
  137.             "average for this purpose)."
  138.             )
  139.            )
  140.     )
  141.     )
  142. )
  143.  
  144. (if (<> editor 3)
  145.  
  146.     ; then
  147.     (set scriptto "REXX:")
  148.  
  149.     ; else
  150.     (
  151.     (set scriptto "GNUEMACS:lisp")
  152.  
  153.     (if (OR (= @user-level 2) (= 0 (exists scriptto (noreq)) ) )
  154.         (set scriptto (askdir (prompt "Select drawer to place EMACS script in")
  155.                   (default "GNUEMACS:lisp")
  156.                   (help (cat
  157.                        "The default is to place the EMACS script in "
  158.                        "the GNUEMACS:lisp drawer. This is what the "
  159.                        "author suggests in the script.\n"
  160.                        "\n"
  161.                        "I do not know anything about EMACS so perhaps "
  162.                        "this is all wrong. In that case you are free "
  163.                        "to correct it."
  164.                     )
  165.                   )
  166.            )
  167.         )
  168.     )
  169.     )
  170. )
  171.  
  172. (if (<> editor 0)
  173.     (
  174.     (if (and (= @user-level 2) (<> editor 3))
  175.         (set scriptto (askdir (prompt "Select drawer to place ARexx script in")
  176.                   (default scriptto)
  177.                   (help (cat
  178.                        "If you select to put the ARexx scripts in "
  179.                        "your REXX: drawer, you will probably do just fine.\n"
  180.                        "\n"
  181.                        "However, some prefer to have a seperate drawer "
  182.                        "for scripts to each and every program and in "
  183.                        "such a case you will need to specify where you "
  184.                        "want the FetchRefs script to be (which is "
  185.                        "in the drawer for your editor, naturally)."
  186.                     )
  187.                   )
  188.               )
  189.         )
  190.     )
  191.  
  192.     (set patt (select editor ""                         ; None
  193.                  "GoFetchRefs.ced"          ; CygnusEd
  194.                  "GoFetchRefs.edge"         ; Edge
  195.                  "FetchRefs.el"             ; EMACS
  196.                  "GoFetchRefs.frexxed"      ; FrexxEd
  197.                  "GoFetchRefs.ged"          ; GoldED
  198.                  "GoFetchRefs.ttx"          ; TurboText
  199.                  "FetchRefs.Amitex"         ; Amitex
  200.              )
  201.     )
  202.  
  203.     (copyfiles (source "Scripts")
  204.            (dest scriptto)
  205.            (pattern patt)
  206.            (optional "force")
  207.     )
  208.     )
  209. )
  210.  
  211. ; Special message for EMACS users
  212. (if (= editor 3)
  213.     (message (cat   "The 'FetchRefs.el' script has now been installed "
  214.            ("in your '%s' drawer. However, you need to make " scriptto)
  215.             "some additions to your 's:.emacs' file also!\n"
  216.             "\n"
  217.             "Please read the notes in 'FetchRefs.el' when you "
  218.             "have finished this installation!"
  219.          )
  220.     )
  221. )
  222.  
  223. ; Additional action for FrexxEd
  224. (if (= editor 4)
  225.     (
  226.     (set fplto "FrexxEd:FPL")
  227.  
  228.     (if (OR (= @user-level 2) (= 0 (exists fplto (noreq)) ) )
  229.         (set fplto (askdir (prompt "Select drawer to place GoFetchRefs.FPL in")
  230.             (default fplto)
  231.             (help (cat
  232.                    "When using FrexxEd you normally have FrexxEd: "
  233.                    "assigned to a directory which contains the "
  234.                    "FPL drawer. If your system is set up in "
  235.                    "another way, specify the correct directory here.\n"
  236.                    "\n"
  237.                    "Remember to take a look at the FetchRefsPrefs() "
  238.                    "function when using FetchRefs for the first time."
  239.                   )
  240.             )
  241.                )
  242.         )
  243.     )
  244.  
  245.     (copyfiles (source "Scripts/FPL")
  246.            (dest fplto)
  247.            (pattern "#?FPL#?")
  248.            (optional "force")
  249.     )
  250.     )
  251. )
  252.  
  253. (if (= editor 7)
  254.     (if (askbool (prompt (cat "Do you want to install an ARexx "
  255.                   "script to quit FetchRefs ?"
  256.              )
  257.          )
  258.          (help (cat
  259.                 "This script is used if you want to make "
  260.                 "FetchRefs quit. So you can free some "
  261.                 "memory.\n"
  262.                 "The script: 'FetchQuit.Amitex' makes that "
  263.                 "from Amitex."
  264.                )
  265.          )
  266.      )
  267.      ; then
  268.      (    copyfiles (source "Scripts/FetchQuit.Amitex")
  269.             (dest scriptto)
  270.             (optional "force")
  271.      )
  272.     )
  273. )
  274.  
  275. ; Install ARexx script for Shell usage
  276. (set shell_rxto "REXX:")
  277. (set shell_rexx 1)
  278.  
  279. (if (= @user-level 2)
  280.     (if (askbool (prompt (cat "Install the ARexx script to use\n"
  281.                   "FetchRefs from the Shell?"
  282.                  )
  283.              )
  284.  
  285.              (help (cat
  286.                 "This script is used if you want to interface "
  287.                 "FetchRefs from your Shell. It will simply print "
  288.                 "the reference to the Shell window when you use "
  289.                 "the script: 'rx GoFetchRefs <reference>'. You do not "
  290.                 "even need an editor to use FetchRefs this way!"
  291.                )
  292.              )
  293.         )
  294.  
  295.         ; then
  296.  
  297.         (set shell_rxto (askdir (prompt "Select drawer to place the Shell ARexx script in")
  298.                   (default shell_rxto)
  299.                   (help (cat
  300.                        "You must now select where you want the "
  301.                        "ARexx script of FetchRefs to be placed. "
  302.                        "The most logical place is REXX:"
  303.                     )
  304.                   )
  305.               )
  306.         )
  307.  
  308.         ; else
  309.  
  310.         (set shell_rexx 0)
  311.     )
  312. )
  313.  
  314. (if (= shell_rexx 1)
  315.     (copyfiles (source "Scripts/GoFetchRefs.rexx")
  316.            (dest shell_rxto)
  317.            (optional "force")
  318.     )
  319. )
  320.  
  321.  
  322. ; Install documentation (if wanted)
  323. (set docto "HELP:")
  324. (set doc 1)
  325.  
  326. (if (= @user-level 2)
  327.     (if (= 0 (askbool (prompt "Install the documentation?")
  328.              (help (cat "You must now select whether you want the "
  329.                 "documentation copied. It probably is a "
  330.                 "good idea to have it handy until you "
  331.                 "get to learn FetchRefs.\n"
  332.                 "\n"
  333.                 "If you install the documentation in a "
  334.                 "drawer which is in the AmigaGuide/path "
  335.                 "ENV:ironment variable, FetchRefs and "
  336.                 "GenerateIndex will provide context "
  337.                 "sensitive help."
  338.                )
  339.              )
  340.          )
  341.     )
  342.  
  343.     ; then
  344.     (set doc 0)
  345.     )
  346. )
  347.  
  348. (if (= doc 1)
  349.     (
  350.     (if (OR (= @user-level 2) (= 0 (exists docto (noreq)) ) )
  351.         (set docto (askdir (prompt "Select drawer to place the guides in")
  352.                   (default docto)
  353.                   (help (cat
  354.                        "You must now select where you want the guides "
  355.                        "installed. This depends pretty much on the "
  356.                        "organisation of you harddisk.\n"
  357.                        "\n"
  358.                        "If you install the documentation in a "
  359.                        "drawer which is in the AmigaGuide/path "
  360.                        "ENV:ironment variable, FetchRefs and "
  361.                        "GenerateIndex will provide context "
  362.                        "sensitive help."
  363.                     )
  364.                   )
  365.               )
  366.         )
  367.     )
  368.  
  369.     (copyfiles (source "Documentation")
  370.            (dest docto)
  371.            (pattern "FetchRefs#?guide")
  372.            (infos)
  373.            (optional "force")
  374.     )
  375.  
  376.     (foreach docto "FetchRefs#?guide"
  377.         (tooltype
  378.            (dest (tackon docto @each-name))
  379.            (noposition)
  380.         )
  381.     )
  382.  
  383.     )
  384. )
  385.  
  386. ; Check for reqtools.library v38
  387. (set extramsg (cat
  388.         "\n"
  389.         "reqtools.library is freely distributeable   \n"
  390.         "and available from PD sources everywhere.   \n"
  391.         "\n"
  392.         "Note that reqtools.library is only required \n"
  393.         "if you intend to use the GUI of the index   \n"
  394.         "file generator for FetchRefs (see guide).   \n"
  395.         "However, you probably *do* want to use the  \n"
  396.         "GUI!                                        \n"
  397.         )
  398. )
  399.  
  400. (if (exists "LIBS:reqtools.library" (noreq))
  401.  
  402.     ; then
  403.     (if ( < (/ (getversion "LIBS:reqtools.library") 65536) 38)
  404.     (message (cat
  405.         "Your version of reqtools.library is too old!\n"
  406.         "\n"
  407.         "You should look around for a newer version  \n"
  408.         "of reqtools.library - at least version 38   \n"
  409.         "(release 2) is required.                    \n"
  410.         extramsg
  411.         )
  412.     )
  413.     )
  414.  
  415.     ; else (does not exist)
  416.     (message (cat
  417.         "You do not have reqtools.library installed! \n"
  418.         extramsg
  419.     )
  420.     )
  421.  
  422. )
  423.  
  424. ; Print final status report
  425. (message (cat
  426.         "FetchRefs is installed in                         \n"
  427.         ("%-50s\n" frto)
  428.  
  429.     (if (= frto "SYS:WBStartup")
  430.         "(You need to reboot for FetchRefs to auto-load)   \n"
  431.         ; else
  432.         "(Modify your s:user-startup to make it auto-start)\n"
  433.     )
  434.  
  435.         "\n"
  436.  
  437.         "GenerateIndex is installed in                     \n"
  438.         ("%-50s\n" grto)
  439.         "\n"
  440.  
  441.         ("Installed scripts for: %-27s\n"
  442.         (select editor
  443.             "No editor"
  444.             "CygnusEd"
  445.             "Edge"
  446.             "EMACS"
  447.             "FrexxEd"
  448.             "GoldED"
  449.             "TurboText"
  450.             "Amitex"
  451.         )
  452.         )
  453.  
  454.         (if (= shell_rexx 1)
  455.          "                       The Shell                  \n"
  456.         )
  457.  
  458.         "\n"
  459.  
  460.         (if (= doc 1)
  461.          (cat
  462.            "Documentation is installed in                     \n"
  463.           ("%-50s\n" docto)
  464.            "\n"
  465.          )
  466.         )
  467.  
  468.         "Happy fetching!                                   \n"
  469.      )
  470. )
  471.  
  472. (exit (quiet))
  473.  
  474.