;$VER:HandBook Install Script 1.0

(complete 0)

(set #prog_default_dest "SYS:WBStartup/")
(set #doc_default_dest "HELP:")

(set #intro_text
    (cat "\n\nWelcome to the HandBook Install Script\n\n"
         "This will install HandBook on to your Amiga.")
)
(set #warn_text
    (cat "\n\nUnable to find Triton.library v5.5 (Triton 1.3) or greater in LIBS:\n"
         "\nMake sure you install Triton before using HandBook.")
)
(set #get_prog_path_text
    (cat "Select the destination directory for the HandBook program. "
         "A directory will NOT be created there.")
)
(set #get_doc_path_text
    (cat "Select the destination directory for the documentation. "
         "A directory will NOT be created there.")
)
(set #get_prog_path_help
    (cat "Here you should choose where to install the HandBook program. "
         "A directory will NOT be created there.\n\n"
         @askdir-help )
)
(set #get_doc_path_help
    (cat "Here you should choose where to install the documentation. "
         "A directory will NOT be created there.\n\n"
         @askdir-help )
)

(message #intro_text)
(set #triton_version (getversion "LIBS:Triton.library"))

(if (< #triton_version 5.5) (message #warn_text))

(set prog_target
    (askdir (prompt #get_prog_path_text)
            (help #get_prog_path_help)
            (default #prog_default_dest)
            (newpath)
    )
)
(set doc_target
    (askdir (prompt #get_doc_path_text)
            (help #get_doc_path_help)
            (default #doc_default_dest)
            (newpath)
    )
)
(set @default-dest prog_target)

(copyfiles
    (prompt "Copying to " #prog_target)
    (help @copy-files-help)
    (source "HandBook")
    (dest prog_target)
    (infos)
)
(complete 50)
(copyfiles
    (prompt "Copying to " #doc_target)
    (help @copy-files-help)
    (source "HandBook.guide")
    (dest doc_target)
    (infos)
)
(complete 100)
