; DirSize 1.7 Installer script.
; $VER: Install_DirSize 1.7 (5.2.97)
;
; Copyright (c) 1995-1997 Steve Robb
;

(set vernum (getversion "DirSize"))
(set ver (/ vernum 65536))
(set rev (- vernum (* ver 65536)))

(set #welcome
    (cat ("Welcome to the installation script for DirSize %ld.%ld\n\n" ver rev)
        "DirSize is a Shell-only command.\n A Workbench version will appear at a later date.\n\n"
        "Copyright (c) 1995-1997 Steve Robb"
    )
)
(set #destdir-prompt "Please select the directory where you want the DirSize executable installed.\nNo directory will be created.")
(set #destdir-help
    (cat
        "Select the location of where you want the executable DirSize to be copied."
        "The 'C:' directory, where most Shell commands are placed, is a recommendable location.\n\n"
        @askdir-help
    )
)
(set #docs-prompt "Would you like to install the documentation?")
(set #docs-help "Documentation is provided in AmigaGuide format only.")
(set #docs_dir-prompt "Please select the directory where you want the AmigaGuide documentation installed.")
(set #docs_dir-help
    (cat
        "Select the location of where you want the AmigaGuide documentation for DirSize to be installed.\n\n"
        @askdir-help
    )
)

(set #installing "Installing ")
(set #nohelp "No help available")

(set #default-dest "C:")


(complete 0)

(message #welcome)

(complete 25)

;
;   Install executable
;
(set defdir
    (askdir
        (prompt #destdir-prompt)
        (help #destdir-help)
        (default #default-dest)
    )
)
(set @default-dest defdir)

(complete 50)
(copylib
    (source "DirSize")
    (dest @default-dest)
    (prompt (cat #installing "DirSize executable"))
    (help #nohelp)
    (confirm)
    (optional force askuser)
)

(complete 75)

;
;   Install documentation
;
(if ( = (askbool (prompt #docs-prompt) (help #docs-help) (default 0) ) 1 )
    (
        (complete 81)

        (set #docsdir
            (askdir
                (prompt #docs_dir-prompt)
                (help #docs_dir-help)
                (default "")
                (disk)
            )
        )
        (complete 94)
        (copylib
            (source "DirSize.guide")
            (dest #docsdir)
            (prompt (cat #installing "DirSize.guide"))
            (help #nohelp)
            (confirm)
            (infos)
            (noposition)
            (optional force askuser)
        )
    )
)

(complete 100)

