; $VER: ClassAction V2.6 Installer
; Script to install Release 2.6 ClassAction
(complete 0)

(set #Abort
(cat "NO"
))

(set #Overwrite
(cat "YES"
))

(set #conf
(cat "\n\nDo you want to install standard config files\n"
     "on your system , if this is your first installation\n"
     "I recommand you to install them."
))

(set #conf-help
(cat "\n\nThe installer wants to know if it is needed to\n"
     "install standard config files.\n\n"
     "If you have a config file already installed\n"
     "just select the NO button\n"
     "to keep your own config."
))


;********************************************************************

(set #warn-kickstart-text
(cat    "\n   Bad KickStart Version\n\n"
        "ClassAction has been written for KickStart 3.0 (V39) or higher."
        "\n\nIt will NOT work on earlier versions\n"
        "\n\nYou currently are running KickStart V%ld.\n\n"
        "Continue Install ?"
))

;*********************************************************************

(set #DOC-query-text
(cat "Where do you which\nto install documentation"
))

(set #DOC-query-help
(cat "\n\nYou have now to choose a directory where\n"
        "you want to install the guide file\n\n"
        "Just click on it with your mouse and"
        " select proceed"
))

;****************************************

(set #CA-query-text
(cat "Where do you which\nto install ClassAction\nmain program"
))

(set #CA-query-help
(cat "\n\nYou have now to choose a directory where\n"
        "you want to install the main program file\n\n"
        "Just click on it with your mouse and"
        " select proceed"
))

;****************************************

(set #CAP-query-text
(cat "Where do you which\nto install ClassActionPrefs"
))

(set #CAP-query-help
(cat "\n\nYou have now to choose a directory where\n"
        "you want to install the Prefs program file\n\n"
        "Just click on it with your mouse and"
        " select proceed\n"
        "you can select SYS:Prefs if you don't know where to\n"
        " install it..."
))


(set #ver-help
(cat "\n\nIf you Update an older version\n"
        "the icon file of ClassAction\n\n"
        "will not be copied, to avoid erasing\n"
        "your tooltypes setup\n"
))

;********************************************************************

(set #goodbye
(cat "\nClassAction is now installed."
))

;********************************************************************

(set ver (/ (getversion) 65536) )
(if (< ver 39) (
        (set warning (#warn-kickstart-text ver) ) (message warning)
))

                ((message "\nClassAction is now MailWare !! \n\nYou can register for FREE using CA_register"))

                (set thedir (askdir (prompt #CA-query-text) (help #CA-query-help) (default "SYS:WbStartup")))
                (makeassign "CAHOME" thedir)

                (copyfiles (source "CA_Register") (dest thedir) (infos))

(if(exists("CAHOME:ClassAction"))
                (
                (message "\nYou are updating an old version of ClassAction\n\nDon't forget to read the guide\nabout the new tooltypes defined\nAnd REQV[] REQT[] Commands.")
                (copyfiles (source "ClassAction") (dest thedir))
                (run "utt CAHOME:ClassAction ClassAction CAHOME:ClassAction")
                )
                (copyfiles (source "ClassAction") (dest thedir) (infos))
                )

(complete 25)


                (set thedir (askdir (prompt #CAP-query-text) (help #CAP-query-help) (default "SYS:Prefs")))
                (copyfiles (source "ClassActionPrefs") (dest thedir) (infos) )
(complete 50)

                (set thedir (askdir (prompt #DOC-query-text) (help #DOC-query-help) (default "HELP:")))
                (copyfiles (source "English/ClassAction.guide") (dest thedir) (infos) )
(complete 75)

(if(askbool (prompt #conf) (help #conf-help) ) (
                (copyfiles (source "English/ClassAction.prefs") (dest "ENVARC:"))
                (copyfiles (source "English/ClassAction_Gen.prefs") (dest "ENVARC:"))
                ))

(complete 100)

(message #goodbye)
(exit (quiet))

