; This is installation scipt for D.A.S.ModulePlayer V2.1

(set daslibsource "libs/das.library")
(set daseplibsource "libs/dasmp")
(set dasextarcsource "ENV/dasmp.extarc")
(set dasauthorsource "ENV/dasmp.author")
(set #copying-daslib    "Copying das.library to LIBS:.... ")
(set #copying-eplib     "Copying External Player Libraries... ")
(set #copying-exes      "Copying Executables and guide files... ")
(set #exists-extarc
(cat    "dasmp.extarc was already found from your ENV: drawer "
        "Would you like to overwrite it? This may destroy "
        "previous settings you may have done for external archivers. "))
        
(set #copy-extarc       
(cat    "Would you like to have an example external archiver "
        "listfile copied to your ENV: and ENVARC:? This listing "
        "is required if you want to use external archivers (such as LHA) "
        "This example file includes examples for LHA and ZIP archivers. "))
(set #copy-author
(cat    "Would you like to have an example author listing "
        "file copied to your ENV: and ENVARC:? "))
(set #copy-magicwb
(cat    "Would you like to have neat 8-color MAGIC WB "
        "icons copied instead of those dull 4 color ones? "))

(set @default-dest
    (askdir
        (prompt "Please select directory to install D.A.S.MP into. ")
    (help "You must select a directory into which D.A.S.ModulePlayer "
    "will be installed. There should be atleast 200 KB space "
    "available for software installation. "
    @askdir-help
    )
    (default "SYS:")
    )
)

(copyfiles
    (prompt "\n" #copying-exes)
    (help "")
    (source "dasmodplayer")
    (dest @default-dest)
    (infos)
)
(copyfiles
    (prompt "\n" #copying-exes)
    (help "")
    (source "DMODPAPPICON.info")
    (dest @default-dest)
)

(copyfiles
    (prompt "\n" #copying-exes)
    (help "")
    (source "dasmp.guide")
    (dest @default-dest)    
    (infos)
)
(copyfiles
    (prompt "\n" #copying-docs)
    (help "")
    (source "Register.doc")
    (dest @default-dest)
    (infos)
)

(set @default-ldest
    (askdir
        (prompt "Please select directory to install D.A.S.MP "
        "External player libraries into. ")
    (help "You may select any directory you wish. To use these "
        "External player libraries, you will have to add them "
        "one by one from the D.A.S.MP itself. "
    @askdir-help
    )
    (default "LIBS:")
    )
)

(copylib
    (prompt "\n" #copying-daslib)
    (help @copylib-help)
    (source daslibsource)
    (dest "LIBS:")
    (confirm)
)
(copyfiles
    (prompt "\n" #copying-eplib)
    (help @copylib-help)
    (source daseplibsource)
    (dest @default-ldest)
    (all)    
)

(if
    (askbool
        (prompt #copy-extarc)
        (help "")
        (default 1)
    )
    (
        (if (exists "ENV:dasmp.extarc")
            (askbool
                (prompt #exists-extarc)
                (help "")
                (default 1)
            )
            (
                (copyfiles
                (source dasextarcsource)
                (dest "ENVARC:")        
                )
                (copyfiles
                (source dasextarcsource)
                (dest "ENV:")
                )
            )
    )
    )
)
(if
    (askbool
        (prompt #copy-author)
        (help "")
        (default 1)
    )
    (
    (copyfiles
        (source dasauthorsource)
        (dest "ENVARC:")    
    )
    (copyfiles
        (source dasauthorsource)
        (dest "ENV:")
    )
    )
)
(if
    (askbool
        (prompt #copy-magicwb)
        (help "")
        (default 1)
    )
    (
    (copyfiles
        (source "MagicWB-icons")
        (dest @default-dest)
        (all)
    )
    )
)

(if (exists "HELP:")
    (
    (copyfiles
        (source "Locale/help/dasmphelp.guide")
        (dest "HELP:")
    )
))

