; $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 30)

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

        (message (cat "\n"

            "GoldED WarpMOD Modula/Oberon Syntax Parser  \n"
            "                                            \n"
            "1995 Dietmar Eilert                        \n"
            "      DIETMAR@TOMATE.TNG.OCHE.DE            \n"
            "                                            \n"
            "GoldED Release 3.0.1+ required.             \n"
            "                                            \n"
            "This package is NOT 'freely distributable'. \n"
            "Please have a look at the licence file      \n"
            "before using this software. Thank you.      \n"
        ))

        (copyfiles

            (source "parser")
            (dest "GOLDED:syntax")
            (all)
        )

        (copyfiles

            (source "presets")
            (dest "GoldED:presets")
            (all)
        )

        (if (exists "GoldED:syntax/developer/source")

            (if (not (exists "GOLDED:syntax/developer/source/example_warpMOD"))

                (makedir "GOLDED:syntax/developer/source/example_warpMOD")
            )
        )

        (copyfiles

            (source "source")
            (dest   "GOLDED:syntax/developer/source/example_warpMOD")
            (all)
        )


        (run "bin/moveicons DIR=golded:tools GRID DX=0 DY=27 COLUMNS=1")

        (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)

