; Installation Routine for XSearch

(message "\n\nWelcome to the AMIGA XSearch Installation. "
         "This Installer installs XSearch on your AMIGA.\n\n"
         "XSearch 1.1\n"
         " and programming 1992 by\n"
         "Stefan Plchinger\n"
         "Kleiststrae 27\n"
         "DW- 8012 Ottobrunn\n\n"
         "All rights reserved."
)

(set x_language
        (askchoice
                (prompt "Select the language XSearch ought to communicate "
                        "with you:")
                (help "XSearch is available in two different languages. "
                      "If you select `Deutsch', the German version will be "
                      "installed, if you select `English', the English one. "
                      "The documents are also installed in this language. "
                )
                (choices "Deutsch" "English")
                (default 1)

        )
)

(set x_source
        (askdir
                (prompt "Please indicate out of what directory XSearch "
                        "ought to be installed (Must be the XSearch "
                        "directory containing `Deutsch' and `English'):")
                (help @askdir-help)
                (default @default-dest)
        )
)

(set x_locate
        (askdir
                (prompt "Please indicate in which directory XSearch "
                        "ought to be installed:")
                (help @askdir-help)
                (default @default-dest)
        )
)

(set x_locate_diskspace (getdiskspace x_locate))

(if x_language
        (
                (set x_Space 205862)
        )
        (
                (set x_Space 217431)
        )
)

(if (< x_locate_diskspace x_Space)
        (
                (abort "You do not have enough space on your drive "
                       "to install XSearch.\n"
                       "XSearch requires "x_Space" bytes of free space "
                       "to install, you only have "x_locate_diskspace"."
                )
        )
)

(set @default-dest x_locate)

(if x_language
        (
                (set x_source (tackon x_source "English"))
                (copyfiles
                        (source (tackon x_source "XSearch"))
                        (dest x_locate)
                        (infos)
                )
                (copyfiles
                        (source (tackon x_source "XSearch.doc"))
                        (dest x_locate)
                        (infos)
                )
                (set x_FinalLetter "c")
        )
        (
                (set x_source (tackon x_source "Deutsch"))
                (copyfiles
                        (source (tackon x_source "XSearch"))
                        (dest x_locate)
                        (infos)
                )
                (copyfiles
                        (source (tackon x_source "XSearch.dok"))
                        (dest x_locate)
                        (infos)
                )
                (set x_FinalLetter "k")
        )
)

(message "All files have been installed now. \n"
         "Finally, a few notes about the XSearch preferences: "
         "XSearch has its own Preferences program, included in "
         "XSearch itself. Remember that its settings (and the settings "
         "of a part of XSearch, the Options Module) aren't "
         "stored now on your partition or in your directory. XSearch "
         "will give you an error message concerning this when having "
         "started XSearch."
         "\nDon't worry about this `trouble'. You can solve it by "
         "following some instructions in XSearch.do"x_FinalLetter". Simply "
         "read the manual!"
         "\nBesides, a double-click on XSearch.do"x_FinalLetter" perhaps "
         "won't work. You might have to change the default tool (see in your "
         "AMIGA DOS manual)."
)
