home *** CD-ROM | disk | FTP | other *** search
/ Amiga MA Magazine 1998 #6 / amigamamagazinepolishissue1998.iso / disks / misc / device-handler / install < prev    next >
Text File  |  1981-06-29  |  9KB  |  222 lines

  1. ;
  2. ; $VER: install 34.1 (10 Jun 1995)
  3. ;
  4. ; Installer script for device-handler package.
  5. ;
  6. ; (C) Copyright 1995 Marius Gröger
  7. ;     All Rights Reserved.
  8. ;
  9. ; $HISTORY:
  10. ;
  11. ; 10 Jun 1995 : 034.001 :  initial
  12. ;
  13.  
  14. (set cpu (database "cpu"))
  15. (set level @user-level)
  16. (set #handler       "device-handler")
  17. (set #handler-mount "DEV")
  18. (set #helpfile      "Device-Handler.guide")
  19.  
  20. ; (The installer documentation says not to use this call inside
  21. ; distribtions, but I know no way to let the next decision
  22. ; popping up in novice mode. If you do, please mail to
  23. ; mag@sysgo.de. Thanks.)
  24. (user 2)
  25. (set mode
  26.      (askchoice
  27.          (prompt @app-name)
  28.          (choices "Install" "Remove")
  29.          (help (cat "  Select here wether to install or to remove the " #app-name " package."
  30.                     "\n\n  The installation procedure will copy the handler file, a DOSDriver "
  31.                     "and an AmigaGuide® on-line documentation, requesting your confirmation "
  32.                     "for each file."
  33.                     "\n\n  The removal procedure will try to delete any files from your system "
  34.                     "which are related to the package. However, due to the high flexibility "
  35.                     "of AmigaOS, it may not find them all if some are at unusual places. "
  36.                     "If this is the case, though, you will be experienced enough to remove "
  37.                     "them yourself."))
  38.      )
  39. )
  40. (user level)
  41.  
  42. ; get handler dir
  43. (set handlerdir
  44.         (askdir
  45.                 (prompt "Please locate the directory for handlers:")
  46.                 (help @askdir-help)
  47.                 (default "L:")
  48.         )
  49. )
  50.  
  51. ; get permanent dosdriver dir
  52. (set dosdir_perm
  53.         (askdir
  54.                 (prompt "Please locate the directory for permanently mounted DOS-drivers:")
  55.                 (help (cat "  Select here the directory, where you keep those DOS-drivers "\
  56.                            "that you want to have automatically mounted on system startup. "\
  57.                            "This is DEVS:DOSDrivers directory unless you have modified the 'Mount' "\
  58.                            "statement in your startup-sequence.\n\n"
  59.                            @askdir-help
  60.                       )
  61.                 )
  62.                 (default "DEVS:DOSDrivers")
  63.         )
  64. )
  65.  
  66. ; get storage dosdriver dir
  67. (set dosdir_stor
  68.         (askdir
  69.                 (prompt "Please locate the directory for rarely used DOS-drivers:")
  70.                 (help (cat "  Select here the directory, where you keep those DOS-drivers "\
  71.                            "that you want to use more rarely, mounting them explicitely "\
  72.                            "from the AmigaShell or Workbench. This is the SYS:Storage/DOSDrivers "\
  73.                            "directory for standard Amiga systems.\n\n"
  74.                            @askdir-help
  75.                       )
  76.                 )
  77.                 (default "SYS:Storage/DOSDrivers")
  78.         )
  79. )
  80.  
  81. (user 2)
  82. (if (= mode 0)
  83.    (
  84.       (set perm
  85.          (askchoice (prompt "Do you want to have the DEV: device mounted always, or do you rather "\
  86.                           "like to mount it explicitely from AmigaShell or Workbench ?")
  87.                     (choices "Mount it always" "Only on demand")
  88.                     (help (cat "  Select here wether to copy the DEV DOS-driver into the "\
  89.                                "system drawer that holds the permanent DOS-drivers or "
  90.                                "the one keeping those drivers you can activate using "
  91.                                "the 'Mount' command from AmigaShell or a double-click "\
  92.                                "from Workbench.\n\n"\
  93.                                "  Note that the DEV icon has set the tooltype 'ACTIVATE' "\
  94.                                "set to 0, which tells AmigaDOS to defer the actual loading "\
  95.                                "of the handler-code until the first usage. Therefore "\
  96.                                "you only loose some memory for the AmigaDOS-internal "\
  97.                                "representation of the DOS-driver, if you don't use it.\n\n"
  98.                                @askchoice-help
  99.                           )
  100.                     )
  101.          )
  102.       )
  103.       (set perm (- 1 perm))   ; invert value to make usage more intuitive
  104.    )
  105. )
  106. (user level)
  107.  
  108. ; get dosdriver dir
  109. (set helpdir
  110.         (askdir
  111.                 (prompt "Please locate the directory for AmigaGuide®-Documents:")
  112.                 (help (cat "   Select here the directory where you keep your "\
  113.                            "AmigaGuide® online documents.\n\n"
  114.                             @askdir-help
  115.                       )
  116.                 )
  117.                 (default "HELP:")
  118.         )
  119. )
  120.  
  121. ; now do install or remove
  122. (if mode
  123.         ; Remove
  124.         (
  125.                 ; Show what we are doing
  126.                 (working "Removing " @app-name)
  127.  
  128.                 ; Remove the non-standard pieces
  129.                 (set delfile (tackon handlerdir #handler))
  130.                   (if (exists delfile) (delete delfile))
  131.  
  132.                 (set delfile (tackon "L:" #handler))
  133.                   (if (exists delfile) (delete delfile))
  134.  
  135.                 (set delfile (tackon dosdir_perm #handler-mount))
  136.                   (if (exists delfile) (delete delfile (cat delfile ".info")))
  137.  
  138.                 (set delfile (tackon "DEVS:DOSDrivers" #handler-mount))
  139.                   (if (exists delfile) (delete delfile (cat delfile ".info")))
  140.  
  141.                 (set delfile (tackon "SYS:Storage/DOSDrivers" #handler-mount))
  142.                   (if (exists delfile) (delete delfile (cat delfile ".info")))
  143.  
  144.                 (set delfile (tackon helpdir #helpfile))
  145.                   (if (exists delfile) (delete delfile (cat delfile ".info")))
  146.  
  147.                 (set delfile (tackon "HELP:" #helpfile))
  148.                   (if (exists delfile) (delete delfile (cat delfile ".info")))
  149.  
  150.                 ; Don't want to use the confusing "Installation Complete" message
  151.                 ; when what we really did was remove things...
  152.                 (message "The \"" @app-name "\" package has been removed")
  153.                 (exit (quiet))
  154.         )
  155.  
  156.         ; Install
  157.         (
  158.                 (working "Installing " @app-name)
  159.  
  160.                 ; choose cpu type
  161.                 (set proc
  162.                   (askchoice
  163.                      (prompt (cat "There are diffent versions of \"" #handler "\", each one optimized "
  164.                                   "for a specific CPU type. Please select one: "))
  165.                      (choices "MC68000" "MC68020" "MC68040")
  166.                      (help (cat "  Select here the CPU type that is installed in your system. "
  167.                            "\n\n  Currently, this is a MC" cpu ".\n\n  If you select a certain CPU type "
  168.                            "in the choice box, the \"" #handler "\" will run on any CPU which "
  169.                            "type is higher or equal to the selection. However, it won't "
  170.                            "run on a system equipped with a lower type.\n\n"
  171.                            @askchoice-help)
  172.                      )
  173.                      (default 0)
  174.                   )
  175.                 )
  176.  
  177.                 (copylib
  178.                         (prompt (cat "Copying the handler"))
  179.                         (help @copylib-help)
  180.                         (source (cat (tackon "l" #handler)
  181.                                    (if (= 0 proc) ".000")
  182.                                    (if (= 1 proc) ".020")
  183.                                    (if (= 2 proc) ".040")
  184.                         ))
  185.                         (dest handlerdir)
  186.                         (newname #handler)
  187.                         (confirm)
  188.                 )
  189.  
  190.                 (run (cat "delete >NIL: t:" #handler))
  191.  
  192.                 ; Install the descriptors
  193.                 (copyfiles
  194.                         (prompt "Copying the DOS-driver")
  195.                         (help @copyfiles-help)
  196.                         (source "devs/DOSDrivers")
  197.                         (dest (if perm dosdir_perm dosdir_stor))
  198.                         (pattern (cat #handler-mount "(%|.info)"))
  199.                         (confirm)
  200.                 )
  201.  
  202.                 ; install AmigaGuide file
  203.                 (copyfiles
  204.                         (prompt "Copying AmigaGuide file")
  205.                         (help @copyfiles-help)
  206.                         (source "help")
  207.                         (dest helpdir)
  208.                         (pattern (cat #helpfile "(%|.info)"))
  209.                         (confirm)
  210.                 )
  211.                 ; The standard "Installation Complete" message isn't very appropriate
  212.                 ; for the installation of a handler.
  213.                 (message "The \"" @app-name "\" package has been installed.\n\n"
  214.                        "Depending on where you installed it, type \"mount DEV:\", "
  215.                        "or reboot the system, or double-click on the icon "
  216.                        "in order to use the new device-handler"
  217.                 )
  218.                 (exit (quiet))
  219.         )
  220. )
  221.  
  222.