home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format 117 / af117sub.adf / HomeBank.lzx / HomeBank / Install-HomeBank < prev    next >
Text File  |  1998-09-22  |  7KB  |  267 lines

  1. ; HomeBank Installtion Script
  2. ;$VER HomeBank-Install 1.2 (05.09.98)
  3.  
  4. ;**************************************************************
  5. ; English strings
  6.  
  7. (set #msg_badkick "\n Sorry, this package requires OS v2.04 or better.\n")
  8.  
  9. (set #msg_welcome
  10.   (cat
  11.     "\nWelcome to «HomeBank» installation\n\n"
  12.     "This script installs version 1.2 on your Amiga.\n\n"
  13.     "HomeBank © 1995-1998 Maxime Doyen\n"
  14.     "All Rights Reserved\n\n"
  15.   )
  16. )
  17.  
  18. (set #msg_warn_mui
  19.   (cat
  20.     "\nWarning\n\nMUI (Magic User Interface)\n"
  21.     "seem not to be installed on your system.\n\n"
  22.     "MUI is absolutely needed for «HomeBank» to run.\n"
  23.     "MUI © 1993-1998 Stefan Stuntz"
  24.   )
  25. )
  26.  
  27. (set #msg_warn_nlist
  28.   (cat
  29.     "\nWarning\n\nNList.mcc is not installed,\n"
  30.     "or need to be updated with version 0.84"
  31.   )
  32. )
  33.  
  34. (set #msg_warnlocale
  35.   (cat
  36.     "\nWarning\n\nThe catalogs cannot be found, if you need\n"
  37.     "another language than english, you must get the file named\n"
  38.     "\"HomeBankLoc.lha\" and unarchive it to the same location\n"
  39.     "than this main archive before to run the install.\n"
  40.   )
  41. )
  42.  
  43. (set #msg_askdestdir
  44.   (cat
  45.     "Please select a place for \"HomeBank\".\n"
  46.     "A drawer will be created there for you."
  47.   )
  48. )
  49.  
  50. (set #msg_wichlang
  51.   "Please select the language(s) you wish to install."
  52. )
  53.  
  54. (set #reg_prompt "Thank you very much for purchasing `HomeBank'. To turn your demo version into a registered version, your personalized keyfile needs to be installed on your hard disk in the L: directory. Do you want to do that now (recommended)?")
  55. (set #reg_yes    "Yes, install keyfile")
  56. (set #reg_no     "No, don't install keyfile")
  57. (set #reg_help   "\nThe keyfile turns any `HomeBank' demo version into a registered version. After installation in the L: directory of your harddisk, all features will be enabled. The keyfile is personalized with your name and address and may not be redistributed under any circumstances.")
  58. (set #reg_noway  "\nYou choose not to install your keyfile. The options for registered users won't be enabled until you do that.\n\nYou can restart the installer script later or copy the keyfile manually with a command like\n\ncopy homebank.key L:")
  59.  
  60. ;=======================================================
  61. ;================== Procedures! ========================
  62. ;=======================================================
  63.  
  64. (procedure P_copydir dirname
  65.   (copyfiles (infos) (all)
  66.     (source dirname)
  67.     (dest (tackon destination dirname))
  68.   )
  69.   (copyfiles
  70.     (source (cat dirname ".info"))
  71.     (dest destination)
  72.   )
  73. )
  74.  
  75. ;=======================================================
  76. ;=================== Settings! =========================
  77. ;=======================================================
  78.  
  79. ;**** sure we are running under OS2.04 or above
  80. (if (< (/ (getversion) 65536) 37)
  81.   (
  82.     (message #msg_badkick)
  83.     (exit (quiet))
  84.   )
  85. )
  86.  
  87. (message #msg_welcome (all))
  88. (welcome)
  89. (complete 0)
  90.  
  91. ;**** test if mui is installed
  92. (if (= (exists "mui:" (noreq)) 0)
  93.   (message #msg_warnmui)
  94. )
  95.  
  96. (if (= (exists "Catalogs" (noreq)) 0)
  97.   (message #msg_warnlocale)
  98. )
  99.  
  100. ;**** get destination directory
  101. (set destdir
  102.   (askdir
  103.     (prompt #msg_askdestdir)
  104.     (help @askdir-help)
  105.     (default "SYS:")
  106.   )
  107. )
  108.  
  109. (set @default-dest (expandpath destdir))
  110. (set destination (tackon destdir "HomeBank"))
  111.  
  112. ;=======================================================
  113. ;==================== Action! ==========================
  114. ;=======================================================
  115.  
  116. ;**** test if nlist is installed and get version
  117. (set vernum 0)
  118. (if (<> (exists "MUI:Libs/mui/NList.mcc" (noreq)) 0)
  119.   (set vernum (/ (getversion "MUI:Libs/mui/NList.mcc") 65536))
  120. )
  121.  
  122. (if (< vernum 19)
  123.   (message #msg_updatenlist)
  124.   (copylib (source "Libs/MUI/NList.mcc") (dest "MUI:Libs/mui"))
  125.   (copylib (source "Libs/MUI/NListview.mcc") (dest "MUI:Libs/mui"))
  126.   (copylib (source "Libs/MUI/NListviews.mcp") (dest "MUI:Libs/mui"))
  127. )
  128.  
  129. (if (= (exists destination) 0)
  130.   (makedir destination )
  131. )
  132. (if (= (exists (tackon @default-dest "HomeBank.info")) 0)
  133.   (copyfiles (noposition)
  134.     (source "/HomeBank.info")
  135.     (dest @default-dest)
  136.     (optional nofail force)
  137.   )
  138. )
  139.  
  140. (copyfiles (infos)
  141.   (source "ReadMe")
  142.   (dest destination)
  143. )
  144.  
  145. ;**** get the installed cpu
  146. (set cpu (database "cpu"))
  147. (if (= cpu 68000) (set #cpu 0))
  148. (if (= cpu 68010) (set #cpu 1))
  149. (if (= cpu 68020) (set #cpu 2))
  150. (if (= cpu 68030) (set #cpu 3))
  151. (if (= cpu 68040) (set #cpu 4))
  152. (if (= cpu 68060) (set #cpu 5))
  153.  
  154. (complete 20)
  155. (copyfiles
  156.   (source "HomeBank.info")
  157.   (dest destination)
  158. )
  159. (if (AND (>= #cpu 2) (exists ("HomeBank020")) )
  160.   (copyfiles
  161.     (source "HomeBank020")
  162.     (dest destination)
  163.     (newname "HomeBank")
  164.   )
  165.   (copyfiles
  166.     (source "HomeBank")
  167.     (dest destination)
  168.   )
  169. )
  170.  
  171. (complete 40)
  172. (P_copydir "Docs")
  173.  
  174. (P_copydir "Accounts")
  175.  
  176. (P_copydir "Goodies")
  177.  
  178. (makedir (tackon destination "Icons"))
  179. (copyfiles (all)
  180.   (source "Icons")
  181.   (dest (tackon destination "Icons"))
  182. )
  183.  
  184. (copyfiles (infos)
  185.   (source "OrderForm")
  186.   (dest destination)
  187. )
  188.  
  189. (complete 50)
  190. (delete "ENV:mui/HomeBank.config")
  191. (delete "ENVARC:mui/HomeBank.config")
  192. (copyfiles (source "Goodies/HomeBank.config") (dest "ENV:mui"))
  193. (copyfiles (source "Goodies/HomeBank.config") (dest "ENVARC:mui"))
  194.  
  195. (complete 60)
  196. (if (exists "Catalogs")
  197.  
  198. (set lang
  199.   (askoptions
  200.     (prompt #msg_wichlang)
  201.     (help @askoptions-help)
  202.     (default 0)
  203.     (choices
  204.       "Français"
  205.       "Deutsch"
  206.       "Norsk"
  207.     )
  208.   )
  209. )
  210.  
  211. (makedir (tackon destination "Catalogs"))
  212. (copyfiles
  213.   (source "Catalogs.info")
  214.   (dest destination)
  215. )
  216. (if (BITAND lang 1)
  217.   (
  218.     (delete "LOCALE:Catalogs/français/homebank.catalog")
  219.     (copyfiles
  220.       (source (tackon "Catalogs/français" "homebank.catalog"))
  221.       (dest (tackon destination "Catalogs/français"))
  222.     )
  223.   )
  224. )
  225. (if (BITAND lang 2)
  226.   (
  227.     (delete "LOCALE:Catalogs/deutsch/homebank.catalog")
  228.     (copyfiles
  229.       (source (tackon "Catalogs/deutsch" "homebank.catalog"))
  230.       (dest (tackon destination "Catalogs/deutsch"))
  231.     )
  232.   )
  233. )
  234. (if (BITAND lang 3)
  235.   (
  236.     (delete "LOCALE:Catalogs/norsk/homebank.catalog")
  237.     (copyfiles
  238.       (source (tackon "Catalogs/français" "homebank.catalog"))
  239.       (dest (tackon destination "Catalogs/norsk"))
  240.     )
  241.   )
  242. )
  243. )
  244.  
  245. ; Copy Keyfile if exist
  246. (complete 80)
  247. (if (exists "/homebank.key")
  248.   (
  249.     (if (askbool (prompt (cat #intro_0 "\n\n" #reg_prompt)) (choices #reg_yes #reg_no) (default 1) (help #reg_help))
  250.       (
  251.         (copyfiles
  252.       (prompt #reg_copying)
  253.           (source "/homebank.key")
  254.           (dest "L:")
  255.           (help @copyfiles-help)
  256.           (confirm "expert")
  257.         )
  258.       )
  259.       (
  260.         (message #reg_noway)
  261.       )
  262.     )
  263.   )
  264. )
  265.  
  266. (complete 100)
  267.