home *** CD-ROM | disk | FTP | other *** search
/ Amiga MA Magazine 1998 #6 / amigamamagazinepolishissue1998.iso / coders / arexx / moos / install_moos < prev    next >
Text File  |  1997-02-26  |  7KB  |  255 lines

  1. ;
  2. ; Copyright © 1994-1997 Rocco Coluccelli
  3. ; $VER: InstallMOOS 1.00 (29.Jan.1997)
  4. ;
  5.  
  6. ;
  7. ;    ============
  8. ;    Localization
  9. ;    ============
  10. ;
  11. (if (= @language "english")
  12. (
  13.     (set ##bad-installer (cat
  14.         "You have an old version of the program 'Installer' on your Amiga!\n\n"
  15.         "The installation procedure needs at least Installer 42.9.\n\n"
  16.         "Please check your configuration!"
  17.     ))
  18.     (set ##welcome (cat
  19.         "\n\n\nThe MOOS library\nVersion 1.xx\n\n\n"
  20.         "MOOS © 1994-1997 to Rocco Coluccelli\n"
  21.         "All rights reserved to the author."
  22.     ))
  23.     (set ##bad-kick "\nSorry, but the MOOS package requires at last the AmigaOS 2.04 installed in your system.\n")
  24.     (set ##copying "I'm going to copy: ")
  25.     (set ##install "Which part of the MOOS package do you need to install, or update?")
  26.     (set ##install-hlp (cat
  27.         "    The main MOOS library is an ARexx external functions library that let users access to dozen of functions contained into its sub-libraries. Read the documentation for more details.\n\n"
  28.         "    The MOOS modules are ARexx scripts used as external functions. Every library into the MOOS package has a test script that show the use of each function contained (the output text is also provided).\n\n"
  29.         "    To use any function contained into the MOOS package, into your own script, you probably need to install the documentation files...\n\n"
  30.     ))
  31.     (set ##inst-libs "MOOS libraries in libs:")
  32.     (set ##inst-mods "MOOS modules in rexx:")
  33.     (set ##inst-docs "Documentation files.")
  34.     (set ##inst-docs-lang "Which versions of the documentation files you need to install?")
  35.     (set ##inst-docs-dest "Choose a destination for the documentation files. A drawer \"MOOS\" will be created if it doesn't exists.")
  36.     (set ##inst-test "Test ARexx scripts.")
  37.     (set ##inst-test-dest "Choose a destination drawer for all test scripts.")
  38. ))
  39.  
  40. (if (= @language "italiano")
  41. (
  42.     (set ##bad-installer (cat
  43.         "Hai una versione troppo vecchia della utility 'Installer' sul tuo Amiga!\n\n"
  44.         "La procedura di installazione richiede almeno un Installer 42.9.\n\n"
  45.         "Per favore, sistema la tua configurazione."
  46.     ))
  47.     (set ##welcome (cat
  48.         "\n\n\nLa libreria MOOS\nVersione 1.xx\n\n\n"
  49.         "MOOS © 1994-1997 di Rocco Coluccelli\n"
  50.         "Tutti i diritti sono riservati."
  51.     ))
  52.     (set ##bad-kick "\nMi dispiace, ma tutto il pacchetto MOOS richiede che nel sistema sia installata almeno la versione 2.04 di AmigaOS.\n")
  53.     (set ##copying "Sto per copiare: ")
  54.     (set ##install "Quale parte del pacchetto MOOS desideri che venga installata, o aggiornata?")
  55.     (set ##install-hlp (cat
  56.         "    La libreria principale di MOOS e' una libreria di funzioni esterne richiamabili dall'interno di script ARexx. Essa e', in realta', un indice di decine di funzioni contenute in tante sotto-librerie. Si legga la documentazione per i dettagli.\n\n"
  57.         "    I moduli MOOS sono script ARexx usabili come funzioni esterne, sempre richiamabili dall'interno di altri script ARexx. Ogni libreria, nel pacchetto software MOOS, ha anche uno script dimostrativo che mostra anche l'uso delle funzioni contenute (ogni script e' affiancato da un file contenente l'output prodotto).\n\n"
  58.         "    Per usare le funzioni contenute nel pacchetto applicativo MOOS sono anche disponibili dei file di documentazione (in versione italiana ne mancano ancora molti, mi spiace).\n\n"
  59.     ))
  60.     (set ##inst-libs "Le librerie MOOS in libs:")
  61.     (set ##inst-mods "I moduli MOOS in rexx:")
  62.     (set ##inst-docs "Tutta la documentazione.")
  63.     (set ##inst-docs-lang "Quali versioni della documentazione vuoi installare?")
  64.     (set ##inst-docs-dest "Scegli una destinazione per i file della documentazione. Un nuovo cassetto \"MOOS\" sara' creato se non gia' presente.")
  65.     (set ##inst-test "Script ARexx di test.")
  66.     (set ##inst-test-dest "Scegli una destinazione per tutti gli script di test.")
  67. ))
  68.  
  69.  
  70. ;
  71. ; We can't handle this script without Installer 42.9 or better!
  72. ;
  73. (if (< @installer-version 2752521)
  74. (
  75.     (message ##bad-installer)
  76.     (exit (quiet))
  77. ))
  78.  
  79. ;
  80. ;    =======
  81. ;    WELCOME
  82. ;    =======
  83. ;
  84. (complete 0)
  85. (message ##welcome (all))
  86. (welcome)
  87.  
  88. ;
  89. ;    Check kick version
  90. ;
  91. (if (= (set #flag (/ (getversion "libs:version.library") 65536)) 0)
  92.     (set #flag (/ (getversion) 65536))
  93. )
  94.  
  95. (if (< #flag 37) (abort ##bad-kick))
  96.  
  97. ;
  98. ;    CPU & FPU
  99. ;
  100. (set cpu (database "cpu"))
  101. (set fpu (database "fpu"))
  102.  
  103. ;
  104. ;    source and destination dir
  105. ;
  106. (set #srcdir (pathonly @icon))
  107. (set @default-dest "REXX:")
  108.  
  109.  
  110. ;
  111. ;    ================================================
  112. ;    the /Libs  directory with libraries...
  113. ;    the /ARexx directory with modules...
  114. ;    the /Docs  directory with documentation files...
  115. ;    the /Tests directory with test ARexx scripts...
  116. ;    ================================================
  117. ;
  118. (set #inst 0)
  119.  
  120. (if (> (exists (set #libs-dir (tackon #srcdir "Libs"))) 0)
  121.     (set #inst (+ #inst 1))
  122.     (set ##inst-libs "")
  123. )
  124. (if (> (exists (set #mods-dir (tackon #srcdir "ARexx"))) 0)
  125.     (set #inst (+ #inst 2))
  126.     (set ##inst-mods "")
  127. )
  128. (if (> (exists (set #docs-dir (tackon #srcdir "Docs"))) 0)
  129.     (if (= @user-level 2) (set #inst (+ #inst 4)))
  130.     (set ##inst-docs "")
  131. )
  132. (if (> (exists (set #test-dir (tackon #srcdir "Tests"))) 0)
  133.     (if (= @user-level 2) (set #inst (+ #inst 8)))
  134.     (set ##inst-test "")
  135. )
  136.  
  137. (set #inst
  138.     (askoptions
  139.         (prompt ##install)
  140.         (help (cat ##install-hlp "\n" @askoptions-help))
  141.         (choices ##inst-libs ##inst-mods ##inst-docs ##inst-test)
  142.         (default #inst)
  143.     )
  144. )
  145. (complete 5)
  146.  
  147.  
  148. (if (in #inst 0)
  149.     (foreach #libs-dir "#?.library"
  150.         (copylib
  151.             (prompt (cat ##copying @each-name))
  152.             (help @copylib-help)
  153.             (source (tackon #libs-dir @each-name))
  154.             (dest "LIBS:")
  155.             (confirm)
  156.         )
  157.     )
  158. )
  159. (complete 20)
  160.  
  161.  
  162. (if (in #inst 1)
  163.     (copyfiles
  164.         (prompt (cat ##copying "ARexx/#?"))
  165.         (help @copyfiles-help)
  166.         (source #mods-dir)
  167.         (dest "REXX:")
  168.         (all)
  169.         (confirm)
  170.     )
  171. )
  172. (complete 40)
  173.  
  174. (set #docs-dest "Work:")
  175. (if (in #inst 2)
  176. (
  177.     (set #lang 0)
  178.  
  179.     (set #it "Italiano")
  180.     (if (> (exists (tackon #docs-dir #it)) 0)
  181.         (set #lang (+ #lang 1)) (set #it "")
  182.     )
  183.     (set #gb "English")
  184.     (if (> (exists (tackon #docs-dir #gb)) 0)
  185.         (set #lang (+ #lang 2)) (set #gb "")
  186.     )
  187.     (set #de "Deutsch")
  188.     (if (> (exists (tackon #docs-dir #de)) 0)
  189.         (set #lang (+ #lang 4)) (set #de "")
  190.     )
  191.  
  192.     (set #lang (askoptions
  193.         (prompt ##inst-docs)
  194.         (help @askoptions-help)
  195.         (choices #it #gb #de)
  196.         (default #lang)
  197.     ))
  198.  
  199.     (if (> #lang 0)
  200.     (
  201.         (set #docs-dest (tackon (askdir
  202.             (prompt ##inst-docs-dest)
  203.             (help @askdir-help)
  204.             (disk)
  205.             (default "Work:")) "MOOS/Docs")
  206.         )
  207.  
  208.         (if (= (exists #docs-dest) 0) (makedir #docs-dest (infos)))
  209.  
  210.         (set @default-dest (pathonly #docs-dest))
  211.     ))
  212.  
  213.     (set #n 0)
  214.     (while (< #n 3)
  215.     (
  216.         (if (in #lang #n)
  217.             (copyfiles
  218.                 (source (tackon #docs-dir (select #n #it #gb #de)))
  219.                 (dest (tackon #docs-dest (select #n #it #gb #de)))
  220.                 (all)
  221.             )
  222.         )
  223.         (set #n (+ #n 1))
  224.     ))
  225. ))
  226. (complete 60)
  227.  
  228. (set @default-dest (pathonly #docs-dest))
  229. (if (in #inst 3)
  230.     (copyfiles
  231.         (prompt ##inst-test)
  232.         (help @copyfiles-help)
  233.         (source #test-dir)
  234.         (dest (askdir
  235.             (prompt ##inst-test-dest)
  236.             (help @askdir-help)
  237.             (default @default-dest)
  238.         ))
  239.         (pattern "#?.(rexx|output)")
  240.         (infos)
  241.         (confirm)
  242.     )
  243. )
  244. (complete 80)
  245.  
  246.  
  247. ;
  248. ;    ===========
  249. ;    All done...
  250. ;    ===========
  251. ;
  252. (complete 100)
  253. (exit)
  254.  
  255.