home *** CD-ROM | disk | FTP | other *** search
/ Meeting Pearls 3 / Meeting_Pearls_III.iso / Pearls / dev / Libraries / Date / Install < prev    next >
Encoding:
Text File  |  1995-06-14  |  9.8 KB  |  269 lines

  1. ;
  2. ; Installation script for the date.library
  3. ;
  4. ; created on 09.06.1995 by Kai Hofmann
  5. ;
  6.  
  7. (if (= @language "english") ;then
  8.     (
  9.      (set #welcome (cat "Welcome to the date.library which is "
  10.                     "copyrighted 1994-95 by KaiĀ Hofmann\n\n"
  11.                     "This is a portable ANSI-C/C++ library "
  12.                     "that gives you low level functions for "
  13.                     "date calculations.\n\n")
  14.      )
  15.      (set #iuquest ("What do you want to do with the %s?\n\n" @app-name))
  16.      (set #iuc1    "Install")
  17.      (set #iuc2    "Uninstall")
  18.      (set #use33   ("You must be using Kickstart 1.2 or higher to install and use the %s" @app-name))
  19.      (set #libdestdir ("Where do you want to install the %s?" @app-name))
  20.      (set #choiceyes "Yes")
  21.      (set #choiceno "No")
  22.      (set #asksource "Do you want to install the C/C++ source?")
  23.      (set #askcsrc "What do you want to install?")
  24.      (set #askopt1 "Date.h/Date_pragmas.h to include:")
  25.      (set #askopt2 "All source code")
  26.      (set #askopt3 "Documentation")
  27.      (set #notfound "Sorry could not find '%s'")
  28.      (set #copy1 "Copying Date.h to include:libraries")
  29.      (set #copy2 "Copying Date_pragmas.h to include:pragmas")
  30.      (set #askcdoc "Which format do you want to copy?")
  31.      (set #askopt4 "ASCII format")
  32.      (set #askopt5 "AmigaGuide format")
  33.      (set #copy3 "Copying Date.doc")
  34.      (set #copy4 "Copying TextEngine.doc")
  35.      (set #copy5 "Copying Date.guide")
  36.      (set #copy6 "Copying TextEngine.guide")
  37.      (set #copy7 "Copying C-source")
  38.      (set #docdestdir "To which directory should I copy the .doc files?")
  39.      (set #guidedestdir "To which directory should I copy the .guide files?")
  40.      (set #del1 "Deleting .info file - it is created by an installer bug!")
  41.      (set #srcdestdir "Where do you want to install all the sources?")
  42.      (set #removelib ("Removing %s" @app-name))
  43.      (set #libnotfound ("Sorry, could not find %s" @app-name))
  44.      (set #endunin ("\nUninstalling %s finished, but if you have installed the complete source, so please remove this by hand!" @app-name))
  45.     )
  46. )
  47.  
  48. (if (= 0 (askchoice (prompt #iuquest)
  49.                     (choices #iuc1 #iuc2)
  50.                     (default 0)
  51.                     (help @askchoice-help)
  52.          )
  53.     )
  54.     (
  55.      ; Install
  56.      (if (< (/ (getversion) 65536) 33)
  57.          (abort #use33)
  58.      )
  59.      (welcome #welcome)
  60.      (complete 0)
  61.      (set @default-dest "libs:")
  62.      (set @default-dest (askdir (prompt #libdestdir)
  63.                                 (default @default-dest)
  64.                                 (help @askdir-help)
  65.                         )
  66.      )
  67.      (if (= @language "english") ;then
  68.          (
  69.           (set #cplprompt ("Copying %s to %s" @app-name @default-dest))
  70.          )
  71.      )
  72.  
  73.      (set cpu (database "cpu"))
  74. ;     (if (patmatch cpu "68000")
  75.          (copylib (prompt #cplpromt)
  76.                   (source "libs/date.library")
  77.                   (dest @default-dest)
  78.                   (newname "date.library")
  79.                   (optional "askuser")
  80.                   (help @copylib-help)
  81.          )
  82. ;        (
  83. ;         (copylib (prompt #cplpromt)
  84. ;                  (source ("libs/date%s.library" (substr cpu 3 2)))
  85. ;                  (dest @default-dest)
  86. ;                  (newname "date.library")
  87. ;                  (optional "askuser")
  88. ;                  (help @copylib-help)
  89. ;         )
  90. ;        )
  91. ;     )
  92.      (if (> @user-level 0)
  93.          (
  94.           (complete 50)
  95.           (set src (askoptions (prompt #askcsrc)
  96.                                (choices #askopt1 #askopt2 #askopt3)
  97.                                (default %101)
  98.                                (help @askoptions-help)
  99.                    )
  100.           )
  101.           (if (BITAND src %001)
  102.               (if (= 2 (exists "include:" (noreq)))
  103.                   (
  104.                    (if (= 2 (exists "include:libraries" (noreq)))
  105.                        (copyfiles (prompt #copy1)
  106.                                   (source "src/Date.h")
  107.                                   (dest "include:libraries")
  108.                                   (optional "askuser")
  109.                                   (help @copyfiles-help)
  110.                        )
  111.                        (message (#notfound "include:libraries"))
  112.                    )
  113.                    (if (= 2 (exists "include:pragmas" (noreq)))
  114.                        (copyfiles (prompt #copy2)
  115.                                   (source "src/Date_pragmas.h")
  116.                                   (dest "include:pragmas")
  117.                                   (optional "askuser")
  118.                                   (help @copyfiles-help)
  119.                        )
  120.                        (message (#notfound "include:pragmas"))
  121.                    )
  122.                   )
  123.                   (message (#notfound "include:"))
  124.               )
  125.           )
  126.           (complete 66)
  127.           (set destination "SYS:")
  128.           (if (BITAND src %010)
  129.               (
  130.                (set destination (askdir (prompt #srcdestdir)
  131.                                         (default destination)
  132.                                         (help @askdir-help)
  133.                                 )
  134.                )
  135.                (copyfiles (prompt #copy7)
  136.                           (source "src/")
  137.                           (dest destination)
  138.                           (all)
  139.                           (infos)
  140.                           (optional "askuser")
  141.                           (help @copyfiles-help)
  142.                )
  143.                (copyfiles (prompt #copy7)
  144.                           (source "libs/Date.fd")
  145.                           (dest destination)
  146.                           (infos)
  147.                           (optional "askuser")
  148.                           (help @copyfiles-help)
  149.                )
  150.                (delete (tackon destination ".info")
  151.                        (prompt #del1)
  152.                        (optional "force")
  153.                        (help @delete-help)
  154.                )
  155.  
  156.               )
  157.           )
  158.           (complete 82)
  159.           (if (BITAND src %100)
  160.               (
  161.                (set src (askoptions (prompt #askcdoc)
  162.                                     (choices #askopt4 #askopt5)
  163.                                     (default %10)
  164.                                     (help @askoptions-help)
  165.                         )
  166.                )
  167.                (if (BITAND src %01)
  168.                    (
  169.                     (set destination (askdir (prompt #docdestdir)
  170.                                              (default destination)
  171.                                              (help @askdir-help)
  172.                                      )
  173.                     )
  174.                     (copyfiles (prompt #copy3)
  175.                                (source "doc/Date.doc")
  176.                                (dest destination)
  177.                                (infos)
  178.                                (optional "askuser")
  179.                                (help @copyfiles-help)
  180.                     )
  181.                     (copyfiles (prompt #copy4)
  182.                                (source "doc/TextEngine.doc")
  183.                                (dest destination)
  184.                                (infos)
  185.                                (optional "askuser")
  186.                                (help @copyfiles-help)
  187.                     )
  188.                     (delete (tackon destination ".info")
  189.                             (prompt #del1)
  190.                             (optional "force")
  191.                             (help @delete-help)
  192.                     )
  193.                   )
  194.                )
  195.                (if (BITAND src %10)
  196.                    (
  197.                     (set destination (askdir (prompt #guidedestdir)
  198.                                              (default destination)
  199.                                              (help @askdir-help)
  200.                                      )
  201.                     )
  202.                     (copyfiles (prompt #copy5)
  203.                                (source "doc/Date.guide")
  204.                                (dest destination)
  205.                                (infos)
  206.                                (optional "askuser")
  207.                                (help @copyfiles-help)
  208.                     )
  209.                     (copyfiles (prompt #copy6)
  210.                                (source "doc/TextEngine.guide")
  211.                                (dest destination)
  212.                                (infos)
  213.                                (optional "askuser")
  214.                                (help @copyfiles-help)
  215.                     )
  216.                     (delete (tackon destination ".info")
  217.                             (prompt #del1)
  218.                             (optional "force")
  219.                             (help @delete-help)
  220.                     )
  221.                    )
  222.                )
  223.               )
  224.           )
  225.          )
  226.      )
  227.      (complete 100)
  228.     )
  229. ;else
  230.     (
  231.      ; Uninstall
  232.      (if (exists "libs:date.library" (noreq))
  233.          (delete "libs:date.library"
  234.                  (prompt #removelib)
  235.                  (help @delete-help)
  236.                  (optional "force")
  237.          )
  238.          (message #libnotfound)
  239.      )
  240.      (complete 50)
  241.      (if (exists "include:" (noreq))
  242.          (
  243.           (if (exists "include:libraries" (noreq))
  244.               (if (exists "include:libraries/Date.h" (noreq))
  245.                   (delete "include:libraries/Date.h"
  246.                           (prompt #removelib)
  247.                           (help @delete-help)
  248.                           (optional "force")
  249.                   )
  250.               )
  251.           )
  252.           (complete 75)
  253.           (if (exists "include:pragmas" (noreq))
  254.               (if (exists "include:pragmas/Date_pragmas.h" (noreq))
  255.                   (delete "include:pragmas/Date_pragmas.h"
  256.                           (prompt #removelib)
  257.                           (help @delete-help)
  258.                           (optional "force")
  259.                   )
  260.               )
  261.           )
  262.          )
  263.      )
  264.      (complete 100)
  265.      (message #endunin)
  266.      (exit (quiet))
  267.     )
  268. )
  269.