home *** CD-ROM | disk | FTP | other *** search
/ Amiga MA Magazine 1998 #3 / amigamamagazinepolishissue1998.iso / szachy / chaos / install < prev    next >
Text File  |  1995-03-26  |  14KB  |  435 lines

  1. ;
  2. ;   Chaos:            The Chess HAppening Organisation System    V5.3
  3. ;   Copyright (C)   1993    Jochen Wiedmann
  4. ;
  5. ;   This program is free software; you can redistribute it and/or modify
  6. ;   it under the terms of the GNU General Public License as published by
  7. ;   the Free Software Foundation; either version 2 of the License, or
  8. ;   (at your option) any later version.
  9. ;
  10. ;   This program is distributed in the hope that it will be useful,
  11. ;   but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ;   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13. ;   GNU General Public License for more details.
  14. ;
  15. ;   You should have received a copy of the GNU General Public License
  16. ;   along with this program; if not, write to the Free Software
  17. ;   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18. ;
  19. ;   This is the Installation-script (Installer 1.24)
  20. ;   $VER: Chaos-Install 5.3 (23.03.94)
  21. ;
  22.  
  23.  
  24. ;
  25. ;   Printing the disclaimer
  26. ;
  27. ;============================================================================
  28. ;   English strings
  29. (set default_lang 2)
  30.  
  31. (set #Chaos-Message (cat
  32.     "Chaos:     The Chess HAppening Organisation System\n\n"
  33.     "V5.3       Copyright © 1993        Jochen Wiedmann\n\n"
  34.     "This program is FREE SOFTWARE; you can redistribute "
  35.     "it and/or modify it under the terms of the GNU General "
  36.     "Public License as published by the Free Software "
  37.     "Foundation; either version 2 or any later version.\n\n"
  38.     "This program is distributed in the hope that it will be "
  39.     "useful, but WITHOUT ANY WARRANTY! See the GNU General "
  40.     "Public License (in the COPYING-file) for more details."
  41. ))
  42.  
  43. (set #Kickstart-Message
  44.     "Sorry, you need Kickstart 2.04 or higher to run Chaos!"
  45. )
  46.  
  47. (set #Ask-Bindir-Help (cat
  48.     "We begin with installing the binary.\n\n"
  49.     "You are asked to select a directory where this "
  50.     "should go to. Typical choices would be C: or Work:bin "
  51.     "for running Chaos as a CLI-command and "
  52.     "Sys: or Tools: to install Chaos as "
  53.     "a Workbench-application.\n\n"
  54.     "Other parts of the program will go to different places. "
  55.     "You will be asked for them later.\n\n\n"
  56. ))
  57.  
  58. (set #Ask-Bindir-Message "Please select a binary-directory:")
  59.  
  60. (set #Copying-binary-Message "Copying the binary...")
  61.  
  62. ;   The following must contain a '%s' which will receive a directory-name
  63. (set #Ask-s-dir-Help (cat
  64.     "We go on selecting a directory where the default-icon "
  65.     "(called Chaos_Project.icon) will live.\n\n"
  66.     "Chaos will look for it in %s or s:.\n\n\n"
  67. ))
  68.  
  69. ;   The following must contain a '%s' which will receive a directory-name
  70. (set #Ask-s-dir-Message
  71.     "Please select an icon-directory\n(s: or %s recommended)"
  72. )
  73.  
  74. (set #Copying-s-Message "Copying the default-icon...")
  75.  
  76. (set #Ask-Languages-Help (cat
  77.     "The last thing that should be installed are the catalogs.\n\n"
  78.     "Catalogs allow to use Chaos in different languages. "
  79.     "Currently only German and English are possible.\n\n"
  80.     "You are asked to select the languages that should be installed "
  81.     "by clicking on the related buttons.\n\n\n"
  82. ))
  83.  
  84. (set #Ask-Languages-Message
  85.     "Please select the languages that should be installed:"
  86. )
  87.  
  88. ;   The following must contain a '%s' which will receive a directory-name
  89. (set #Ask-Cat-dir-Help (cat
  90.     "The Catalog-files should be installed in a directory where Chaos "
  91.     "will find them. Chaos will look into %s and Locale:Catalogs.\n\n\n"
  92. ))
  93.  
  94. ;   The following must contain a '%s' which will receive a directory-name
  95. (set #Ask-Cat-dir-Message (cat
  96.     "Please select a catalog-directory\n(%s or Locale:Catalogs "
  97.     "recommended)"
  98. ))
  99.  
  100. (set #Copying-Cat-Message "Copying the Catalogs...")
  101.  
  102. (set #Set-Default-Language "Setting the icons default language...")
  103. (set #Set-Default-Language-Help (cat
  104.     "It is possible to use other languages than german even without the "
  105.     "locale.library. The icon needs a tooltype LANGUAGE in that case, "
  106.     "which i want to setup now.\n\n"
  107. ))
  108.  
  109. (set #Ask-Install-Rexx-Message "Should I install the ARexx examples?")
  110. (set #Ask-Install-Rexx-Help (cat
  111.     "There are some example scripts to show how to use Chaos from an ARexx "
  112.     "program. Chaos doesn't need them, but they are probably useful for "
  113.     "you, if you wish to add special facilities to Chaos.\n\n"
  114.     "Please decide, if these should be installed too.\n\n"
  115. ))
  116.  
  117. ;   The following must contain a '%s' which will receive a directory-name
  118. (set #Ask-Rexx-Dir-Message (cat
  119.     "Please select a directory where to install the ARexx scripts. "
  120.     "(%s or Rexx: recommended.)"
  121. ))
  122.  
  123. ;   The following must contain a '%s' which will receive a directory-name
  124. (set #Ask-Rexx-Dir-Help (cat
  125.     "You should select a directory for the ARexx scripts. Chaos does not "
  126.     "know them and so any special place is possible. "
  127.     "%s or Rexx: are recommended.\n\n"
  128. ))
  129.  
  130. (set #Copying-Rexx-Dir-Message "Copying the ARexx examples...")
  131.  
  132. ;============================================================================
  133. ;   German strings
  134. (if (= @language "deutsch")
  135. (
  136.  
  137. (set default_lang 1)
  138.  
  139. (set #Chaos-Message (cat
  140.     "Chaos:     The Chess HAppening Organisation System\n"
  141.     "V5.3       Copyright © 1993        Jochen Wiedmann\n\n"
  142.     "Dieses Programm ist FREIE SOFTWARE; Sie können sie verändern "
  143.     "und/oder weitergeben, sofern Sie dabei "
  144.     "die Regeln und Bestimmungen der `GNU General Public License' "
  145.     "(Version 2 oder eine neuere Version ihrer Wahl) beachten.\n\n"
  146.     "Dieses Programm wird veröffentlicht in der Hoffnung, daß es "
  147.     "nützlich sein wird, aber OHNE JEDE GARANTIE! Bitte lesen Sie "
  148.     "Details in der `GNU General Public License', die in der "
  149.     "Datei COPYING enthalten sein muß!"
  150. ))
  151.  
  152. (set #Kickstart-Message (cat
  153.     "Tut mir leid, aber Sie brauchen Kickstart 2.04 oder höher, "
  154.     "um Chaos zu benutzen!"
  155. ))
  156.  
  157. (set #Ask-Bindir-Help (cat
  158.     "Wir beginnen mit der Installation des eigentlichen Programms.\n\n"
  159.     "Sie sollten ein Directory auswählen, wohin dieses kopiert wird, "
  160.     "z.B. C: oder Work:bin, um Chaos als CLI-Programm zu installieren "
  161.     "oder Sys: oder Work: um Chaos auf der Workbench zu installieren.\n\n"
  162.     "Andere Teile des Programms werden in andere Directories kopiert, "
  163.     "die Sie später bestimmen können.\n\n\n"
  164. ))
  165.  
  166. (set #Ask-Bindir-Message
  167.     "Bitte wählen Sie ein Directory für das eigentliche Programm."
  168. )
  169.  
  170. (set #Copying-binary-Message "Kopieren des Programms...")
  171.  
  172. ;   The following must contain a '%s' which will receive a directory-name
  173. (set #Ask-s-dir-Help (cat
  174.     "Wir machen mit der Installation des Vorgabe-Icons weiter. "
  175.     "Dieses wird in der Datei Chaos_Project.icon enthalten sein.\n\n"
  176.     "Chaos sucht danach in den Directories %s oder s:.\n\n\n"
  177. ))
  178.  
  179. ;   The following must contain a '%s' which will receive a directory-name
  180. (set #Ask-s-dir-Message (cat
  181.     "Bitte wählen Sie ein Directory für das Vorgabeicon\n(%s oder s: "
  182.     "werden empfohlen)"
  183. ))
  184.  
  185. (set #Copying-s-Message "Kopieren des Vorgabe-Icons...")
  186.  
  187. (set #Ask-Languages-Help (cat
  188.     "Als letztes installieren wir die Catalog-Dateien, die es "
  189.     "erlauben, Chaos in verschiedenen Sprachen zu benutzen. "
  190.     "Zur Zeit sind leider nur Deutsch und Englisch möglich.\n\n"
  191.     "Sie sollten die gewünschten Sprachen durch Anklicken der "
  192.     "entsprechenden Gadgets anklicken.\n\n\n"
  193. ))
  194.  
  195. (set #Ask-Languages-Message
  196.     "Bitte wählen Sie die Sprachen aus, die installiert werden sollen:"
  197. )
  198.  
  199. ;   The following must contain a '%s' which will receive a directory-name
  200. (set #Ask-Cat-dir-Help (cat
  201.     "Die Catalogs müssen in einem Directory installiert werden, wo sie "
  202.     "von Chaos gesucht werden. Chaos wird in %s und Locale:Catalogs "
  203.     "danach suchen.\n\n\n"
  204. ))
  205.  
  206. ;   The following must contain a '%s' which will receive a directory-name
  207. (set #Ask-Cat-dir-Message (cat
  208.     "Bitte wählen Sie ein Directory für die Catalogs\n(%s oder "
  209.     "Locale:Catalogs werden empfohlen)"
  210. ))
  211.  
  212. (set #Copying-Cat-Message "Kopieren der Catalogs...")
  213.  
  214. (set #Set-Default-Language "Setzen der Vorgabesprache im Icon...")
  215. (set #Set-Default-Language-Help (cat
  216.     "Selbst ohne die locale.library ist es möglich, andere Sprachen als "
  217.     "Englisch zu benutzen. In diesem Fall muß allerdings der Tooltyp "
  218.     "LANGUAGE im Icon gesetzt werden, was ich jetzt tun will.\n\n"
  219. ))
  220.  
  221. (set #Ask-Install-Rexx-Message
  222.     "Soll ich auch die ARexx-Beispiele installieren?"
  223. )
  224. (set #Ask-Install-Rexx-Help (cat
  225.     "Es gibt einige Beispielskripte, die die Benutzung von Chaos aus "
  226.     "einem ARexx-Programm dokumentieren. Chaos benötigt diese Skripts "
  227.     "nicht, aber sie könnten nützlich sein, falls Sie einmal selbst "
  228.     "zusätzliche Möglichkeiten in Chaos einbauen möchten.\n\n"
  229.     "Bitte entscheiden Sie, ob ich diese Skriptdateien ebenfalls "
  230.     "installieren soll.\n\n"
  231. ))
  232.  
  233. ;   The following must contain a '%s' which will receive a directory-name
  234. (set #Ask-Rexx-Dir-Message (cat
  235.     "Bitte wählen Sie ein Directory, in dem ich die ARexx-Skripte "
  236.     "installieren soll. (Ich empfehle %s oder Rexx:)"
  237. ))
  238.  
  239. ;   The following must contain a '%s' which will receive a directory-name
  240. (set #Ask-Rexx-Dir-Help (cat
  241.     "Sie sollten ein Directory wählen, in das die ARexx-Skripte kopiert "
  242.     "werden. Chaos benützt diese nicht, jedes Directory ist deshalb "
  243.     "möglich. Üblich sind %s oder Rexx:\n\n"
  244. ))
  245.  
  246. (set #Copying-Rexx-Dir-Message "Kopieren der ARexx-Beispiele...")
  247.  
  248. ))
  249. ;============================================================================
  250. ;   Welcome the User
  251. ;
  252. (user 1)
  253. (welcome)
  254. (set old_level @user-level)
  255. (user 2)
  256. (message #Chaos-Message)
  257. (user old_level)
  258.  
  259.  
  260. ;============================================================================
  261. ;   Check the Kickstart-version and abort if we are running V36 or lower.
  262. ;
  263. (set ver (/ (getversion "exec.library" (resident)) 65536))
  264. (if (< ver 37)
  265. (   (abort #Kickstart-Message)
  266. ))
  267.  
  268.  
  269. ;============================================================================
  270. ;   Select a directory for the binary
  271. ;
  272. (set destdir "c:")
  273. (if  (= @user-level 1)
  274. (   (set destdir (askdir
  275.     (prompt #Ask-Bindir-Message)
  276.     (help #Ask-Bindir-Help @askdir-help)
  277.     (default destdir)
  278.     ))
  279. ))
  280.  
  281.  
  282. ;============================================================================
  283. ;   Copy the binary
  284. ;
  285. (set destdir (copyfiles
  286.     (prompt #Copying-binary-Message)
  287.     (help #Ask-Bindir-Help @copyfiles-help)
  288.     (source "")
  289.     (dest destdir)
  290.     (choices "Chaos" "Chaos.info")
  291.     (confirm 1)
  292. ))
  293. (set @default-dest destdir)
  294.  
  295.  
  296. ;============================================================================
  297. ;   Select a directory where the default-icon will go to.
  298. ;
  299. (set sdestdir (tackon destdir "s"))
  300. (if (< @user-level 2)
  301. (   (set sdestdir (askdir
  302.     (prompt (#Ask-s-dir-Message sdestdir))
  303.     (help (cat (#Ask-s-dir-Help sdestdir) @askdir-help))
  304.     (default (select @user-level "s:" sdestdir))
  305.     (newpath)
  306.     ))
  307. ))
  308.  
  309.  
  310. ;============================================================================
  311. ;   Copy the default-icon
  312. ;
  313. (copyfiles
  314.     (prompt #Copying-s-Message)
  315.     (help (#Ask-s-dir-Help sdestdir) @copyfiles-help)
  316.     (source "s")
  317.     (dest sdestdir)
  318.     (all)
  319.     (confirm)
  320. )
  321.  
  322.  
  323. ;============================================================================
  324. ;   Ask, if the ARexx scripts should be installed too.
  325. ;
  326. (user 2)
  327. (set installARexx (askbool
  328.     (prompt #Ask-Install-Rexx-Message)
  329.     (help #Ask-Install-Rexx-Help)
  330. ))
  331.  
  332.  
  333. ;============================================================================
  334. ;   Select a directory where the Arexx scripts will go to.
  335. ;
  336. (if (= installARexx 1)
  337. (   (set ARexxdestdir (tackon destdir "Rexx"))
  338.     (set ARexxdestdir (askdir
  339.     (prompt (#Ask-Rexx-Dir-Message ))
  340.     (help (cat (#Ask-Rexx-Dir-Help ARexxdestdir) @askdir-help))
  341.     (default (select old_level "Rexx:" ARexxdestdir ARexxdestdir))
  342.     (newpath)
  343.     ))
  344. ))
  345. (user old_level)
  346.  
  347.  
  348. ;============================================================================
  349. ;   Copy the ARexx scripts
  350. ;
  351. (if (= installARexx 1)
  352. (   (copyfiles
  353.     (prompt #Copying-Rexx-Dir-Message)
  354.     (help (#Ask-Rexx-Dir-Help ARexxdestdir) @copyfiles-help)
  355.     (source "Rexx")
  356.     (dest ARexxdestdir)
  357.     (all)
  358.     (confirm)
  359.     )
  360. ))
  361.  
  362.  
  363. ;============================================================================
  364. ;   Check for locale.library
  365. ;
  366. (set catdestdir_is_set (NOT @user-level))
  367. (set catdestdir "Locale:Catalogs")
  368. (if (AND  (NOT (exists "Locale:"))  (NOT @user-level))
  369. (   (set catdestdir "Catalogs")
  370. ))
  371.  
  372.  
  373. ;============================================================================
  374. ;   Install the catalogs
  375. ;
  376. (user 2)
  377. (set languages (askoptions
  378.     (prompt #Ask-Languages-Message)
  379.     (help #Ask-Languages-Help @askoptions-help)
  380.     (choices "Deutsch" "English")
  381.     (default default_lang)
  382. ))
  383. (user old_level)
  384.  
  385. (set n 0)
  386. (while (set thislanguage (select n "Deutsch" "English" ""))
  387. (   (if (AND (<> n 1) (BITAND languages (shiftleft 1 n)))
  388.     (   (if (NOT catdestdir_is_set)
  389.     (   (set catdestdir (tackon destdir "Catalogs"))
  390.         (if (= 1 @user-level)
  391.         (   (set catdestdir (askdir
  392.             (prompt (#Ask-Cat-dir-Message catdestdir))
  393.             (help (#Ask-Cat-dir-Help catdestdir) @askdir-help)
  394.             (default catdestdir)
  395.             (newpath)
  396.         ))
  397.         ))
  398.         (set catdestdir_is_set 1)
  399.     ))
  400.  
  401.     (if (<> (exists catdestdir) 2)
  402.     (   (makedir catdestdir)
  403.     ))
  404.     (set catdestdir (pathonly (copyfiles
  405.         (prompt #Copying-Cat-Message)
  406.         (help (#Ask-Cat-dir-help (tackon destdir "Catalogs"))
  407.            @copyfiles-help)
  408.         (source (tackon "Catalogs" thislanguage))
  409.         (dest (tackon catdestdir thislanguage))
  410.         (all)
  411.         (confirm)
  412.     )))
  413.     (if (AND (= (+ n 1) default_lang) (= ver 37))
  414.     (   (if (<> default_lang 2)
  415.         (   (tooltype
  416.             (prompt #Set-Default-Language)
  417.             (help #Set-Default-Language-Help)
  418.             (setstack 20000)
  419.             (noposition)
  420.             (dest (tackon destdir "Chaos.info"))
  421.             (settooltype "(This is the default icon's path.)")
  422.             (settooltype "(s: will be searched additionally.)")
  423.             (settooltype (cat "(DEFICON=" @sdestdir ")"))
  424.             (settooltype "(This suppresses creation of icons.)")
  425.             (settooltype "(NOICONS)")
  426.             (settooltype "(This is for workbench 2.0 only!)")
  427.             (settooltype "(Not needed if language is english.)")
  428.             (settooltype (cat "LANGUAGE=" @language))
  429.         )
  430.         ))
  431.     ))
  432.     ))
  433.     (set n (+ n 1))
  434. ))
  435.