; Installation script for AlphaSpell

(transcript "Installing AlphaSpell ...")

(set destpath
    (askdir
        (prompt "Install the Dictionaries where?")
        (help @askdir-help)
        (default "Work:")
    )
)

(copyfiles
    (prompt "Copying AlphaSpell's Dictionaries")
    (help @copyfiles-help)
    (source "Dictionaries/")
    (dest destpath)
    (confirm)
    (all)
)

(set response
    (askchoice
        (prompt
            "Add Environment Variables for use with the XDME Excelsior Suite?"
        )
        (help @askchoice-help)
        (choices "Yes" "No")
    )
)

(if (= response 0)
    (
        (run (cat "setenv DDIR " (tackon destpath " ")))
        (run ("setenv Dict English.low English.mix User.low User.mix"))
        (run (cat "setenv UDict " (tackon destpath "User.low") " " (tackon destpath "User.mix")))
        (run "copy ENV:Dict ENVARC:")
        (run "copy ENV:DDIR ENVARC:")
        (run "copy ENV:UDict ENVARC:")
    )
)

(set response
    (askchoice
        (prompt
            "Which version of AlphaSpell do you want installed?"
        )
        (help @askchoice-help)
        (choices "68000" "68020")
    )
)

(if (= response 0)
    (set src "68000/AlphaSpell")
)

(if (= response 1)
    (set src "68020/AlphaSpell")
)

(set destpath
    (askdir
        (prompt "Install AlphaSpell where?")
        (help @askdir-help)
        (default "C:")
    )
)

(copyfiles
    (prompt "Copying AlphaSpell")
    (help @copyfiles-help)
    (source src)
    (dest destpath)
    (confirm)
)

(set destpath
    (askdir
        (prompt "Install keyconv where?")
        (help @askdir-help)
        (default "C:")
    )
)

(copyfiles
    (prompt "Copying keyconv")
    (help @copyfiles-help)
    (source "keyconv")
    (dest destpath)
    (confirm)
)

(set destpath
    (askdir
        (prompt "Install AlphaSpell.guide where?")
        (help @askdir-help)
        (default "Data:Docs/")
    )
)

(copyfiles
    (prompt "Copying AlphaSpell's Documentation")
    (help @copyfiles-help)
    (source "Doc/")
    (dest destpath)
    (confirm)
    (all)
)

(exit)
