home *** CD-ROM | disk | FTP | other *** search
/ AMIGA PD 1 / AMIGA-PD-1.iso / Aminet / Tools / Useful / ARCHandler / Install < prev    next >
Text File  |  1994-07-18  |  7KB  |  327 lines

  1. ; Installer installation script for the arc-handler
  2. ;$VER:Install 37.7 (17.7.94)
  3.  
  4. (set @default-dest "")
  5.  
  6. (set handler "L/arc-handler")
  7. (set flusharc "C/FlushARC")
  8. (set default-archivename "Archives")
  9. (set default-tempdir "T:")
  10. (set mountlist-header "S/MountList-header")
  11. (set temp-dosdriver "T:ARC")
  12. (set dosdriver-icon "ARC.info")
  13.  
  14. ;================================================================================
  15. ; English strings
  16.  
  17. (set #bad-kick
  18.   (cat "You must have Kickstart 2.04 or higher installed to use the ARCHandler!")
  19. )
  20.  
  21. (set #welcome
  22.   (cat "\nARCHandler installation\n\n\n"
  23.              "This script installs ARCHandler 1.0a\n"
  24.              "on your Amiga.\n\n\n\n"
  25.              "ARCHandler © 1994 Rafael D'Halleweyn\n"
  26.              "All rights reserved")
  27. )
  28.  
  29. (set #copying-handler "Copying the arc-handler to your L: drawer.")
  30.  
  31. (set #copying-handler-help
  32.   (cat "For the ARCHandler to work the arc-handler has to be copied "
  33.        "to the L: directory. All FileSystems and handlers reside in "
  34.        "this directory.\n\n")
  35. )
  36.  
  37. (set #flusharc-dest "Where do you want to install the FlushARC command?")
  38.  
  39. (set #flusharc-dest-help
  40.   (cat "The FlushARC command allows you to manually flush the buffers "
  41.        "of the arc-handler.\n\n")
  42. )
  43.  
  44. (set #ask-archivename "Enter the name for the ARC volume:")
  45.  
  46. (set #ask-archivename-help
  47.   (cat "The ARC volume name is the name that will appear under the icon "
  48.        "in the Workbench window.\n\n")
  49. )
  50.  
  51. (set #ask-lhacommand "Please select the path to the LhA command:")
  52.  
  53. (set #ask-lhacommand-help
  54.   (cat "For the ARCHandler to work correctly it has to known where "
  55.        "it can find the LhA command. If you want to use a resident "
  56.        "LhA (=faster ARCHandler) use an empty 'Current Drawer' field "
  57.        "and make sure LhA is resident.\n\n")
  58. )
  59.  
  60. (set #ask-tempdir "Please select a drawer to store temporary files:")
  61.  
  62. (set #ask-tempdir-help
  63.   (cat "For the ARCHandler to work correctly it has to have a place to store "
  64.        "its temporary files. All the files that are extracted from the "
  65.        "archives are placed in this drawer. If you have lots of RAM you "
  66.        "should use a drawer on the Ram Disk, otherwise use a drawer on "
  67.        "disk.\n\n")
  68. )
  69.  
  70. (set #make-mountlist "Adding ARC to DEVS:MountList.")
  71.  
  72. (set #make-mountlist-help
  73.   (cat "For the (Workbench 2.04) Mount command to be able to mount "
  74.        "FileSystems and Handlers, it has to know certain things about "
  75.        "these handlers. These things are described in DEVS:MountList.\n\n")
  76. )
  77.  
  78. (set #make-dosdriver-help
  79.   (cat "For the (Workbench 2.1 and up) Mount command to be able to mount "
  80.        "File Systems and Handlers, it has to know certain things about "
  81.        "these handlers. These things are described by files in the "
  82.        "SYS:Storage/DOSDrivers/ and DEVS:DOSDrivers/ drawers.\n\n")
  83. )
  84.  
  85. (set #startup
  86.   (cat "Always mount ARC: on start-up?")
  87. )
  88.  
  89. (set #startup-help
  90.   (cat "This will add the line 'Mount ARC:' to your S:User-Startup, so "
  91.        "that ARC: is always mounted.")
  92. )
  93.  
  94. (set #dosdriver-dest
  95.   (cat "Always mount ARC: on start-up?")
  96. )
  97.  
  98. (set #dosdriver-dest-help
  99.   (cat "This will place the DOSDriver in the DEVS:DOSDrivers/ drawer, "
  100.        "otherwise it's placed in the SYS:Storage/DOSDrivers/ drawer.")
  101. )
  102.  
  103. ;================================================================================
  104. ; make sure we are running under a 2.04 ROM
  105.  
  106. (if (< (/ (getversion) 65536) 37)
  107.   (
  108.     (abort #bad-kick)
  109.   )
  110. )
  111.  
  112. ;================================================================================
  113. ;
  114.  
  115. (complete 0)
  116.  
  117. (message #welcome)
  118.  
  119. (welcome)
  120.  
  121. (copylib
  122.   (prompt "\n" #copying-handler)
  123.   (help #copying-handler-help @copylib-help)
  124.   (source handler)
  125.   (dest "L:")
  126.   (confirm)
  127. )
  128.  
  129. (complete 25)
  130.  
  131. (set flusharc-dest
  132.   (askdir
  133.     (prompt #flusharc-dest)
  134.     (help #flusharc-dest-help @askdir-help)
  135.     (default "C:")
  136.   )
  137. )
  138.  
  139. (copylib
  140.   (prompt "\nCopying the FlushARC command to your " flusharc-dest " drawer.")
  141.   (help @copylib-help)
  142.   (source flusharc)
  143.   (dest flusharc-dest)
  144.   (confirm)
  145. )
  146.  
  147. (complete 50)
  148.  
  149. ; now comes the tricky bit, we're going to make the MountList (2.04)
  150. ; or the DOSDriver Mount script (2.1 and higher).
  151.  
  152. (set old_level @user-level)
  153. (user 2)
  154.  
  155. (set archivename
  156.   (askstring
  157.     (prompt "\n" #ask-archivename)
  158.     (help #ask-archivename-help @askstring-help)
  159.     (default default-archivename)
  160.   )
  161. )
  162.  
  163. (complete 60)
  164.  
  165. (user 0)
  166. (run "Execute S/WhichLhA"
  167.   (safe)
  168. )
  169. (user 2)
  170. (set default-lhacommand (getenv "lhapath"))
  171.  
  172. (set lhacommand
  173.   (askfile
  174.     (prompt #ask-lhacommand)
  175.     (help #ask-lhacommand-help @askfile-help)
  176.     (default default-lhacommand)
  177.   )
  178. )
  179.  
  180. (complete 70)
  181.  
  182. (set tempdir
  183.   (askdir
  184.     (prompt #ask-tempdir)
  185.     (help #ask-tempdir-help @askdir-help)
  186.     (default default-tempdir)
  187.     (disk)
  188.   )
  189. )
  190.  
  191. (complete 80)
  192.  
  193. (set startup-msg
  194.   (cat
  195.     "\"NAME='"
  196.     archivename
  197.     "' LHA='"
  198.     lhacommand
  199.     "' TEMPDIR='"
  200.     tempdir
  201.     "' BUFFERS=2\""
  202.   )
  203. )
  204.  
  205. (complete 90)
  206.  
  207. (if (< (/ (getversion "LIBS:version.library") 65536) 38)
  208.   (
  209.  
  210. ; Workbench 2.04
  211.  
  212. ; Make DOSDriver
  213.     (textfile
  214.       (dest temp-dosdriver)
  215.       (include mountlist-header)
  216.       (append
  217.         (cat
  218.           "Handler        = L:arc-handler\n"
  219.           "Startup        = "
  220.             startup-msg
  221.             "\n"
  222.           "Mount        = 1\n"
  223.           "StackSize    = 4096\n"
  224.           "GlobVec        = -1\n")
  225.         (safe)
  226.       )
  227.     )
  228.  
  229. ; Now transform DOSDriver to MountList entry.
  230.  
  231.     (if (< old_level 2)
  232.       (user 0)
  233.       (user 2)
  234.     )
  235.  
  236.     (run "C/MountListEntry ARC: " temp-dosdriver
  237.       (prompt "\n" #make-mountlist)
  238.       (help #make-mountlist-help)
  239.       (confirm)
  240.     )
  241.  
  242.     (complete 95)
  243.     (user 2)
  244.  
  245.     (startup
  246.       "ARCHandler"
  247.       (prompt #startup)
  248.       (help #startup-help @startup-help)
  249.       (command "Mount >NIL: ARC:")
  250.     )
  251.  
  252.   )
  253.   (
  254.  
  255. ; Make DOSDriver
  256.     (textfile
  257.       (dest temp-dosdriver)
  258.       (include mountlist-header)
  259.       (append
  260.         (cat
  261.           "Handler        = L:arc-handler\n"
  262.           "StackSize    = 4096\n"
  263.           "GlobVec        = -1\n"
  264.           "\n"
  265.           "/*\n"
  266.           "** The Startup and Mount fields are in the tool types of the icon.\n"
  267.           "*/\n")
  268.         (safe)
  269.       )
  270.     )
  271.  
  272. ; move DOSDriver to SYS:Storage/DOSDriver and add an icon with the
  273. ; right tooltypes.
  274.     (set dosdriver-dest
  275.       (if (askbool
  276.             (prompt "\n" #dosdriver-dest)
  277.             (help #dosdriver-dest-help)
  278.             (default 0)
  279.             (choices "Yes" "No")
  280.           )
  281.         "DEVS:DOSDrivers/"
  282.         "SYS:Storage/DOSDrivers/"
  283.       ))
  284.  
  285.     (if (< old_level 2)
  286.       (user 0)
  287.       (user 2)
  288.     )
  289.  
  290.     (if (askbool
  291.           (prompt "\n" "Adding ARC to the " dosdriver-dest " drawer")
  292.           (help #make-dosdriver-help)
  293.           (default 1)
  294.           (choices "Proceed" "Skip This Part")
  295.         )
  296.       (
  297.  
  298.         (copyfiles
  299.           (source temp-dosdriver)
  300.           (dest dosdriver-dest))
  301.         (complete 94)
  302.         (copyfiles
  303.           (source dosdriver-icon)
  304.           (dest dosdriver-dest))
  305.         (complete 98)
  306.         (tooltype
  307.           (dest (cat dosdriver-dest "ARC"))
  308.           (setdefaulttool "C:Mount")
  309.           (noposition)
  310.           (setstack 4096)
  311.           (settooltype "STARUP" startup-msg)
  312.           (settooltype "MOUNT" "1")
  313.           (settooltype "WINDOW"))
  314.         (protect (cat dosdriver-dest "ARC") 2)
  315.       )
  316.     )
  317.  
  318.   )
  319. )
  320.  
  321. (delete temp-dosdriver
  322.   (safe)
  323. )
  324.  
  325. (complete 100)
  326. (exit)
  327.