; $VER: 1.0

(delopts "oknodelete" "force" "askuser")
(complete 0)

(if (exists "GOLDED:" (NOREQ))

    (
        (set vernum (getversion "golded:golded"))

        (set ver (/ vernum 65536))
        (set rev (- vernum (* ver 65536)))

        (set version (+ (* 10 ver) rev))

        (if (< version 21)

            (
                (message "\nSorry, GoldED 2.1.0 or better required")
                (exit (quiet))
            )
        )

        (message (cat "\n"

            "Reversed - Right-To-Left text input         \n"
            "                                            \n"
            "©1995 Dietmar Eilert                        \n"
            "      DIETMAR@TOMATE.TNG.OCHE.DE            \n"
            "                                            \n"
            "GoldED Release 2.1.0+ required.             \n"
            "                                            \n"
            "This utility is NOT 'freely distributable'. \n"
            "Please have a look at the licence file      \n"
            "before using this software. Thank you.      \n"
        ))

        (if (not (exists "GoldED:API/Reversed"))

            (makedir "GoldED:API/Reversed")
        )

        (copyfiles

            (source  (pathonly @icon))
            (dest    "GoldED:API/Reversed")
            (pattern "(reversed|readme|source|presets|licence)")
            (infos)
        )

        (complete 100)

        (message "\nInstallation complete. Have fun :-)")

        (run (cat "gx FORCE MACRO=\"" (tackon (pathonly @icon) "auto.ged\"")))
    )

    (message (cat "\n"

        "Please install GoldED before attempting to\n"
        "install this client.                      \n"
    ))
)

(exit (quiet))

(welcome)
