home *** CD-ROM | disk | FTP | other *** search
/ Amiga MA Magazine 1998 #3 / amigamamagazinepolishissue1998.iso / bazy / kingfisher-distribution / install-kingfisher < prev    next >
Text File  |  1997-05-18  |  16KB  |  430 lines

  1. ; Installer Script for KingFisher Release 2
  2. ; Copyright © 1994,1995,1996,1997 Udo Schuermann
  3. ; All rights reserved
  4. ; $VER: Install-KingFisher 2.26 (18.5.97)
  5. ;
  6. ;
  7. ; Installer and Installer project icon
  8. ; (c) Copyright 1991-93 Commodore-Amiga, Inc.  All Rights Reserved.
  9. ; Reproduced and distributed under license from Commodore.
  10. ; INSTALLER SOFTWARE IS PROVIDED "AS-IS" AND SUBJECT TO CHANGE;
  11. ; NO WARRANTIES ARE MADE.  ALL USE IS AT YOUR OWN RISK.  NO LIABILITY
  12. ; OR RESPONSIBILITY IS ASSUMED.
  13.  
  14.  
  15. ; set language=national language
  16. (procedure install-language (
  17.   (set catDest ("KFDEST:Catalogs/%s" language))
  18.   (if (not (exists catDest))
  19.     (makedir catDest (safe)))
  20.   (set src (tackon filepath ("Catalogs/%s/KingFisher.catalog" language)))
  21.   (if (not (exists src))
  22.     (set src ("%s.gz" src)))
  23.   (copyfiles (source src) (dest catDest))
  24.   (if (= (".gz" (substr src (- (strlen src) 3))))
  25.      (run ("stack 50000\nram:gunzip >NIL: <NIL: -r \"%s\"" (tackon catDest "KingFisher.catalog.gz"))))
  26.   (set copied (+ copied (getsize (tackon catDest "KingFisher.catalog"))))
  27.   (if (> copied total) (set total copied))
  28.   (complete (/ (* copied 100) total))
  29. ))
  30.  
  31. ; call w/in foreach loop:
  32. ; always:overwrite?; workinfo=general description; @each-name=name
  33. (procedure condcopy (
  34.   (set cond-copied 0)
  35.   (set doit 1)
  36.   (set fname (tackon "KFDEST:" @each-name))
  37.   (if (= always 0)
  38.     (if (exists fname)
  39.        (set doit 0)))
  40.   (if doit (
  41.     (working ("\nInstalling KingFisher Release 2\n\n%s\n\n%s" workinfo @each-name))
  42.     (copyfiles (source (tackon filepath @each-name)) (dest "KFDEST:"))
  43.     (if (= (".gz" (substr @each-name (- (strlen @each-name) 3)))) (
  44.        (set fname (substr @each-name 0 (- (strlen @each-name) 3)))
  45.        (working ("\nInstalling KingFisher Release 2\n\n%s\n\n%s" workinfo fname))
  46.        (run ("stack 50000\nram:gunzip >NIL: <NIL: -f \"%s\"" (tackon "KFDEST:" @each-name)))))
  47.     (set cond-copied 1)))
  48.   (set copied (+ copied (getsize (tackon "KFDEST:" fname))))
  49.   (if (> copied total) (set total copied))
  50.   (complete (/ (* copied 100) total))
  51. ))
  52.  
  53. ; view only once; from current 'filepath'
  54. (procedure viewreadme (
  55.   (if (= ViewInfo 1) (
  56.     (if (> (run ("run SYS:Utilities/MultiView %sReadme" filepath)) 0)
  57.     (if (> (run ("run SYS:Utilities/AmigaGuide %sReadme" filepath)) 0)
  58.       (run ("run more %sReadme" filepath))))))
  59.   (set ViewInfo 0)
  60. ))
  61.  
  62. ; Main Entry Point
  63. (set dosver (/ (getversion "dos.library" (resident)) 65536))
  64. (set usr @user-level)
  65. (user 1)
  66. (if (< dosver 37)
  67.   (message
  68.     "KingFisher Release 2 requires at least Kickstart 2.04 (V37) but your "
  69.     "system's Kickstart (ROM software) is too old to support KingFisher!\n\n"
  70.     "It is suggested that you abort the installation and upgrade your "
  71.     "system. KingFisher Release 2 will not function on your computer until "
  72.     "you perform the necessary upgrade."))
  73.  
  74. (set parts 0)
  75. (set defopts 0)
  76. (if (or (exists "KingFisher") (exists "KingFisher.gz"))
  77.   (set defopts (bitor defopts %00001011)))
  78. (if (exists "Catalogs")
  79.   (set defopts (bitor defopts %00000100)))
  80. (if (or (exists "1000Fish.kfdb") (exists "1000Fish.kfdb.gz"))
  81.   (set defopts (bitor defopts %00010000)))
  82. (if (or (exists "Example1.format") (exists "Example1.format.gz"))
  83.   (set defopts (bitor defopts %00100000)))
  84. (foreach "" "gad.#?.image(%|.gz)"
  85.   (set defopts (bitor defopts %01000000)))
  86. (if (exists "Developer")
  87.   (set defopts (bitor defopts %10000000)))
  88.  
  89. (set opts
  90.   (askoptions
  91.     (help (cat
  92.     "INSTALLABLE COMPONENTS:\n"
  93.     "KingFisher 2 -- Except for a database, all you need to run KingFisher.\n\n"
  94.     "Online Documentation -- AmigaGuide® formatted hypertext documentation.\n\n"
  95.     "RexxFisher -- Access KingFisher's databases from any program with ARexx.\n\n"
  96.     "Language Catalogs -- Operate KingFisher in a language other than English.\n\n"
  97.     "Miscellaneous Files -- Search results and alternate display / print / export format files.\n\n"
  98.     "Button Images -- Example imags to replace some or all of KingFisher's 28 interface buttons.\n\n"
  99.     "Developer Kit -- Source code and examples to get you started programming with the KingFisher Database Server's API directly.\n\n"
  100.     "AMINET ARCHIVES:\n"
  101.     "KingFisher226.lha -- The main KingFisher archive; get a new version of this to update your installation.\n\n"
  102.     "KingFisher2db.lha -- The '1100+ Fish Disks' database distribution for KingFisher to get you started.\n\n"
  103.     "KingFisher2ex.lha -- KingFisher 2 extras, including the Developer Kit, example files, ARexx example files, search and custom formats, etc."))
  104.  
  105.     (default defopts)
  106.     (prompt (cat
  107.     "The following portions are available for installation. Items not "
  108.     "initially checked are unavailable in this distribution. Press HELP "
  109.     "for additional information."))
  110.     (choices
  111.     "KingFisher Release 2 . .  (~210K)"
  112.     "Online Documentation . .  (~260K)"
  113.     "Language Catalogs  . . (each ~8K)"
  114.     "RexxFisher + Examples  . . (~42K)"
  115.     "1000+ Fish Database  . . (~2200K)"
  116.     "Miscellaneous files  . .  (~100K)"
  117.         "Button images  . . . . . . (~15K)"
  118.     "Developer Kit  . . . . .  (~330K)"
  119.     )))
  120.  
  121. (if (and (or (in opts 0) (in opts 1) (in opts 3)) (not (or (exists "KingFisher") (exists "KingFisher.gz")))) (
  122.   (set opts (bitxor opts %1011))
  123.   (message
  124.     "The KingFisher / KFServer / RexxFisher software is not available in this distribution.\n\nIf "
  125.     "you downloaded the distribution from a BBS or Aminet, you need to also download the file "
  126.     "'KingFisher226.lha'.")))
  127.  
  128. (if (and (in opts 2) (not (exists "Catalogs"))) (
  129.   (set opts (bitxor opts %100))
  130.   (message
  131.     "No language catalogs are available in this distribution.\n\nIf you downloaded the distribution "
  132.     "from a BBS or Aminet, you also need to download the file 'KingFisher2.lha'.")))
  133.  
  134. (if (and (in opts 4) (not (or (exists "1000Fish.kfdb") (exists "1000Fish.kfdb.gz")))) (
  135.   (set opts (bitxor opts %10000))
  136.   (message
  137.     "The '1000 Fish Database' is not available in this distribution.\n\nIf you downloaded the "
  138.     "distribution from a BBS or Aminet, you also need to download the file 'KingFisher2db.lha'.")))
  139.  
  140. (if (and (in opts 5) (not (or (exists "Example1.format") (exists "Example1.format.gz")))) (
  141.   (set opts (bitxor opts %100000))
  142.   (message
  143.     "The miscellaneous example files and button images are not part of this distribution.\n\nIf "
  144.     "you downloaded the distribution from a BBS or Aminet, you also need to download the file "
  145.     "'KingFisher2ex.lha'.")))
  146.  
  147. (set foo 0)
  148. (foreach "" "gad.#?.image(%|.gz)"
  149.   (set foo 1))
  150. (if (and (in opts 6) (= foo 0)) (
  151.   (set opts (bitxor opts %1000000))
  152.   (message
  153.     "Button images to demonstrate the replacement of KingFisher's own buttons are not included "
  154.     "in this distribution.\n\nIf you downloaded the distribution from a BBS or Aminet, you also "
  155.     "need to download the file 'KingFisher2ex.lha'.")))
  156.  
  157. (if (and (in opts 7) (not (exists "Developer"))) (
  158.   (set opts (bitxor opts %10000000))
  159.   (message
  160.     "The Developer Kit is not available in this distribution.\n\nYou need to either download "
  161.     "the file 'KingFisher2ex.lha' or request the developer kit from the author, either as "
  162.     "part of a paid upgrade on disk or free via email.\n\nPlease see the doocumentation for "
  163.     "ordering information!")))
  164.  
  165. (if (= opts 0) (
  166.   (complete 100)
  167.   (message "Looks like the Installer has nothing to do...")
  168.   (exit)))
  169.  
  170. (user usr)
  171.  
  172. (if (in opts 1)
  173.   (if (< dosver 39)
  174.      (set WrapIt
  175.        (askbool
  176.       (prompt (cat
  177.         "»»---> ATTENTION - READ THIS! <---««\n\n"
  178.         "The KingFisher2.guide documentation that ships with "
  179.         "KingFisher Release 2 is formatted with long lines to "
  180.         "provide Kickstart 3.x users with more readable, and "
  181.         "better formatted documentation.\n"
  182.         "THIS FORMAT CAUSES SERIOUS TROUBLE for AmigaGuide "
  183.         "under Kickstart 2.x wherefore a special 'WrapGuide' "
  184.         "tool is supplied to fix the .guide file for use with "
  185.         ("your installed version of AmigaDOS V%ld\n\n" dosver)
  186.         "You are STRONGLY URGED to have Installer apply "
  187.         "the WrapGuide operation to the documentation!!"))
  188.       (choices "WRAPGUIDE" "Skip it")
  189.       (default "WRAPGUIDE")
  190.       (help @askbool-help)))
  191.      (set WrapIt
  192.        (askbool
  193.       (prompt (cat
  194.         "The KingFisher2.guide documentation that ships with "
  195.         "KingFisher Release 2 is formatted with long lines to "
  196.         "provide Kickstart 3.x users with more readable, "
  197.         "paragraph oriented documentation.\n\n"
  198.         "If you have pressing reasons to convert this file "
  199.         "to a version that will not cause trouble with Kickstart "
  200.         "2.x, then you may choose to have the Installer apply "
  201.         "the supplied 'WrapGuide' tool to the file.\n\n"
  202.         "For best performance under your installed version of "
  203.         ("AmigaDOS %ld, it is RECOMMENDED TO SKIP THIS STEP!" dosver)))
  204.       (choices "WrapGuide" "SKIP IT")
  205.       (default "SKIP IT")
  206.       (help @askbool-help)))))
  207.  
  208. (set defcats 0)
  209. (if (exists "Locale:Languages/Dansk.language")
  210.   (set defcats (bitor defcats 1)))
  211. (if (exists "Locale:Languages/Deutsch.language")
  212.   (set defcats (bitor defcats 2)))
  213. (if (exists "Locale:Languages/Español.language")
  214.   (set defcats (bitor defcats 4)))
  215. (if (exists "Locale:Languages/Nederlands.language")
  216.   (set defcats (bitor defcats 8)))
  217. (if (exists "Locale:Languages/Suomi.language")
  218.   (set defcats (bitor defcats 16)))
  219. (if (exists "Locale:Languages/Svenska.language")
  220.   (set defcats (bitor defcats 32)))
  221.  
  222. (set catalogs 0)
  223. (if (and (in opts 2) (<> defcats 0)) (
  224.   (set catalogs
  225.     (askoptions
  226.       (help @askoptions-help)
  227.       (default defcats)
  228.       (prompt (cat
  229.     "Choose any combination of the language catalogs listed below. Those "
  230.     "initially checked are your choices when you installed AmigaOS:")
  231.       (choices
  232.     "Dansk"
  233.     "Deutsch"
  234.     "Español"
  235.     "Français"
  236.     "Nederlands"
  237.     "Suomi"
  238.     "Svenska"
  239.       ))))
  240.    (set CATCOUNT 0)
  241.    (if (in catalogs 0) (set CATCOUNT (+ CATCOUNT 1)))
  242.    (if (in catalogs 1) (set CATCOUNT (+ CATCOUNT 1)))
  243.    (if (in catalogs 2) (set CATCOUNT (+ CATCOUNT 1)))
  244.    (if (in catalogs 3) (set CATCOUNT (+ CATCOUNT 1)))
  245.    (if (in catalogs 4) (set CATCOUNT (+ CATCOUNT 1)))
  246.    (if (in catalogs 5) (set CATCOUNT (+ CATCOUNT 1)))
  247.    (if (in catalogs 6) (set CATCOUNT (+ CATCOUNT 1)))))
  248.  
  249. (set MINSPC 0)
  250. (if (in opts 0) (set MINSPC (+ MINSPC 210)))
  251. (if (in opts 1) (set MINSPC (+ MINSPC 260)))
  252. (if (in opts 2) (set MINSPC (+ MINSPC (* CATCOUNT 8))))
  253. (if (in opts 3) (set MINSPC (+ MINSPC 42)))
  254. (if (in opts 4) (set MINSPC (+ MINSPC 2200)))
  255. (if (in opts 5) (set MINSPC (+ MINSPC 100)))
  256. (if (in opts 6) (set MINSPC (+ MINSPC 15)))
  257. (if (in opts 7) (set MINSPC (+ MINSPC 330)))
  258.  
  259. (set DISKFREE 0)
  260. (while (< DISKFREE MINSPC) (
  261.   (set DESTIN (tackon
  262.     (askdir
  263.       (prompt (cat
  264.     "Where do you wish to install KingFisher Release 2?\n"
  265.     "(A drawer named 'KingFisher2' will be created there.)"))
  266.       (help @askdir-help)
  267.       (default "SYS:"))
  268.     "KingFisher2"))
  269.   (set @default-dest DESTIN)
  270.   (set @execute-dir DESTIN)
  271.   (set DISKFREE (/ (getdiskspace ("%s:" (getdevice DESTIN))) 1024))
  272.   (if (< DISKFREE MINSPC)
  273.     ((if (= @user-level 0) (user 1))
  274.      (if (askbool
  275.     (prompt (cat
  276.         ("\nPlease note:\n\nThe selected volume reports only %ldK of " DISKFREE)
  277.         ("diskspace, whereas you should have at least %ldK free!\n\n" MINSPC)
  278.         "Are you sure you wish to proceed with installation to this volume?"))
  279.     (choices "Yes, proceed" "No, try another")
  280.     (default "No, try another")
  281.     (help @askbool-help))
  282.     (set DISKFREE MINSPC))))))
  283.  
  284. (user 1)
  285. (message ("KingFisher Release 2 will be installed to the directory\n\n%s" DESTIN))
  286. (user usr)
  287.  
  288. (if (not (exists DESTIN))
  289.     (makedir DESTIN (infos) (safe)))
  290.  
  291. (makeassign "KFINST")
  292. (makeassign "KFDEST")
  293. (makeassign "KF2-Inst-1")
  294. (makeassign "KF2-Inst-2")
  295.  
  296. (if (or (exists "KingFisher") (exists "KingFisher.gz"))
  297.   (makeassign "KF2-Inst-1" "" (safe)))
  298. (if (or (exists "1000Fish.index") (exists "1000Fish.index.gz"))
  299.   (makeassign "KF2-Inst-2" "" (safe)))
  300. (makeassign "KFINST" "" (safe))
  301. (makeassign "KFDEST" DESTIN (safe))
  302.  
  303. (copyfiles (source "KFINST:gunzip") (dest "ram:"))
  304. (if WrapIt (copyfiles (source "KFINST:WrapGuide") (dest "ram:")))
  305.  
  306. (complete 0)
  307.  
  308. (set total (* MINSPC 1024))
  309. (set copied 0)
  310. (set ViewInfo 1)
  311.  
  312. (set filepath "KF2-Inst-1:")
  313.  
  314. ; don't show unregistered info if keyfile present
  315. (foreach "KF2-Inst-1:" ".KingFisher.key(%|.gz)"
  316.   (set ViewInfo 0))
  317. (if (exists "KFDEST:.KingFisher.key")
  318.   (set ViewInfo 0))
  319.  
  320. (if (in opts 0) (
  321.   (set workinfo "KingFisher Database Software")
  322.   (set always 1)
  323.   (foreach "KF2-Inst-1:" "(KingFisher|KFServer)(%|.gz)"
  324.     (condcopy))
  325.   (set always 0)
  326.   (foreach "KF2-Inst-1:" "(KingFisher.info|KFServer.prefs)(%|.gz)"
  327.     (condcopy))
  328.   (foreach "KF2-Inst-1:" ".KingFisher.key(%|.gz)"
  329.     (condcopy))))
  330.  
  331. (if (in opts 1) (
  332.   (set workinfo "AmigaGuide® Online Documentation")
  333.   (set always 1)
  334.   (foreach "KF2-Inst-1:" "KingFisher2.guide(%|.gz)"
  335.     (condcopy)
  336.     (if cond-copied (
  337.       (if (or (<= dosver 38) WrapIt)
  338.         ((working "\nWord-wrapping KingFisher2.guide\nfor use with AmigaGuide V34")
  339.          (run ("stack 50000\nram:WrapGuide %s 65" "KFDEST:KingFisher2.guide")))))))
  340.   (foreach "KF2-Inst-1:" "KingFisher2.guide.info(%|.gz)"
  341.     (condcopy)
  342.     (if cond-copied (
  343.       ((if (>= dosver 39)
  344.         ((working "Adjusting KingFisher2.guide icon for MultiView")
  345.          (tooltype
  346.            (dest "KFDEST:KingFisher2.guide")
  347.            (setdefaulttool "MultiView"))))))))
  348.   (foreach "KF2-Inst-1:" "History(%|.gz)"
  349.     (condcopy))
  350.   (foreach "KF2-Inst-1:" "#?IFF(%|.gz)"
  351.     (condcopy))))
  352.  
  353. (if (in opts 2) (
  354.   (working ("\nInstalling KingFisher Release 2\n\nLanguage Catalogs"))
  355.   (if (not (exists "KFDEST:Catalogs"))
  356.       (makedir "KFDEST:Catalogs" (safe)))
  357.   (if (in catalogs 0)    ((set language "Dansk")        (install-language)))
  358.   (if (in catalogs 1)    ((set language "Deutsch")    (install-language)))
  359.   (if (in catalogs 2)    ((set language "Español")    (install-language)))
  360.   (if (in catalogs 3)   ((set language "Français")      (install-language)))
  361.   (if (in catalogs 4)    ((set language "Nederlands")    (install-language)))
  362.   (if (in catalogs 5)    ((set language "Suomi")        (install-language)))
  363.   (if (in catalogs 6)    ((set language "Svenska")    (install-language)))))
  364.  
  365. (if (in opts 3) (
  366.   (set workinfo "RexxFisher and Examples")
  367.   (set always 1)
  368.   (foreach "KF2-Inst-1:" "RexxFisher(%|.gz)"
  369.     (condcopy))
  370.   (set always 0)
  371.   (foreach "KF2-Inst-1:" "#?.kfrx(%|.gz)"
  372.     (condcopy))))
  373.  
  374. (if (in opts 5) (
  375.   (set workinfo "Miscellaneous Example Files")
  376.   (set always 0)
  377.   (foreach "KF2-Inst-1:" "Example#?.format(%|.gz)"
  378.     (condcopy))
  379.   (foreach "KF2-Inst-1:" "#?.search(%|.gz)"
  380.     (condcopy))
  381.   (foreach "KF2-Inst-1:" "(%|.)Product-Info(%|.gz)"
  382.     (condcopy))))
  383.  
  384. (if (in opts 6) (
  385.   (set workinfo "Demonstration Button Images")
  386.   (set always 0)
  387.   (foreach "KF2-Inst-1:" "gad.#?.image(%|.gz)"
  388.     (condcopy))))
  389.  
  390. (if (in opts 7) (
  391.   (set workinfo "KingFisher Developer Kit")
  392.   (copyfiles (source "KF2-Inst-1:Developer") (dest "KFDEST:Developer") (all))
  393.   (run ("stack 50000\nram:gunzip >NIL: <NIL: -rf Developer"))))
  394.  
  395. (if (in opts 4) (
  396.   (set workinfo "1000 Fish Database")
  397.   (set always 0)
  398.   (foreach "KF2-Inst-1:" "1000Fish.kfdb(%|.gz)"
  399.     (condcopy))
  400.   (set filepath "KF2-Inst-2:")
  401.   (askdisk
  402.     (prompt "\nPlease insert the disk labeled\n\n\"KingFisher Disk 2\"")
  403.     (dest "KF2-Inst-2")
  404.     (help (cat
  405.     "The requested disk contains the '1000 Fish Database' which is installed "
  406.     "as the default database. KingFisher may not function as desired if you "
  407.     "do not install this database.\n\nIf you do not want this database you "
  408.     "may terminate the Installation process. Bewarned that some cleanup "
  409.     "procedures will be omitted in that case, but this is nothing serious."))
  410.     (assigns))
  411.   (working "\nContinuing installation...")
  412.   (viewreadme)
  413.   (foreach "KF2-Inst-2:" "1000Fish#?.(data|index)(%|.gz)"
  414.     (condcopy))))
  415.  
  416. (viewreadme)
  417.  
  418. (complete 100)
  419.  
  420. (delete "ram:gunzip")
  421. (delete "ram:WrapGuide")
  422.  
  423. (makeassign "KFDEST")
  424. (makeassign "KFINST")
  425. (makeassign "KF2-Inst-1")
  426. (makeassign "KF2-Inst-2")
  427.  
  428. (exit)
  429.