; This is installation script (V1.0) for D.A.S.ModulePlayer V3.0 

(set daseplibsource "libs/dasmp")
(set dasextarcsource "ENV/dasmp.extarc")
(set dasauthorsource "ENV/dasmp.author")
(set arexxsource    "rexx")
(set #copying-eplib     "Copying External Player Libraries... ")
(set #copying-exes      "Copying Executables and guide files... ")
(set #copying-arexx     "Copying example arexx scripts...")
(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:? "
        "If you have your own author listing done this will "
        "Overwrite it. This includes atleast the same as previous "
        "example author files."))

(set #copy-magicwb
(cat    "Would you like to have neat 8-color MAGIC WB "
        "icons copied instead of those dull 4 color ones? "))

(set #blaahlastwords
(cat    "Now that you have installed D.A.S.MP: "
        "(1). You MUST check DMAWait value in Config page 2. "
        "Try different values. To a3000 or a4000 this should be "
        "somewhere between 2000 and 3000. "
        "(2). If you want to play other than PT/NT modules "
        "You have to add appropriate EPL files to "
        "External Player List in Config page 5. "
        "Read the manual for more infomation. "))

(set #copy-arexx
(cat    "Do you want to have example arexx script copied?"))

(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 around 200 KB space "
    "available for software installation. "
    @askdir-help
    )
    (default "SYS:")
    )
)

(complete 1)

(copyfiles
    (prompt "\n" #copying-exes)
    (help "")
    (source "dasmodplayer")
    (dest @default-dest)
    (infos)
)
;(copyfiles
;    (prompt "\n" #copying-exes)
;    (help "")
;    (source "converter")
;    (dest @default-dest)
;    (infos)
;)
(copyfiles
    (prompt "\n" #copying-exes)
    (help "")
    (source "DMODPAPPICON.info")
    (dest @default-dest)
)
(complete 25)
(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 (EPL) 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:")
    )
)
(complete 50)
(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:")
    )
    )
)

(complete 75)

(if
    (askbool
        (prompt #copy-arexx)
        (help "")
        (default 1)
    )

    (           ; start of if statement
      (set @default-rexxdest
            (askdir
            (prompt "Please select directory to install example "
            "arexx scripts to. ")
            (help @askdir-help)
            (default "rexx:")
            ))
        (copyfiles
            (prompt "\n" #copying-arexx)
            (help "")
            (source "rexx")
            (dest @default-rexxdest)
            (all)    
    )))

(if
    (askbool
        (prompt #copy-magicwb)
        (help "")
        (default 1)
    )
    (
    (copyfiles
        (source "MagicWB-icons")
        (dest @default-dest)
        (all)
    )
    )
)
(if (exists "HELP:English")
    (
    (copyfiles
        (source "Locale/help/English/dasmphelp.guide")
        (dest "HELP:English")
    )
    (tooltype
    (dest (tackon @default-dest "dasmodplayer"))
    (help @tooltype-help)
    (settooltype "ONLINEHELP" "HELP:English/dasmphelp.guide")
    )
))
(complete 100)
(message #blaahlastwords)
