home *** CD-ROM | disk | FTP | other *** search
/ Magazyn Amiga Shareware Floppies / ma64.dms / ma64.adf / FTPMount-1.0 / Install < prev    next >
Text File  |  1995-08-16  |  9KB  |  358 lines

  1. ; FTPMount install script
  2. ; Date : 7-Aug-95
  3. ; Version 0.1
  4.  
  5. (transcript "Installing FTPMount ...")
  6.  
  7. (welcome "Greetings!\nYou are about to install FTPMount on your system.  "
  8.             "This is a wise choice.\n")
  9.  
  10. (set name 
  11.     (askdir
  12.         (prompt "Where should FTPMount be installed?")
  13.         (help
  14.             "All of FTPMount's files will be installed in one directory, "
  15.             "called FTPMountDir, which will be placed in the directory you specify "
  16.             "here.  This directory will have the logical assign of FTPMountDir: "
  17.             "associated with it.  You will probably need to be able to access this "
  18.             "directory fairly often, so don't bury it too deep.\n\n"
  19.             @askdir-help
  20.         )
  21.         (default @default-dest)
  22.     )
  23. )
  24.  
  25. (makeassign "FTPMountDir" name)
  26.  
  27. (set @default-dest name)
  28.  
  29. (makedir "FTPMountDir:FTPMountDir" (infos))
  30.  
  31. (if @pretend
  32.     (makeassign "FTPMountDir" "T:" (safe))
  33.     (makeassign "FTPMountDir" "FTPMountDir:FTPMountDir")
  34. )
  35.  
  36. (set @default-dest (getassign "FTPMountDir" "a"))
  37.  
  38. (if (exists "DEVS:DOSDrivers")
  39.    (
  40.         (startup "FTPMount" 
  41.             (prompt "Adding assign of FTPMountDir: to User-Startup")
  42.             (help 
  43.                 "FTPMount uses the FTPMountDir: assign to work out where its files are.\n\n"
  44.                 @startup-help
  45.             )
  46.             (command (cat "assign FTPMountDir: " (getassign "FTPMountDir" "a") "\n"))
  47.         )
  48.     )
  49.     ; else
  50.     (
  51.         (startup "FTPMount"
  52.            (prompt "Adding assign of FTPMountDir: and mount of FTP: to User-Startup")
  53.            (help
  54.                "FTPMount uses the FTPMountDir: assign to work out where its files are.\n\n"
  55.                @startup-help
  56.            )
  57.            (command (cat "assign FTPMountDir: " (getassign "FTPMountDir" "a") "\n"
  58.                             "mount FTP: from FTPMountDir:L/FTPMountList\n"))
  59.         )
  60.     )
  61. )
  62.  
  63. (makedir "FTPMountDir:Hosts" (infos))
  64.  
  65. (makedir "FTPMountDir:L")
  66.  
  67. (if (exists "DEVS:DOSDrivers")
  68.     (
  69. ; this will be a v39 or v40 system with DEVS:Dosdrivers etc and 
  70. ; workbench-launchable mount
  71.         (set ddest
  72.             (askchoice
  73.                 (prompt
  74.                     "Where do you want to install the DOSDriver mount entry?\n\n"
  75.                     "NB:  If the entry is put in DEVS:DOSDrivers it is inadvisable "
  76.                     "for it to be activated upon mounting."
  77.                 )
  78.                 (help
  79.                     "This file tells the system where to find FTPMount-Handler and what "
  80.                     "to do with it.  The standard places to find DOSDriver mount entries are "
  81.                     "DEVS:DOSDrivers and SYS:Storage/DOSDrivers.  "
  82.                     "SYS:WBStartup is a little unorthodox, however it seems to be the only "
  83.                     "place that is guaranteed to work and mount FTP: safely upon system "
  84.                     "startup time.  If you elect to put the FTP: entry in DEVS:DOSDrivers "
  85.                     "or SYS:WBStartup it will be mounted at boot time.  If you "
  86.                     "put it anywhere else, then you will have to explicitly mount it before "
  87.                     "you can reference FTP: ... either by double clicking on the icon, or, if "
  88.                     "you have placed the entry in Storage, by typing 'mount FTP:' from a CLI.\n\n"
  89.                     "NB:  Mounting from DEVS:DOSDrivers is done at boot time before the assign "
  90.                     "of FTPMountDir: is done.  Because of this it is inadvisable for an entry to "
  91.                     "be put in DEVS:DOSDrivers if you want it to be activated at boot time.  Put "
  92.                     "it in SYS:WBStartup (or equivalent) instead in this case."
  93.                 )
  94.                 (choices "SYS:WBStartup" "DEVS:DOSDrivers" "SYS:Storage/DOSDrivers" "Elsewhere")
  95.             )
  96.         )
  97.  
  98.         (if (= ddest 3)
  99.             (set name
  100.                 (askdir
  101.                     (prompt "Where do you want to put the FTP: DOSDriver mount entry?")
  102.                     (help @askdir-help)
  103.                     (default "SYS:WBStartup")
  104.                 )
  105.             )
  106.         )
  107.  
  108.         (set dact
  109.             (askbool
  110.                 (prompt
  111.                     "Do you want the DOSDriver to be activated upon mounting?"
  112.                     (if (= ddest 1) 
  113.                         (cat
  114.                             "\n\nNB: It is inadvisable to say \"Yes\" here since FTPMountDir: will "
  115.                             "not have been assigned when DEVS:DOSDrivers/FTP is mounted."
  116.                         )
  117.                         ""
  118.                     )
  119.                 )
  120.                 (help
  121.                     (if (<= ddest 1) "FTP: will be mounted at boot time, however, " "When FTP: is mounted ")
  122.                     "you have the option of making it active at this time, or leaving it inactive "
  123.                     "until you first reference a file or directory on FTP:.  "
  124.                     "The main difference is that when FTP: is not active there is no icon associated "
  125.                     "with the device, and so it will not appear on Workbench.  Leaving it inactive "
  126.                     "means that no memory is used by the device until it is actually referenced.\n\n"
  127.                     "NB:  Mounting from DEVS:DOSDrivers is done at boot time before the assign "
  128.                     "of FTPMountDir: is done.  Because of this it is inadvisable for an entry in "
  129.                     "DEVS:DOSDrivers to be auto-activated."
  130.                 )
  131.                 (default 1)
  132.             )
  133.         )
  134.  
  135.         (if (= ddest 0)
  136.             (
  137.                 (copyfiles
  138.                     (source "DOSDrivers/FTP")
  139.                     (dest "SYS:WBStartup")
  140.                     (infos)
  141.                 )
  142.                 (if dact
  143.                     (tooltype
  144.                         (dest "SYS:WBStartup/FTP")
  145.                         (settooltype "ACTIVATE" "1")
  146.                     )
  147.                 )
  148.             )
  149.         )
  150.  
  151.         (if (= ddest 1)
  152.             (
  153.                 (copyfiles
  154.                     (source "DOSDrivers/FTP")
  155.                     (dest "DEVS:DOSDrivers")
  156.                     (infos)
  157.                 )
  158.                 (if dact
  159.                     (tooltype
  160.                         (dest "DEVS:DOSDrivers/FTP")
  161.                         (settooltype "ACTIVATE" "1")
  162.                     )
  163.                 )
  164.             )
  165.         )
  166.  
  167.         (if (= ddest 2)
  168.             (
  169.                 (copyfiles
  170.                     (source "DOSDrivers/FTP")
  171.                     (dest "SYS:Storage/DOSDrivers")
  172.                     (infos)
  173.                 )
  174.                 (if dact
  175.                     (tooltype
  176.                         (dest "Sys:Storage/DOSDrivers/FTP")
  177.                         (settooltype "ACTIVATE" "1")
  178.                     )
  179.                 )
  180.             )
  181.         )
  182.  
  183.         (if (= ddest 3)
  184.         ; name will have been set previously
  185.             (
  186.                 (copyfiles
  187.                     (source "DOSDrivers/FTP")
  188.                     (dest name)
  189.                     (infos)
  190.                 )
  191.                 (makeassign "FTPMount_temp" name (safe))
  192.                 (if dact
  193.                     (tooltype
  194.                         (dest "FTPMount_temp:FTP")
  195.                         (settooltype "ACTIVATE" "1")
  196.                     )
  197.                 )
  198.                 (makeassign "FTPMount_temp" (safe))
  199.             )
  200.         )
  201.     )
  202. ; else
  203.     (
  204. ; this is a pre-v39 system and the mount entry has to be in a mountlist file
  205.         (set dact
  206.             (askbool
  207.                 (prompt
  208.                     "Do you want the DOSDriver to be activated upon mounting?"
  209.                 )
  210.                 (help
  211.                     "FTP: will be mounted at boot time, however, "
  212.                     "you have the option of making it active at this time, or leaving it inactive "
  213.                     "until you first reference a file or directory on FTP:.  "
  214.                     "The main difference is that when FTP: is not active there is no icon associated "
  215.                     "with the device, and so it will not appear on Workbench.  Leaving it inactive "
  216.                     "means that no memory is used by the device until it is actually referenced.\n"
  217.                 )
  218.                 (default 1)
  219.             )
  220.         )
  221.  
  222.         (textfile
  223.             (prompt "Creating the mountlist for FTP:")
  224.             (help "To mount FTP: we need to supply some parameters to mount in the "
  225.                     "from of a mountlist.  This file will be FTPMountDir:L/FTPMountList."
  226.             )
  227.             (dest "FTPMountDir:L/FTPMountList")
  228.             (append (cat 
  229.                 "FTP:\n"
  230.                 "\tHandler = FTPMountDir:L/FTPMount-Handler\n"
  231.                 "\tStackSize = 6000\n"
  232.                 "\tPriority = 2\n"
  233.                 "\tGlobVec = -1\n"
  234.                 (if dact "\tMount = 1\n" "")
  235.                 "#\n"
  236.             ))
  237.         )
  238.     )
  239. )
  240.  
  241. (if (trap -1 (getenv "USER"))
  242.     (
  243.         (set name
  244.             (askstring
  245.                 (prompt
  246.                     "The USER environment variable needs to be set to your standard user name:"
  247.                 )
  248.                 (help
  249.                     "For anonymous logins, your email address is required.  FTPMount looks at "
  250.                     "the USER and HOST environment variables to construct your email address "
  251.                     "as USER@HOST.  Please enter a valid user name here.  This name will be "
  252.                     "saved to ENVARC:USER.\n\n"
  253.                     @askstring-help
  254.                 )
  255.                 (default "")
  256.             )
  257.         )
  258.         (textfile
  259.             (dest "ENVARC:USER")
  260.             (append name)
  261.         )
  262.         (textfile
  263.             (dest "ENV:USER")
  264.             (append name)
  265.         )
  266.     )
  267. )
  268.  
  269. (if (trap -1 (getenv "HOST"))
  270.     (
  271.         (set name
  272.             (askstring
  273.                 (prompt
  274.                     "The HOST environment variable needs to be set to your email host:"
  275.                 )
  276.                 (help
  277.                     "For anonymous logins, your email address is required.  FTPMount looks at "
  278.                     "the USER and HOST environment variables to construct your email address "
  279.                     "as USER@HOST.  Please enter a valid email host here.  This name will be "
  280.                     "saved to ENVARC:HOST.\n\n"
  281.                     @askstring-help
  282.                 )
  283.                 (default "")
  284.             )
  285.         )
  286.         (textfile
  287.             (dest "ENVARC:HOST")
  288.             (append name)
  289.         )
  290.         (textfile
  291.             (dest "ENV:HOST")
  292.             (append name)
  293.         )
  294.     )
  295. )
  296.  
  297. (copyfiles
  298.     (prompt "Which catalogs do you want to install?")
  299.     (help 
  300.         "If you want FTPMount to use a language other than English "
  301.         "(or you wish to modify the English used by FTPMount) "
  302.         "then you will need to install the relevant catalogs.  "
  303.         "You don't need to install any catalogs, in which case "
  304.         "FTPMount will use its default English informative information.\n\n"
  305.         @askoptions-help
  306.     )
  307.     (source "Catalogs")
  308.     (dest "FTPMountDir:Catalogs")
  309.     (all)
  310.     (confirm)
  311. )
  312.  
  313. (copylib
  314.     (source "L/FTPMount-Handler")
  315.     (dest "FTPMountDir:L")
  316. )
  317.  
  318. (if
  319.     (askbool
  320.         (prompt
  321.             "Do you want the example Hosts installed?"
  322.         )
  323.         (help
  324.             "Some example sub-directories of Hosts are available "
  325.             "to give some idea of how the various tooltype options "
  326.             "can be used."
  327.         )
  328.         (default 1)
  329.     )
  330. ; then
  331.     (copyfiles 
  332.         (source "Hosts")
  333.         (dest "FTPMountDir:Hosts")
  334.         (all)
  335.     )
  336. )
  337.  
  338. (if
  339.     (askbool
  340.         (prompt
  341.             "Do you want the documentation file installed?"
  342.         )
  343.         (help
  344.             "Do you want the documentation file copied over to FTPMountDir: "
  345.             "for future reference?"
  346.         )
  347.         (default 1)
  348.     )
  349. ; then
  350.     (copyfiles
  351.         (source "FTPMount.guide")
  352.         (dest "FTPMountDir:")
  353.         (infos)
  354.     )
  355. )
  356.  
  357. (exit "A reboot now is recommended before you use FTP:")
  358.