home *** CD-ROM | disk | FTP | other *** search
/ Magazyn Amiga Shareware Floppies / ma30.dms / ma30.adf / VMM / InstallVMM < prev    next >
Text File  |  1994-09-23  |  11KB  |  332 lines

  1. ; VMM Installer script by Martin Apel
  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) ; then
  13.     (set install_level %0111)
  14. ;else
  15.     (set install_level (askoptions (prompt "What do you want to install ?")
  16.                                    (help   @askoptions-help)
  17.                                    (choices "VMM" "Icons" "Documents" "Developer files")))
  18. )
  19.  
  20. (set def_help "\n\nIf you need more help, please refer to \"VMM.guide\"\n\n")
  21.  
  22. (set my_level @user-level)
  23. (user 2)
  24. (set vmmdest
  25.     ;get destination directory for "VMM"
  26.      (askdir (prompt "Select the directory where you want to put the VMM executable.")
  27.              (help   "This should be a directory where you can easily access VMM "
  28.                      "via Workbench or CLI/Shell." def_help
  29.                      @askdir-help)
  30.              (default @default-dest)
  31.              (disk)
  32.      )
  33. )
  34. (user my_level)
  35.  
  36. (set copy_vmm   (BITAND %0001 install_level))
  37. (set copy_icons (BITAND %0010 install_level))
  38. (set copy_docs  (BITAND %0100 install_level))
  39. (set copy_dev   (BITAND %1000 install_level))
  40.  
  41. ; Copy VMM files
  42.  
  43. (if copy_vmm
  44.   (
  45.     (set @default-dest vmmdest)
  46.     (set vmmtacked (tackon vmmdest "VMM"))
  47.  
  48.     ; ask, if we want to overwrite the old VMM if it exists
  49.     (set overwrite 1)
  50.     (if (exists "L:VMM-Handler")
  51.       (
  52.         (set old_version (getversion "l:VMM-Handler"))
  53.         (set old_ver (/ old_version 65536))
  54.         (set old_rev (- old_version (* old_ver 65536)))
  55.  
  56.         (set new_version (getversion "l/VMM-Handler_4K"))
  57.         (set new_ver (/ new_version 65536))
  58.         (set new_rev (- new_version (* new_ver 65536)))
  59.  
  60.         (set overwrite (askbool (prompt "\nYou have VMM "
  61.                                          old_ver "." old_rev " already installed"
  62.                                         ".\nDo you wish to overwrite it with VMM "
  63.                                          new_ver "." new_rev " ?\n")
  64.                                 (help def_help @askbool-help)
  65.                                 (default 1)
  66.                                 (choices "Yes" "No"))
  67.  
  68.         )
  69.       )
  70.     )
  71.  
  72.     (if overwrite
  73.         (
  74.            ; detect the pagesize (4K or 8K)
  75.            (set pagesize (run "ShowPageSize"))
  76.  
  77.            (select pagesize
  78.              (abort "Internal error in Installer script")
  79.              ((set info_string "A pagesize of 4K is usable on your system")
  80.               (set default_choice 0))
  81.              ((set info_string "A pagesize of 8K is usable on your system")
  82.               (set default_choice 1))
  83.              ((set info_string "Either pages of 4K or 8K are usable on your system")
  84.               (set default_choice 0))
  85.            )
  86.  
  87.            (set my_choice (askchoice (prompt "\nPlease select the pagesize:\n\n"
  88.                                            info_string ".\n")
  89.                                    (help   def_help @askchoice-help)
  90.                                    (choices "4K pagesize" "8K pagesize")
  91.                                    (default default_choice))
  92.            )
  93.  
  94.            (select my_choice
  95.             (set sizestr "4K")
  96.             (set sizestr "8K")
  97.            )
  98.  
  99.            ; copy the new VMM file to the destination directory
  100.            (if copy_icons
  101.               ; then
  102.                 (copyfiles (prompt ("\nCopying VMM to %s." vmmdest))
  103.                            (help   def_help @copyfiles-help)
  104.                            (optional "oknodelete")
  105.                            (optional "askuser")
  106.                            (source "")
  107.                            (choices  "VMM" "VMMStat")
  108.                            (dest     vmmdest)
  109.                            (infos)
  110.                            (confirm)
  111.                 )
  112.               ; else
  113.                 (copyfiles (prompt ("\nCopying VMM to %s." vmmdest))
  114.                            (help   def_help @copyfiles-help)
  115.                            (optional "oknodelete")
  116.                            (optional "askuser")
  117.                            (source "")
  118.                            (choices  "VMM" "VMMStat")
  119.                            (dest     vmmdest)
  120.                            (confirm)
  121.                 )
  122.            )
  123.  
  124.            ; copy the new VMM-Handler file to l: and rename it as "VMM-Handler"
  125.            (set handler_name (cat "l/VMM-Handler_" sizestr))
  126.            (copyfiles (prompt "\nCopying VMM-Handler to l:.")
  127.                       (help   def_help @copyfiles-help)
  128.                       (optional "oknodelete")
  129.                       (optional "askuser")
  130.                       (source  handler_name)
  131.                       (dest    "l:")
  132.                       (newname "VMM-Handler")
  133.                       (confirm)
  134.            )
  135.         )
  136.      )
  137.  
  138.  
  139.  
  140.     ; ask, if we want to overwrite the old preferences file
  141.     ; default: do overwrite preferences file
  142.     (set overwrite 1)
  143.     (if (exists "envarc:VMM.prefs")
  144.         (if (= 0 (askbool (prompt "\nYou have a preferences file already installed.\nDo you wish to overwrite it ?\n\n")
  145.                      (help def_help @askbool-help)
  146.                      (default 0)
  147.                      (choices "Yes" "No"))
  148.               (set overwrite 0)
  149.         ))
  150.     )
  151.  
  152.     (if overwrite
  153.       (
  154.         ; copy the new preferences file to env: and envarc:
  155.         (copyfiles (prompt ("\nCopying VMM.prefs to env:\n"))
  156.                    (help   def_help @copyfiles-help)
  157.                    (optional "oknodelete")
  158.                    (optional "askuser")
  159.                    (source  "env/VMM.prefs")
  160.                    (dest    "env:")
  161.                    (confirm)
  162.         )
  163.         (copyfiles (prompt ("\nCopying VMM.prefs to envarc:\n"))
  164.                    (help   def_help @copyfiles-help)
  165.                    (optional "oknodelete")
  166.                    (optional "askuser")
  167.                    (source  "env/VMM.prefs")
  168.                    (dest    "envarc:")
  169.                    (confirm)
  170.         )
  171.       )
  172.     )
  173.   )
  174. )
  175.  
  176. ; Copy docs
  177.  
  178. (if copy_docs
  179.     (
  180.       ;get destination directory for "VMM.guide"
  181.       (set doc_dir (tackon vmmdest "doc"))
  182.  
  183.       (if (AND (= 0 @user-level) (NOT (exists doc_dir)))
  184.           ; then
  185.           (makedir doc_dir (infos))
  186.       )
  187.  
  188.       (set vmmdocs
  189.            (askdir (prompt "Select the directory where you want to put\nthe documents and guides.")
  190.                    (help   "This should be the directory where you normally put your guides.\n\n"
  191.                            def_help @askdir-help)
  192.                    (default doc_dir)
  193.                    (newpath)
  194.                    (disk)
  195.            )
  196.       )
  197.  
  198.       (if copy_dev
  199.         (if copy_icons
  200.            ; then
  201.            (copyfiles (prompt ("\nCopying docs..."))
  202.                       (help   def_help @copyfiles-help)
  203.                       (optional "oknodelete")
  204.                       (optional "askuser")
  205.                       (source  "doc")
  206.                       (choices "VMM.guide" "VMM_lib.doc")
  207.                       (dest    vmmdocs)
  208.                       (infos)
  209.                       (confirm)
  210.            )
  211.            ; else
  212.            (copyfiles (prompt ("\nCopying docs..."))
  213.                       (help   def_help @copyfiles-help)
  214.                       (optional "oknodelete")
  215.                       (optional "askuser")
  216.                       (source  "doc")
  217.                       (choices "VMM.guide" "VMM_lib.doc")
  218.                       (dest    vmmdocs)
  219.                       (confirm)
  220.            )
  221.         )
  222.       ; else
  223.         (if copy_icons
  224.             ; then
  225.               (copyfiles (prompt ("\nCopying VMM.guide to " vmmdocs "."))
  226.                          (help   def_help @copyfiles-help)
  227.                          (optional "oknodelete")
  228.                          (optional "askuser")
  229.                          (source  "doc")
  230.                          (choices "VMM.guide")
  231.                          (dest    vmmdocs)
  232.                          (infos)
  233.                          (confirm)
  234.               )
  235.             ; else
  236.               (copyfiles (prompt ("\nCopying VMM.guide to " vmmdocs "."))
  237.                          (help   def_help @copyfiles-help)
  238.                          (optional "oknodelete")
  239.                          (optional "askuser")
  240.                          (source  "doc")
  241.                          (choices "VMM.guide")
  242.                          (dest    vmmdocs)
  243.                          (confirm)
  244.               )
  245.         )
  246.       )
  247.     )
  248. )
  249.  
  250. ; Copy developer files
  251.  
  252. (if copy_dev
  253.     (
  254.       (copylib (prompt ("\nCopying VMM.library to libs:."))
  255.                (help   def_help @copyfiles-help)
  256.                (optional "oknodelete")
  257.                (optional "askuser")
  258.                (source  "Developer/libs/VMM.library")
  259.                (dest    "libs:")
  260.                (confirm)
  261.       )
  262.  
  263.       (if (exists ("fd:") (noreq))
  264.           ; then
  265.             (set fd_dir "fd:")
  266.           ; else
  267.             (set fd_dir
  268.                  (askdir (prompt "Select the directory where you want to put the fd file.")
  269.                          (help   def_help  @askdir-help)
  270.                          (default "WORK:")
  271.                          (disk)
  272.                  )
  273.             )
  274.       )
  275.  
  276.       (if (exists ("include:") (noreq))
  277.           ; then
  278.             (set inc_dir "include:")
  279.           ; else
  280.             (set inc_dir 
  281.                  (askdir (prompt "Select the directory where you want to put the include file.")
  282.                          (help   def_help  @askdir-help)
  283.                          (default "WORK:")
  284.                          (disk)
  285.                  )
  286.             )
  287.       )
  288.  
  289.       (if (exists ("lib:") (noreq))
  290.           ; then
  291.             (set lib_dir "lib:")
  292.           ; else
  293.             (set lib_dir
  294.                  (askdir (prompt "Select the directory where you want to put the lib file.")
  295.                          (help   def_help  @askdir-help)
  296.                          (default "WORK:")
  297.                          (disk)
  298.                  )
  299.             )
  300.       )
  301.  
  302.  
  303.       (copyfiles (prompt ("\nCopying VMM_lib.fd to " fd_dir "."))
  304.                  (help   def_help @copyfiles-help)
  305.                  (optional "oknodelete")
  306.                  (optional "askuser")
  307.                  (source  "Developer/fd/VMM_lib.fd")
  308.                  (dest    fd_dir)
  309.                  (confirm)
  310.       )
  311.  
  312.       (copyfiles (prompt ("\nCopying VMM_stat.h to " inc_dir "."))
  313.                  (help   def_help @copyfiles-help)
  314.                  (optional "oknodelete")
  315.                  (optional "askuser")
  316.                  (source  "Developer/include/VMM_Stat.h")
  317.                  (dest    inc_dir)
  318.                  (confirm)
  319.       )
  320.  
  321.       (copyfiles (prompt ("\nCopying VMM_lib.lib to " lib_dir "."))
  322.                  (help   def_help @copyfiles-help)
  323.                  (optional "oknodelete")
  324.                  (optional "askuser")
  325.                  (source  "Developer/lib/VMM_lib.lib")
  326.                  (dest    lib_dir)
  327.                  (confirm)
  328.       )
  329.     )
  330. )
  331.  
  332.