home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 8 / FreshFishVol8-CD1.bin / new / util / edit / polyed / install < prev    next >
Text File  |  1994-10-04  |  7KB  |  334 lines

  1. ; $VER: Install 1.0
  2. ; Script to install PolyEd
  3.  
  4. (complete 0)
  5.  
  6. ;=============================================================================
  7. ; strings
  8.  
  9. (set #bad-kick
  10. (cat "You must be using Kickstart 2.0 or higher to install PolyEd."
  11. ))
  12.  
  13. (set #introduction
  14. (cat "\n\nThis program lets you install PolyEd on a hard drive."
  15. ))
  16.  
  17. (set #which-language
  18. (cat "\nWhich languages should be installed?"
  19. ))
  20.  
  21. (set #which-iconset
  22. (cat "\nWhich icon set should be installed?"
  23. ))
  24.  
  25.  
  26. (set #which-language-help
  27. (cat "\nThe Amiga can be operated in many different "
  28.      "languages. "
  29.      "To reduce the amount of space consumed by the "
  30.      "language files, you can select only the "
  31.      "files of specific languages to be copied.\n\n"
  32.      "Check the boxes of the languages you wish "
  33.      "to have available on your system.\n\n"
  34.      @askoptions-help
  35. ))
  36.  
  37. (set #which-iconset-help
  38. (cat "\nThis package provides two sets of icons, one for standard workbench and "
  39.      "one for the 'MagicWB'. Select the set you want to use.\n"
  40.      @askchoice-help
  41. ))
  42.  
  43. (set #startup-help
  44. (cat "\nAn assign to the PolyEd drawer called PED: "
  45.      "and the inclusion of that assign to the "
  46.      "paths where AmigaOS looks for programs is "
  47.      "being added to the user-startup"
  48. ))
  49.  
  50. ;=============================================================================
  51. ; make sure we are running under V37+
  52.  
  53. (set osversion (/ (getversion) 65536))
  54. (if (< osversion 37)
  55. (
  56.     (abort #bad-kick)
  57. ))
  58.  
  59. ;=============================================================================
  60. ; say hi!
  61.  
  62. ;(set old_level @user-level)    ; remember user-level
  63. ;(user 2)                    ; for message is shown
  64. ;(message #introduction)        ; show intro message
  65.  
  66. ;(user old_level)            ; revert to original user-level
  67.  
  68. ;(welcome)
  69.  
  70. ;=============================================================================
  71. ; get target
  72.  
  73. (set old_level @user-level)    ; remember user-level
  74. (user 2)
  75.  
  76. (set target (askdir (prompt "Where do you want the PolyEd drawer to be placed in?")
  77.             (help @askdir-help)
  78.             (default "SYS:Tools")
  79.         )
  80. )
  81. (user old_level)
  82. (set @default-dest target)
  83.  
  84. ;=============================================================================
  85. ; which languages should be installed?
  86.  
  87. (user 2)
  88. (set lang (askoptions (prompt #which-language)
  89.               (help #which-language-help)
  90.               (choices
  91. ;                    "Dansk"
  92.                     "Deutsch"
  93.                     "English"
  94. ;                    "Español"
  95. ;                    "Français"
  96. ;                    "Italiano"
  97. ;                    "Nederlands"
  98. ;                    "Norsk"
  99. ;                    "Português"
  100. ;                    "Svenska"
  101.                 )
  102.               (default -1)
  103.       )
  104. )
  105. (user old_level)
  106.  
  107. ;=============================================================================
  108. ; which icon set should be installed (Standard or MagicWB)
  109.  
  110. (set iconset (askchoice (prompt #which-iconset)
  111.                         (help #which-iconset-help)
  112.                         (choices "Standard" "MagicWB")
  113.             )
  114. )
  115.  
  116. ;=============================================================================
  117. ; Copy required libraries for V37
  118.  
  119. (if (= osversion 37)
  120. (
  121.     (copylib
  122.         (help #v37needslibs)
  123.         (source "Libs/reqtools.library")
  124.         (dest "LIBS:")
  125.     )
  126.  
  127.     (copylib
  128.         (help #v37needslibs)
  129.         (source "Libs/amigaguide.library")
  130.         (dest "LIBS:")
  131.     )
  132. ))
  133. (complete 10)
  134. ;=============================================================================
  135. ; make some drawers
  136.  
  137. (set supertarget target)
  138. (set target (tackon target "PolyEd"))
  139. (makedir target (infos) (prompt "Creating some drawers..."))
  140. (makedir (tackon target "Doc"))
  141.  
  142. ;=============================================================================
  143. ; copy main-program
  144.  
  145. (copyfiles (prompt "")
  146.        (help @copyfiles-help)
  147.        (source "ped")
  148.        (dest target)
  149. )
  150. (complete 40)
  151.  
  152. (copyfiles (prompt "")
  153.        (help @copyfiles-help)
  154.        (source "Read.Me")
  155.        (dest target)
  156. )
  157. (complete 45)
  158.  
  159. ;=============================================================================
  160. ; copy catalogs and documentation
  161.  
  162. (copyfiles (optional nofail)
  163.              (source "Doc")
  164.               (dest (tackon target "Doc"))
  165.            (pattern "arexx.#?")
  166. )
  167.  
  168. (set n 0)
  169. (while (set language (select n
  170. ;                    "Dansk"
  171.                     "Deutsch"
  172.                     "English"
  173. ;                    "Español"
  174. ;                    "Français"
  175. ;                    "Italiano"
  176. ;                    "Nederlands"
  177. ;                    "Norsk"
  178. ;                    "Português"
  179. ;                    "Svenska"
  180.                     ""
  181.              )
  182.        )
  183. (
  184.     (if (IN lang n)
  185.     (
  186.         (if (<> 1 n)    ; FIXME: Wenn Dansk verfügbar, 1 auf 2 ändern (entspricht englisch, das als Default keinen Catalog hat!)
  187.         (
  188.             (makedir (tackon target "Catalogs"))
  189.             (set catalog-dir (tackon target (cat "Catalogs/" language )))
  190.             (makedir catalog-dir)
  191.             (copyfiles
  192.                 (optional nofail)
  193.                 (source (cat "Catalogs/" language "/polyed.catalog"))
  194.                    (dest catalog-dir)
  195.             )
  196.         ))
  197.         (set #from (cat "Doc/" language ".guide"))
  198.         (if (exists #from)
  199.             (copyfiles
  200.                 (optional nofail)
  201.                 (source #from)
  202.                 (dest (tackon target "Doc"))
  203.             )
  204.         )
  205.     ))
  206.     (set n (+ n 1))
  207. ))
  208.  
  209. (complete 50)
  210.  
  211. ;=============================================================================
  212. ; copy Macros and ARexx
  213.  
  214. (copyfiles
  215.     (source "Macros")
  216.     (dest (tackon target "Macros"))
  217.     (optional nofail)
  218.     (pattern "~#?.info")
  219. )
  220. (complete 60)
  221.  
  222. (copyfiles
  223.     (source "Rexx")
  224.     (dest (tackon target "Rexx"))
  225.     (optional nofail)
  226.     (pattern "~#?.info")
  227. )
  228. (complete 70)
  229.  
  230. ;=============================================================================
  231. ; copy Icons
  232.  
  233. (if (= iconset 0)
  234.     (set iconsource "Icons/Standard")
  235.     (set iconsource "Icons/MagicWB")
  236. )
  237.  
  238. ; PolyEd Drawer
  239.  
  240. (copyfiles (source (cat iconsource ".info"))
  241.        (dest supertarget)
  242.        (newname "PolyEd.info")
  243.        (infos)
  244. )
  245.  
  246. ; Main Program and Subdrawers
  247.  
  248. (set n 0)
  249. (while (set from (select n "PEd.info" "Read.Me.info" "Doc.info" "Macros.info" "Rexx.info" ""))
  250.     (copyfiles  (source (tackon iconsource from))
  251.                 (dest target)
  252.                 (infos)
  253.     )
  254.     (set n (+ n 1))
  255. )
  256.  
  257. (set iconsource (tackon iconsource "Def_Icons"))
  258.  
  259. ; Docs
  260.  
  261. (set destdir (tackon target "Doc"))
  262. (foreach destdir "#?.guide"
  263. (
  264.     (copyfiles  (source (tackon iconsource "def_guide.info"))
  265.                 (dest destdir)
  266.             (newname (cat @each-name ".info"))
  267.               (infos)
  268.     )
  269. ))
  270. (foreach destdir "#?.doc"
  271. (
  272.     (copyfiles  (source (tackon iconsource "def_doc.info"))
  273.                 (dest destdir)
  274.         (newname (cat @each-name ".info"))
  275.         (infos)
  276.     )
  277. ))
  278.  
  279. ; Rexx
  280.  
  281. (set destdir (tackon target "Rexx"))
  282. (foreach destdir "#?.rexx"
  283. (
  284.     (copyfiles  (source (tackon iconsource "def_rexx.info"))
  285.                 (dest destdir)
  286.         (newname (cat @each-name ".info"))
  287.         (infos)
  288.     )
  289. ))
  290.  
  291. ; Macros
  292.  
  293. (set destdir (tackon target "Macros"))
  294. (foreach destdir "#?.ped"
  295. (
  296.     (copyfiles  (source (tackon iconsource "def_ped.info"))
  297.                 (dest destdir)
  298.         (newname (cat @each-name ".info"))
  299.         (infos)
  300.     )
  301. ))
  302.  
  303. ; Default Icons
  304.  
  305. (copyfiles
  306.     (source iconsource)
  307.     (dest "ENVARC:SYS")
  308.     (all)
  309.     (optional nofail)
  310.     (infos)
  311. )
  312.  
  313. (copyfiles
  314.     (source iconsource)
  315.     (dest "ENV:SYS")
  316.     (all)
  317.     (optional nofail)
  318.     (infos)
  319. )
  320.  
  321. (complete 90)
  322.  
  323. ;=============================================================================
  324. ; Make user-startup entries
  325.  
  326. (startup "PolyEd"
  327.     (prompt    "Some instructions need to be added to the \"S:user-startup\" so that your system will be properly configured to use PolyEd.")
  328.     (help #startup-help)
  329.     (command (cat "assign >NIL: PED: " target "\n"))
  330.     (command "path >NIL: PED: add")
  331. )
  332.  
  333. (complete 100)
  334.