;
; Script di installazione per EasyPrint 2.25 (18.09.96)
;

; Stringhe

(set @default-dest  "")
(set @default-message "")
(set lib-def-dest   "LIBS:")
(set eprint-dest    "SYS:")

; E' un Amiga 3.0?
(if (= @language "italiano")
(
        (if (< (/ (getversion) 65536) 39) (abort "Devi avere il Kickstart 3.0 (o superiore) per usare\nEasyPrint."))

        (message
                (cat      "\n\n\nEasyPrint, script di installazione.\n"
                          "Questa procedura installa EasyPrint sul vostro Amiga.\n\n"
                          "(C) Copyright 1995-1996 Andrea Latina."
                ))

        ; Ask where to copy the library.

        (set lib-dest
                (askdir
                        (prompt  "Dove desideri vengano copiate le librerie (saranno copiate solo se pił recenti di quelle gią installate)?")
                        (help    "    Se usi una directory per le librerie create da terzi, adesso puoi specificarla.")
                        (default lib-def-dest)
                )
        )

        ; Copy the library.

        (copylib
                (prompt (cat "Copio la reqtools.library in " (tackon lib-dest "reqtools.library")))
                (help   @copylib-help)
                (source "libs/reqtools.library")
                (dest   lib-dest)
                (confirm)
        )

        (copylib
                (prompt (cat "Copio la iff.library in " (tackon lib-dest "iff.library")))
                (help   @copylib-help)
                (source "libs/iff.library")
                (dest   lib-dest)
                (confirm)
        )

        (set eprint-dest
                (askdir
                        (prompt  "Dove desideri installare EasyPrint (sarą creato un nuovo cassetto chiamato 'EasyPrint')?")
                        (help    "    Seleziona il cassetto in cui installare EastPrint.")
                        (default eprint-dest)
                )
        )

        (if (NOT (exists (tackon eprint-dest "EasyPrint")))
            (makedir (tackon eprint-dest "EasyPrint")))

        (copyfiles
            (prompt "Copio 'EasyPrint' in " eprint-dest "EasyPrint/...")
            (source "EasyPrint/")
            (dest   (tackon eprint-dest "EasyPrint"))
            (all)
        )

        (copyfiles
            (prompt "Copio 'EasyPrint' in " eprint-dest "EasyPrint/...")
            (source "EasyPrint.guide")
            (dest   (tackon eprint-dest "EasyPrint"))
        )

        (copyfiles
            (prompt "Copio 'EasyPrint' in " eprint-dest "EasyPrint/...")
            (source "EasyPrint_ITA.guide")
            (dest   (tackon eprint-dest "EasyPrint"))
        )

        (if (exists ("env:sys/def_drawer.info"))
            (copyfiles
                (prompt "Copio 'EasyPrint' in " eprint-dest "EasyPrint/...")
                (source "env:sys/def_drawer.info")
                (dest   eprint-dest)
                (newname "EasyPrint.info")
                (noposition)
                (nogauge)
            )
        )
        (delete "ENV:EasyPrint.prefs")
        (delete "ENVARC:EasyPrint.prefs")
        (delete (tackon eprint-dest "EasyPrint/EasyPrint.def"))
)
(
        (if (< (/ (getversion) 65536) 39) (abort "EasyPrint need at least OS 3.0"))

        (message
                (cat      "\n\n\nEasyPrint, installation script.\n\n"
                          "This script installs EasyPrint on your Amiga.\n\n"
                          "(C) Copyright 1995-1996 by Andrea Latina\nAll rights reserved."
                )
        )

        ; Ask where to copy the library.

        (set lib-dest
                (askdir
                        (prompt  "Select directory where to install the libraries (copies the libraries using version checking).")
                        (help    "    Copies the libraries using version checking; i.e., it only overwrites an existing library if the new library has a higher version/revision number.")
                        (default lib-def-dest)
                )
        )

        ; Copy the library.

        (copylib
                (prompt (cat "Copying reqtools.library to " lib-dest))
                (help   @copylib-help)
                (source "libs/reqtools.library")
                (dest   lib-dest)
                (confirm)
        )

        (copylib
                (prompt (cat "Copying iff.library to " lib-dest ))
                (help   @copylib-help)
                (source "libs/iff.library")
                (dest   lib-dest)
                (confirm)
        )

        (set eprint-dest
                (askdir
                        (prompt  "Select directory where to install EasyPrint (a directory called `EasyPrint` will be created here).")
                        (help    "    If you specify a path, a new directory called `EasyPrint` will be created in it. The program will be copied in this directory.")
                        (default eprint-dest)                                                                                
                )
        )

        (if (NOT (exists (tackon eprint-dest "EasyPrint")))
            (makedir (tackon eprint-dest "EasyPrint")))

        (copyfiles
            (prompt "Copying 'EasyPrint' to " eprint-dest "EasyPrint/...")
            (source "EasyPrint/")
            (dest   (tackon eprint-dest "EasyPrint"))
            (all)
        )

        (copyfiles
            (prompt "Copying 'EasyPrint' to " eprint-dest "EasyPrint/...")
            (source "EasyPrint.guide")
            (dest   (tackon eprint-dest "EasyPrint"))
        )

        (copyfiles
            (prompt "Copying 'EasyPrint' to " eprint-dest "EasyPrint/...")
            (source "EasyPrint_ITA.guide")
            (dest   (tackon eprint-dest "EasyPrint"))
        )

        (if (exists ("env:sys/def_drawer.info"))
            (copyfiles
                (prompt "Copying 'EasyPrint' to " eprint-dest "EasyPrint/...")
                (source "env:sys/def_drawer.info")
                (dest   eprint-dest)
                (newname "EasyPrint.info")
                (noposition)
                (nogauge)
            )
        )
        (delete "ENV:EasyPrint.prefs")
        (delete "ENVARC:EasyPrint.prefs")
        (delete (tackon eprint-dest "EasyPrint/EasyPrint.def"))
)
) ; if
