2 ; $VER: Install 1.1 (30.06.2010)
4 ; $Id: Install 228 2012-12-20 14:51:09Z damato $
8 ; 1.0 29.06.2010: initial release
9 ; 1.1 30.06.2010: ask the user whether the *.sd files should be installed
10 ; 1.2 20.12.2012: added 3.x to MorphOS install decription
12 ;----------------------------------------------------------------------------
13 ; /// language bit definition, do not change these!!
21 (set #lang_norwegian 7)
24 (set #lang_finnish 10)
25 (set #lang_hungarian 11)
27 (set #lang_turkish 13)
28 (set #lang_russian 14)
30 (set #lang_croatian 16)
31 (set #lang_portuguese 17)
32 (set #lang_serbian 18)
33 (set #lang_slovenian 19)
34 (set #lang_english_british 20)
35 (set #lang_maximum 21)
37 ;----------------------------------------------------------------------------
38 ; /// default language detection
40 (while (<> @language (select #i "deutsch" @language))
43 (if (= #i 2) ; LANGUAGE
44 (set #language "english")
45 (set #language @language)
49 (set #defaultLanguages %10000000000000000000)
50 (while (<> #language (select #i "slovensko" "srpski" "português" "hrvatski" "czech" "russian" "türkçe" "greek" "magyar" "suomi" "polski" "svenska" "norsk" "nederlands" "italiano" "dansk" "español" "français" "deutsch" #language))
53 (set #defaultLanguages (shiftright #defaultLanguages 1))
56 ; always add english as default language
57 (set #defaultLanguages (bitor #defaultLanguages (shiftleft 1 #lang_english)))
59 ; scan the Locale/Catalogs directory for supported languages
60 (set #supportedLanguages %00000000000000000000)
61 (foreach "Locale/Catalogs" "#?"
63 (while (<> @each-name (select #i "english" "german" "french" "spanish" "danish" "italian" "dutch" "norwegian" "swedish" "polish" "finnish" "hungarian" "greek" "turkish" "russian" "czech" "croatian" "portuguese" "serbian" "slovenian" @each-name))
66 (if (<> #lang_maximum #i)
67 (set #supportedLanguages (bitor #supportedLanguages (shiftleft 1 #i)))
70 ; always add english as default supported language
71 (set #supportedLanguages (bitor #supportedLanguages (shiftleft 1 #lang_english)))
73 ;----------------------------------------------------------------------------
75 (if (= #language "english")
77 (set #acknowledgeOS (cat "Please acknowledge the automatic\n"
78 "detection of your operating system:"))
79 (set #FlexCat_dir (cat "Please select a directory for FlexCat\n"
80 "(NO extra drawer will be created!)"))
81 (set #installSDFiles (cat "Do you want to install the #?.sd files?\n"
83 "These are only required if you want to\n"
84 "use FlexCat to generate source code.\n"
86 "Translators usually don't need these files."))
88 @app-name " has been successfully installed."))
94 (if (= #language "deutsch")
96 (set #acknowledgeOS (cat "Bitte bestätigen Sie die automatische\n"
97 "Ermittlung Ihres Betriebssystems:"))
98 (set #FlexCat_dir (cat "Wählen Sie ein Verzeichnis für FlexCat\n"
99 "(es wird KEIN eigenes Verzeichnis erstellt!)"))
100 (set #installSDFiles (cat "Wollen Sie die #?.sd Dateien installieren?\n"
102 "Diese werden nur benötigt, wenn Sie FlexCat\n"
103 "zum Erstellen von Quellcode benutzen wollen.\n"
105 "Übersetzer benötigen diese Dateien\n"
106 "üblicherweise nicht."))
108 @app-name " wurde erfolgreich installiert."))
112 ;----------------------------------------------------------------------------
113 ; /// Checking environment
114 (set EXEC_ver (getversion "exec.library" (resident)))
115 (set NEWLIB_ver (getversion "newlib.library" (resident)))
116 (set AROS_ver (getversion "aros.library" (resident)))
118 ; we use newlib.library to check whether we are running on AmigaOS 4.x
119 (if (>= NEWLIB_ver (* 4 65536))
120 (set #detectedSystem 1)
122 ; we are not running on AmigaOS 4.x
123 (if (>= AROS_ver (* 40 65536))
124 (set #detectedSystem 3)
126 ; we are not running on AROS
127 ; now check if we are running on MorphOS (exec.library V50+) or on AmigaOS 3.x
128 (if (>= EXEC_ver (* 50 65536))
129 (set #detectedSystem 2)
130 (set #detectedSystem 0)
139 (prompt #acknowledgeOS)
140 (help @askchoice-help)
141 (choices "AmigaOS 3.x"
143 "MorphOS 1.x/2.x/3.x"
148 (default #detectedSystem)
151 ; finally convert the system number into a string for easier understanding
153 (select #detectedSystem "os3" "os4" "mos" "aros-i386" "aros-ppc" "aros-x86_64")
156 (if (= #detectedSystem "os4")
157 ; AmigaOS 4.x uses english locale names only
159 (set #cat_name_english "english")
160 (set #cat_name_german "german")
161 (set #cat_name_french "french")
162 (set #cat_name_spanish "spanish")
163 (set #cat_name_danish "danish")
164 (set #cat_name_italian "italian")
165 (set #cat_name_dutch "dutch")
166 (set #cat_name_norwegian "norwegian")
167 (set #cat_name_swedish "swedish")
168 (set #cat_name_polish "polish")
169 (set #cat_name_finnish "finnish")
170 (set #cat_name_hungarian "hungarian")
171 (set #cat_name_greek "greek")
172 (set #cat_name_turkish "turkish")
173 (set #cat_name_russian "russian")
174 (set #cat_name_czech "czech")
175 (set #cat_name_croatian "croatian")
176 (set #cat_name_portuguese "portuguese")
177 (set #cat_name_serbian "serbian")
178 (set #cat_name_slovenian "slovenian")
179 (set #cat_name_english_british "english-british")
181 ; all other systems use localized locale names
183 (set #cat_name_english "english")
184 (set #cat_name_german "deutsch")
185 (set #cat_name_french "français")
186 (set #cat_name_spanish "español")
187 (set #cat_name_danish "dansk")
188 (set #cat_name_italian "italiano")
189 (set #cat_name_dutch "nederlands")
190 (set #cat_name_norwegian "norsk")
191 (set #cat_name_swedish "svenska")
192 (set #cat_name_polish "polski")
193 (set #cat_name_finnish "suomio")
194 (set #cat_name_hungarian "magyar")
195 (set #cat_name_greek "greek")
196 (set #cat_name_turkish "türkçe")
197 (set #cat_name_russian "russian")
198 (set #cat_name_czech "czech")
199 (set #cat_name_croatian "hrvatski")
200 (set #cat_name_portuguese "português")
201 (set #cat_name_serbian "srpski")
202 (set #cat_name_slovenian "slovensko")
203 (set #cat_name_english_british "english-british")
207 ; set up the source and destination path
208 (if (= #detectedSystem "os3")
209 (set #EXE_source "AmigaOS3")
211 (if (= #detectedSystem "os4")
212 (set #EXE_source "AmigaOS4")
214 (if (= #detectedSystem "mos")
215 (set #EXE_source "MorphOS")
217 (if (= #detectedSystem "aros-i386")
218 (set #EXE_source "AROS-i386")
220 (if (= #detectedSystem "aros-ppc")
221 (set #EXE_source "AROS-ppc")
223 (if (= #detectedSystem "aros-x86_64")
224 (set #EXE_source "AROS-x86_64")
228 ; /// Let's ask user for anything
233 (prompt #FlexCat_dir)
241 (prompt #installSDFiles)
243 (help #installSDFiles)
249 (prompt #lang_catalog)
250 (help @askoptions-help)
252 (if (in #supportedLanguages #lang_english)
253 (cat #prop "English")
256 (if (in #supportedLanguages #lang_german)
257 (cat #prop "Deutsch")
260 (if (in #supportedLanguages #lang_french)
261 (cat #prop "Français")
264 (if (in #supportedLanguages #lang_spanish)
265 (cat #prop "Español")
268 (if (in #supportedLanguages #lang_danish)
272 (if (in #supportedLanguages #lang_italian)
273 (cat #prop "Italiano")
276 (if (in #supportedLanguages #lang_dutch)
277 (cat #prop "Nederlands")
280 (if (in #supportedLanguages #lang_norwegian)
284 (if (in #supportedLanguages #lang_swedish)
285 (cat #prop "Svenska")
288 (if (in #supportedLanguages #lang_polish)
292 (if (in #supportedLanguages #lang_finnish)
296 (if (in #supportedLanguages #lang_hungarian)
300 (if (in #supportedLanguages #lang_greek)
301 (cat #prop "ÅëëçíéêÜ")
304 (if (in #supportedLanguages #lang_turkish)
308 (if (in #supportedLanguages #lang_russian)
309 (cat #prop "Russian")
312 (if (in #supportedLanguages #lang_czech)
316 (if (in #supportedLanguages #lang_croatian)
317 (cat #prop "Hrvatski")
320 (if (in #supportedLanguages #lang_portuguese)
321 (cat #prop "Português")
324 (if (in #supportedLanguages #lang_serbian)
328 (if (in #supportedLanguages #lang_slovenian)
329 (cat #prop "Slovensko")
332 (if (and (in #supportedLanguages #lang_english_british) (= #detectedSystem "os4"))
333 (cat #prop "English (british)")
337 (default #defaultLanguages)
345 ; copy the executable files
346 (foreach #EXE_source "#?"
349 (source (tackon #EXE_source @each-name))
352 (help @copyfiles-help)
357 (if (not (exists (tackon #FlexCat_dest "Docs")))
359 (makedir (tackon #FlexCat_dest "Docs"))
363 (dest (tackon #FlexCat_dest "Docs.info"))
364 (help @copyfiles-help)
367 (foreach "Docs" "#?.guide"
370 (source (tackon "Docs" @each-name))
371 (dest (tackon #FlexCat_dest "Docs"))
372 (help @copyfiles-help)
379 (if (<> 0 #installSD)
381 (makedir (tackon #FlexCat_dest "Lib"))
382 (foreach "Lib" "#?.sd"
385 (source (tackon "Lib" @each-name))
386 (dest (tackon #FlexCat_dest "Lib"))
387 (help @copyfiles-help)
395 ; check if there were any catalogs selected at all
396 (if (<> 0 catalog_lang)
398 ; copy the .cd files for people wanting to translate
399 (foreach "Locale" "#?.cd"
401 (source (tackon "Locale" @each-name))
402 (dest "LOCALE:Catalogs")
403 (help @copyfiles-help)
407 ; german catalog file
408 (if (in catalog_lang #lang_german)
410 (makedir (tackon "LOCALE:Catalogs" #cat_name_german))
412 (foreach "Locale/Catalogs/german" "#?.catalog"
414 (source (tackon "Locale/Catalogs/german" @each-name))
415 (dest (tackon "LOCALE:Catalogs" #cat_name_german))
416 (help @copyfiles-help)
422 ; french catalog file
423 (if (in catalog_lang #lang_french)
425 (makedir (tackon "LOCALE:Catalogs" #cat_name_french))
427 (foreach "Locale/Catalogs/french" "#?.catalog"
429 (source (tackon "Locale/Catalogs/french" @each-name))
430 (dest (tackon "LOCALE:Catalogs" #cat_name_french))
431 (help @copyfiles-help)
437 ; spanish catalog file
438 (if (in catalog_lang #lang_spanish)
440 (makedir (tackon "LOCALE:Catalogs" #cat_name_spanish))
442 (foreach "Locale/Catalogs/spanish" "#?.catalog"
444 (source (tackon "Locale/Catalogs/spanish" @each-name))
445 (dest (tackon "LOCALE:Catalogs" #cat_name_spanish))
446 (help @copyfiles-help)
452 ; danish catalog file
453 (if (in catalog_lang #lang_danish)
455 (makedir (tackon "LOCALE:Catalogs" #cat_name_danish))
457 (foreach "Locale/Catalogs/danish" "#?.catalog"
459 (source (tackon "Locale/Catalogs/danish" @each-name))
460 (dest (tackon "LOCALE:Catalogs" #cat_name_danish))
461 (help @copyfiles-help)
467 ; italian catalog file
468 (if (in catalog_lang #lang_italian)
470 (makedir (tackon "LOCALE:Catalogs" #cat_name_italian))
472 (foreach "Locale/Catalogs/italian" "#?.catalog"
474 (source (tackon "Locale/Catalogs/italian" @each-name))
475 (dest (tackon "LOCALE:Catalogs" #cat_name_italian))
476 (help @copyfiles-help)
483 (if (in catalog_lang #lang_dutch)
485 (makedir (tackon "LOCALE:Catalogs" #cat_name_dutch))
487 (foreach "Locale/Catalogs/dutch" "#?.catalog"
489 (source (tackon "Locale/Catalogs/dutch" @each-name))
490 (dest (tackon "LOCALE:Catalogs" #cat_name_dutch))
491 (help @copyfiles-help)
497 ; norwegian catalog file
498 (if (in catalog_lang #lang_norwegian)
500 (makedir (tackon "LOCALE:Catalogs" #cat_name_norwegian))
502 (foreach "Locale/Catalogs/norwegian" "#?.catalog"
504 (source (tackon "Locale/Catalogs/norwegian" @each-name))
505 (dest (tackon "LOCALE:Catalogs" #cat_name_norwegian))
506 (help @copyfiles-help)
512 ; swedish catalog file
513 (if (in catalog_lang #lang_swedish)
515 (makedir (tackon "LOCALE:Catalogs" #cat_name_swedish))
517 (foreach "Locale/Catalogs/swedish" "#?.catalog"
519 (source (tackon "Locale/Catalogs/swedish" @each-name))
520 (dest (tackon "LOCALE:Catalogs" #cat_name_swedish))
521 (help @copyfiles-help)
527 ; polish catalog file
528 (if (in catalog_lang #lang_polish)
530 (makedir (tackon "LOCALE:Catalogs" #cat_name_polish))
532 (foreach "Locale/Catalogs/polish" "#?.catalog"
534 (source (tackon "Locale/Catalogs/polish" @each-name))
535 (dest (tackon "LOCALE:Catalogs" #cat_name_polish))
536 (help @copyfiles-help)
542 ; finnish catalog file
543 (if (in catalog_lang #lang_finnish)
545 (makedir (tackon "LOCALE:Catalogs" #cat_name_finnish))
547 (foreach "Locale/Catalogs/finnish" "#?.catalog"
549 (source (tackon "Locale/Catalogs/finnish" @each-name))
550 (dest (tackon "LOCALE:Catalogs" #cat_name_finnish))
551 (help @copyfiles-help)
557 ; hungarian catalog file
558 (if (in catalog_lang #lang_hungarian)
560 (makedir (tackon "LOCALE:Catalogs" #cat_name_hungarian))
562 (foreach "Locale/Catalogs/hungarian" "#?.catalog"
564 (source (tackon "Locale/Catalogs/hungarian" @each-name))
565 (dest (tackon "LOCALE:Catalogs" #cat_name_hungarian))
566 (help @copyfiles-help)
573 (if (in catalog_lang #lang_greek)
575 (makedir (tackon "LOCALE:Catalogs" #cat_name_greek))
577 (foreach "Locale/Catalogs/greek" "#?.catalog"
579 (source (tackon "Locale/Catalogs/greek" @each-name))
580 (dest (tackon "LOCALE:Catalogs" #cat_name_greek))
581 (help @copyfiles-help)
587 ; turkish catalog file
588 (if (in catalog_lang #lang_turkish)
590 (makedir (tackon "LOCALE:Catalogs" #cat_name_turkish))
592 (foreach "Locale/Catalogs/turkish" "#?.catalog"
594 (source (tackon "Locale/Catalogs/turkish" @each-name))
595 (dest (tackon "LOCALE:Catalogs" #cat_name_turkish))
596 (help @copyfiles-help)
602 ; russian catalog file
603 (if (in catalog_lang #lang_russian)
605 (makedir (tackon "LOCALE:Catalogs" #cat_name_russian))
607 (foreach "Locale/Catalogs/russian" "#?.catalog"
609 (source (tackon "Locale/Catalogs/russian" @each-name))
610 (dest (tackon "LOCALE:Catalogs" #cat_name_russian))
611 (help @copyfiles-help)
618 (if (in catalog_lang #lang_czech)
620 (makedir (tackon "LOCALE:Catalogs" #cat_name_czech))
622 (foreach "Locale/Catalogs/czech" "#?.catalog"
624 (source (tackon "Locale/Catalogs/czech" @each-name))
625 (dest (tackon "LOCALE:Catalogs" #cat_name_czech))
626 (help @copyfiles-help)
632 ; croatian catalog file
633 (if (in catalog_lang #lang_croatian)
635 (makedir (tackon "LOCALE:Catalogs" #cat_name_croatian))
637 (foreach "Locale/Catalogs/croatian" "#?.catalog"
639 (source (tackon "Locale/Catalogs/croatian" @each-name))
640 (dest (tackon "LOCALE:Catalogs" #cat_name_croatian))
641 (help @copyfiles-help)
647 ; portuguese catalog file
648 (if (in catalog_lang #lang_portuguese)
650 (makedir (tackon "LOCALE:Catalogs" #cat_name_portuguese))
652 (foreach "Locale/Catalogs/portuguese" "#?.catalog"
654 (source (tackon "Locale/Catalogs/portuguese" @each-name))
655 (dest (tackon "LOCALE:Catalogs" #cat_name_portuguese))
656 (help @copyfiles-help)
662 ; serbian catalog file
663 (if (in catalog_lang #lang_serbian)
665 (makedir (tackon "LOCALE:Catalogs" #cat_name_serbian))
667 (foreach "Locale/Catalogs/serbian" "#?.catalog"
669 (source (tackon "Locale/Catalogs/serbian" @each-name))
670 (dest (tackon "LOCALE:Catalogs" #cat_name_serbian))
671 (help @copyfiles-help)
677 ; slovenian catalog file
678 (if (in catalog_lang #lang_slovenian)
680 (makedir (tackon "LOCALE:Catalogs" #cat_name_slovenian))
682 (foreach "Locale/Catalogs/slovenian" "#?.catalog"
684 (source (tackon "Locale/Catalogs/slovenian" @each-name))
685 (dest (tackon "LOCALE:Catalogs" #cat_name_slovenian))
686 (help @copyfiles-help)
692 ; english-british catalog file, only AmigaOS4.x can handle this
693 (if (and (in catalog_lang #lang_english_british) (= #detectedSystem "os4"))
695 (makedir (tackon "LOCALE:Catalogs" #cat_name_english_british))
697 (foreach "Locale/Catalogs/english-british" "#?.catalog"
699 (source (tackon "Locale/Catalogs/english-british" @each-name))
700 (dest (tackon "LOCALE:Catalogs" #cat_name_english_british))
701 (help @copyfiles-help)
713 ; /// ********************
714 ;----------------------------------------------------------------------------