home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 6 / FreshFish_September1994.bin / new / util / misc / vmm / doc / installvmm < prev    next >
Text File  |  1994-08-21  |  8KB  |  250 lines

  1. ; VMM Installer script by Torsten Ebeling
  2.  
  3. (set @app-name "VMM")
  4.  
  5. (welcome "        Welcome to the VMM installation\n\n"
  6.          "  Virtual Memory for Amigas with a 68030 or 68040\n\n"
  7.          "        Copyright 1993/94 by Martin Apel\n\n"
  8.          "Novice   installs everything except the developer files.\n"
  9.          "Advanced installs everything without confirmation.\n"
  10.          "Expert   installs everything with confirmation of all actions.\n")
  11.  
  12. (if (= 0 @user-level)
  13.     (set install_level %1101)
  14.     (set install_level (askoptions (prompt "What do you want to install ?")
  15.                                    (help   @askoptions-help)
  16.                                    (choices "VMM" "Library (includes VMM)" "Documents" "Icons")))
  17. )
  18.  
  19. (set def_help "\n\nIf you need more help, please refer to \"VMM.guide\"\n\n")
  20. (set my_level @user-level)
  21.  
  22. (if (BITAND %0011 install_level)
  23.   (
  24.     ; Set user mode to NOVICE
  25.     (user 2)
  26.  
  27.     ;get destination directory for "VMM"
  28.     (set vmmdest
  29.          (askdir (prompt "Select the directory where you want to put the VMM executable.")
  30.                  (help   "This should be a directory where you can easily access VMM "
  31.                          "via Workbench or CLI/Shell." def_help
  32.                          @askdir-help)
  33.                  (default "work:")
  34.                  (disk)
  35.          )
  36.     )
  37.  
  38.     (set @default-dest vmmdest)
  39.     (set vmmtacked (tackon vmmdest "VMM"))
  40.  
  41.     ; ask, if we want to overwrite the old VMM if it exists
  42.     (if (= 1 (exists vmmtacked))
  43.       (
  44.         (set old_version (getversion "l:VMM-Handler"))
  45.         (set old_ver (/ old_version 65536))
  46.         (set old_rev (- old_version (* old_ver 65536)))
  47.  
  48.         (set new_version (getversion "l/VMM-Handler_4K"))
  49.         (set new_ver (/ new_version 65536))
  50.         (set new_rev (- new_version (* new_ver 65536)))
  51.  
  52.         (if (= 0 (askbool (prompt "\nYou have already installed VMM "
  53.                                   old_ver "." old_rev
  54.                                   ".\nDo you wish to overwrite it with VMM "
  55.                                   new_ver "." new_rev " ?\n")
  56.                           (help def_help @askbool-help)
  57.                           (default 1)
  58.                           (choices "Yes" "No")))
  59.             (exit "VMM not installed.")
  60.         )
  61.       )
  62.     )
  63.  
  64.     ; Set user mode to EXPERT
  65.     (user my_level)
  66.  
  67.     ; detect the pagesize (4K or 8K)
  68.     (set pagesize (run "ShowPageSize"))
  69.  
  70.     (if (BITAND %01 pagesize)
  71.         (set sizestr "4K")
  72.      else
  73.         (if (BITAND %10 pagesize)
  74.            (set sizestr "8K")
  75.         )
  76.     )
  77.  
  78.     (set pagesize (askchoice (prompt "\nPlease select the pagesize:\n\n"
  79.                                      " ShowpageSize detected a pagesize of "
  80.                                      sizestr ".\n")
  81.                              (help   def_help @askchoice-help)
  82.                              (choices "4K pagesize" "8K pagesize")
  83.                              (default (- pagesize 1)))
  84.     )
  85.  
  86.     ; copy the new VMM file to the destination directory
  87.     (copyfiles (prompt ("\nCopying VMM to %s." vmmdest))
  88.                (help   def_help @copyfiles-help)
  89.                (optional "oknodelete")
  90.                (optional "askuser")
  91.                (source "")
  92.                (choices  "VMM" "VMMStat")
  93.                (dest     vmmdest)
  94.                (confirm)
  95.     )
  96.  
  97.     ; copy the .info files
  98.     (if (BITAND %1000 install_level)
  99.       (copyfiles (prompt ("\nCopying VMMStat to %s." vmmdest))
  100.                  (help   def_help @copyfiles-help)
  101.                  (source "")
  102.                  (choices  "VMM.info" "VMMStat.info")
  103.                  (dest    vmmdest)
  104.                  (confirm)
  105.       )
  106.     )
  107.  
  108.     ; copy the new VMM-Handler file to l: and rename it as "VMM-Handler"
  109.     (set handler_name (cat "l/VMM-Handler_" sizestr))
  110.     (copyfiles (prompt "\nCopying VMM-Handler to l:.")
  111.                (help   def_help @copyfiles-help)
  112.                (optional "oknodelete")
  113.                (optional "askuser")
  114.                (source  handler_name)
  115.                (dest    "l:")
  116.                (newname "VMM-Handler")
  117.                (confirm)
  118.     )
  119.  
  120.     ; ask, if we want to overwrite the old preferences file
  121.     (if (= 1 (exists "envarc:VMM.prefs"))
  122.         (if (= 0 (askbool (prompt "\nYou have already installed a preferences file.\nDo you wish to overwrite it ?\n\n")
  123.                           (help def_help @askbool-help)
  124.                           (default 0)
  125.                           (choices "Yes" "No")))
  126.             ; then
  127.               (set overwrite 0)
  128.             ; else
  129.               (set overwrite 1)
  130.         )
  131.     )
  132.  
  133.     (if (= 1 overwrite)
  134.       (
  135.         ; copy the new preferences file to env: and envarc:
  136.         (copyfiles (prompt ("\nCopying VMM.prefs to env:\n"))
  137.                    (help   def_help @copyfiles-help)
  138.                    (optional "oknodelete")
  139.                    (optional "askuser")
  140.                    (source  "env/VMM.prefs")
  141.                    (dest    "env:")
  142.                    (confirm)
  143.         )
  144.         (copyfiles (prompt ("\nCopying VMM.prefs to envarc:\n"))
  145.                    (help   def_help @copyfiles-help)
  146.                    (optional "oknodelete")
  147.                    (optional "askuser")
  148.                    (source  "env/VMM.prefs")
  149.                    (dest    "envarc:")
  150.                    (confirm)
  151.         )
  152.       )
  153.     )
  154.   )
  155. )
  156.  
  157. (if (BITAND %0010 install_level)
  158.     (
  159.       (copylib (prompt ("\nCopying VMM.library to libs:."))
  160.                (help   def_help @copyfiles-help)
  161.                (optional "oknodelete")
  162.                (optional "askuser")
  163.                (source  "libs/VMM.library")
  164.                (dest    "libs:")
  165.                (confirm)
  166.       )
  167.  
  168.       (if (exists ("fd:") (noreq))
  169.           ; then
  170.             (set fd_dir "fd:")
  171.           ; else
  172.             (set fd_dir
  173.                  (askdir (prompt "Select the directory where you want to put the fd file.")
  174.                          (help   def_help  @askdir-help)
  175.                          (default "WORK:")
  176.                          (disk)
  177.                  )
  178.             )
  179.       )
  180.  
  181.       (copyfiles (prompt ("\nCopying VMM_lib.fd to " fd_dir "."))
  182.                  (help   def_help @copyfiles-help)
  183.                  (optional "oknodelete")
  184.                  (optional "askuser")
  185.                  (source  "fd/VMM_lib.fd")
  186.                  (dest    fd_dir)
  187.                  (confirm)
  188.       )
  189.  
  190.       (if (exists ("lib:") (noreq))
  191.           ; then
  192.             (set lib_dir "lib:")
  193.           ; else
  194.             (set lib_dir
  195.                  (askdir (prompt "Select the directory where you want to put the lib file.")
  196.                          (help   def_help  @askdir-help)
  197.                          (default "WORK:")
  198.                          (disk)
  199.                  )
  200.             )
  201.       )
  202.  
  203.       (copyfiles (prompt ("\nCopying VMM_lib.lib to " lib_dir "."))
  204.                  (help   def_help @copyfiles-help)
  205.                  (optional "oknodelete")
  206.                  (optional "askuser")
  207.                  (source  "lib/VMM_lib.lib")
  208.                  (dest    lib_dir)
  209.                  (confirm)
  210.       )
  211.     )
  212. )
  213.  
  214. (if (BITAND %0100 install_level)
  215.     (
  216.       ;get destination directory for "VMM.guide"
  217.       (user 2)
  218.       (set vmmdocs
  219.            (askdir (prompt "Select the directory where you want to put\nthe documents and guides.")
  220.                    (help   "This should be the directory where you normally put your guides.\n\n"
  221.                            def_help @askdir-help)
  222.                    (default "WORK:")
  223.                    (disk)
  224.            )
  225.       )
  226.       (user my_level)
  227.  
  228.       (copyfiles (prompt ("\nCopying VMM.guide to " vmmdocs "."))
  229.                  (help   def_help @copyfiles-help)
  230.                  (optional "oknodelete")
  231.                  (optional "askuser")
  232.                  (source  "doc")
  233.                  (choices "VMM.guide" "VMM_lib.doc")
  234.                  (dest    vmmdocs)
  235.                  (confirm)
  236.       )
  237.  
  238.       (if (BITAND %1000 install_level)
  239.         (copyfiles (prompt ("\nCopying VMM.guide to %s." vmmdocs))
  240.                    (help   def_help @copyfiles-help)
  241.                    (source  "doc")
  242.                    (choices "VMM.guide.in