
; Install script for EasyFR (Workbench 2.1 or higher)

(set old_level @user-level)

(set efrdir "//")
(set catalogdir "//Catalogs/")

;=============================================================================
; English strings

(set default_lang 1)

(set #bad-kick
(cat "You must be using Kickstart 2.04 to install using this script!"
))

(set #where-mail "Where should MAIL: be assigned ?")
(set #where-efr
(cat "Where would you like to install EasyFR?\n"
     "(A drawer will be created)"
))

(set #add-mail-startup
(cat "\nAdd EasyFR: assignment to the \"S:user-startup\" "
     "so that your system will be properly configured to use EasyFR?"
))

(set #which-language
(cat "\nWhich languages should be installed?"
))
(set #which-language-help
(cat "\nThe Amiga can be operated in many different"
          " languages. If you want EasyFR to use the same"
     " language as the Amiga Workbench"
          " then a catalog file must be copied to your"
          " harddisk for each language supported.\n\n"
          "To reduce the amount of space consumed by the"
          " language files, you can select to have only the"
          " files of specific languages copied.\n\n"
          "Simply check the boxes of the languages you wish"
          " to have available on your system.\n\n"
          @askoptions-help
))

(set #witch-processor
(cat "\nPlease, select witch binary version of EasyFR 2.2"
        " you would like to install.\n\n"
))
(set #witch-processor-help
(cat "\nEasyFR 2.2 is distributed in two version: one"
        " compiled for 68000 (and 68010) processors,"
        " the other compiled for 68020, 68030, 68040"
        " and 68060 processors. If you a 32 bit processors"
        " you will have better performance."
        @askoptions-help
))

(set #witch-help
(cat "\nPlease, choose the language of the on-line"
        " amigaguide help you wish to install.\n\n"
))
(set #witch-help-help
(cat "\nEasyFR has on-line help. This mean that every"
        " time you press the help key, the guide will"
        " popup displaying the section you are currently"
        " using.\n"
        @askoptions-help
))

(set #install-msg
(cat "\n\nEasyFR installation script.\n"
     "This script installs EasyFR on your Amiga.\n\n"
     "Read the documentation for more information\n"
     "on the distribution of EasyFR.\n\n"
     "EasyFR © 1994 Angelo Vizzarro\n"
     "EasyFR 2.2 © 1995-96 Francesco Dipietromaria\n"
     "All rights reserved."
))

;=============================================================================
; Italian strings

(if (= @language "italiano")
(
(set default_lang 2)

(set #bad-kick
(cat "E` necessario il Kickstart 2.04 o superiore!"))

(set #where-mail "Dove deve essere assegnato MAIL:?")
(set #where-efr
(cat "Dove vuoi installare EasyFR?\n"
     "(Verrà creato un cassetto)"
))

(set #add-mail-startup
(cat "\nDevo aggiungere l'assegnazione di EasyFR: alla \"S:user-startup\" "
     "così il sistema verrà automaticamente configurato per usare EasyFR?"
))

(set #which-language
(cat "\nQuali lingue devono essere installate? "
))

(set #which-language-help
(cat "\nAmiga può operate con lingue differenti. "
     "Per ogni lingua supportata saranno copiati "
     "numerosi file sul vostro disco fisso.\n\n"
     "Per ridurre lo spazio occupato da questi "
     "file, potete installare solo quelli di una "
     "lingua specifica.\n\n"
     "Segnate solo i riquadri delle lingue che volete "
     "siano disponibili sul vostro sistema.\n\n"
     @askoptions-help
))

(set #witch-processor
(cat "\nScegliete quale versione dell'eseguibile di"
        " EasyFR 2.2 volete installare.\n\n"
))
(set #witch-processor-help
(cat "\nEasyFR 2.2 è distribuito in due versioni: una"
        " compilata per 68000 (e 68010), l'altra"
        " compilata per 68020, 68030, 68040 e 68060."
        " Se la vostra è una macchia a 32 bit otterrete"
        " delle migliori prestazioni."
        @askoptions-help
))

(set #witch-help
(cat "\nScegliete in che lingua volete sia"
        " installato l'help in linea.\n\n"
))
(set #witch-help-help
(cat "\nEasyFR dispone dell'help in linea. Questo"
        " vuol dire che in qualunque momento premendo"
        " semplicemente il tasto help, verrà"
        " visualizzata la pagina relativa al punto"
        " in cui siete.\n"
        @askoptions-help
))

(set #install-msg
(cat "\n\nScript per l'installazione di EasyFR.\n"
     "Questo script installa EasyFR nel tuo Amiga.\n\n"
     "Leggi la documentazione per avere maggiori informazioni\n"
     "sulla distribuzione di EasyFR.\n\n"
     "EasyFR © 1994 Angelo Vizzarro\n"
     "EasyFR 2.2 © 1995-96 Francesco Dipietromaria\n"
     "Tutti i diritti riservati."
))

)
)

;=============================================================================
; make sure we are running under a 2.04 ROM

(if (< (/ (getversion) 65536) 37)
(
    (abort #bad-kick)
))

;=============================================================================

(message #install-msg)

(welcome)

(set EasyFRdestdir (getassign "EasyFR"))

(if EasyFRdestdir
(set dummy 1)
(
        (set EasyFRdestdir
                (tackon
                        (askdir
                                (prompt #where-efr)
                                (help @askdir-help)
                                (default @default-dest)
                        )
                        "EasyFR"
                )
        )
        (makedir EasyFRdestdir (infos))
        (makeassign "EasyFR" EasyFRdestdir (safe))
        (startup "EasyFR"
                (prompt #add-mail-startup)
                (help @startup-help)
                (command
                        "Assign EasyFR: \"" EasyFRdestdir "\"\n"
                        "path EasyFR:C add\n"
                )
        )
))

(set @default-dest EasyFRdestdir)

(makedir (tackon EasyFRdestdir "C"))
(makedir (tackon EasyFRdestdir "Catalogs"))
(makedir (tackon EasyFRdestdir "Extras") (infos))

(set processor  (askchoice  (prompt #witch-processor)
                            (help #witch-processor-help)
                            (choices "68000" "68020+")
                            (default 0)
                )
)

(set help_path
        (tackon efrdir
                (select  (askchoice (prompt #witch-help)
                                (help #witch-help-help)
                                (choices "English" "Italiano")
                                (default (- default_lang 1))
                        )
                        "Docs/English"
                        "Docs/Italiano"
                        ""
                )
        )
)

(if processor
((copyfiles
        (source (tackon efrdir "EasyFR.020"))
        (dest EasyFRdestdir)
        (infos)
)
(rename (tackon EasyFRdestdir "EasyFR.020")
        (tackon EasyFRdestdir "EasyFR")
)
(rename (tackon EasyFRdestdir "EasyFR.020.info")
        (tackon EasyFRdestdir "EasyFR.info")
))
(copyfiles
        (source (tackon efrdir "EasyFR"))
        (dest EasyFRdestdir)
        (infos)
))

(copyfiles
        (source (tackon efrdir "EasyFR.sleep.info"))
        (dest EasyFRdestdir)
)

(copyfiles
        (source (tackon efrdir "C/mouse2"))
        (dest (tackon EasyFRdestdir "C"))
)

(copyfiles
        (source (tackon efrdir "Extras/setfilelist"))
        (dest (tackon EasyFRdestdir "Extras"))
        (infos)
)

(copyfiles
        (source (tackon efrdir "Extras/xInfo"))
        (dest (tackon EasyFRdestdir "Extras"))
        (infos)
)


(copyfiles
        (source help_path (all))
        (dest EasyFRdestdir)
        (infos)
)
(if (< (/ (getversion) 65536) 39)
(
        (tooltype
                (dest (tackon EasyFRdestdir "EasyFR.guide"))
                (setdefaulttool "SYS:Utilities/AmigaGuide")
        )
))

(copyfiles
        (source (tackon efrdir "ReadMe.mui"))
        (dest EasyFRdestdir)
        (infos)
)
(if (> (/ (getversion) 65536) 38)
(
        (tooltype
                (dest (tackon EasyFRdestdir "ReadMe.mui"))
                (setdefaulttool "SYS:Utilities/MultiView")
        )
))

(if (exists "SYS:Locale")
(
        (if (exists "LOCALE:")
        (
                (user 2)
                (set lang (askoptions (prompt #which-language)
                                                                         (help #which-language-help)
                                                                         (choices
                                                                                 "English"
                                                                                 "Italiano"
                                                                                 "Français"
                                                                                 "Nederlands")
                                                               (default default_lang)
                                         )
                )
                (user old_level)

                (set n 0)
                (while (set language (select n
                                                                                "english"
                                                                                "italiano"
                                                                                "français"
                                                                                "nederlands"
                                                                                ""))
                (
                        (if (IN lang n)
                        (
                                (if (<> 0 n)
                                (
                                        (makedir (tackon EasyFRdestdir (cat "Catalogs/" language)))
                                        (copyfiles (source (tackon (tackon catalogdir language) "EasyFR.catalog"))
                                                                  (dest (tackon EasyFRdestdir (cat "Catalogs/" language)))
                                        )
                                        (copyfiles (source (tackon (tackon catalogdir language) "EasyFR_Bubble.catalog"))
                                                                  (dest (tackon EasyFRdestdir (cat "Catalogs/" language)))
                                        )

                                ))
                        ))
                        (set n (+ n 1))
                ))
        ))
))
