(transcript "Installation of Multitool II")

(set progdest
    (askdir
        (prompt "Please select a drawer for MTool.")
        (help "MTool and MIndicator will be copied to the selected drawer.")
        (default "SYS:Tools")
        (newpath)
    )
)

(set @default-dest progdest)

(copyfiles
    (prompt "Copying MTool...")
    (source "MTool")
    (infos)
    (dest progdest)
)

(complete 20)

(copyfiles
    (prompt "Copying MI...")
    (source "MI")
    (infos)
    (dest progdest)
)

(complete 40)

(if (askbool (help "MIndicator will be able to display files compressed using XPK or Powerpacker, if these libraries are installed.") (prompt "Do you want to install the packer-libraries for MI (XPK and Powerpacker)?"))
(
    (copylib
        (prompt "Installing Powerpacker.library...")
        (source "Libs/powerpacker.library")
        (dest "Libs:")
    )
    (copylib
        (prompt "Installing XPKMaster.library...")
        (source "Libs/XPKMaster.library")
        (dest "Libs:")
    )
    (makedir "Libs:Compressors")
    (copyfiles
        (prompt "Installing XPK-packers...")
        (source "Libs/Compressors")
        (dest "Libs:Compressors")
        (pattern "#?")
    )
)
)

(complete 60)

(set vernum (getversion "exec.library" (resident)))
(set ver (/ vernum 65536))

(if (> ver 37)
    (if (exists "Locale:Catalogs/espaņol")
    (
        (if (askbool (help "If you use Spanish as default language in your prefs and if you install the Spanish catalog, the programs will show up a Spanish user interface.") (prompt "Do you want to install the Spanish catalog file?"))
        (
            (copyfiles
                (prompt "Installing Spanish catalog for MTool")
                (source "Catalogs/espaņol/MTool.catalog")
                (dest "Locale:Catalogs/espaņol")
            )
            (copyfiles
                (prompt "Installing Spanish catalog for MI")
                (source "Catalogs/espaņol/MI.catalog")
                (dest "Locale:Catalogs/espaņol")
            )
        )        
        )
    )
    )
)

(complete 70)

(if (> ver 37)
    (if (exists "Locale:Catalogs/deutsch")
    (
        (if (askbool (help "If you use German as default language in your prefs and if you install the German catalog, the programs will show up a German user interface.") (prompt "Do you want to install the German catalog file?"))
        (
            (copyfiles
                (prompt "Installing German catalog for MTool")
                (source "Catalogs/deutsch/MTool.catalog")
                (dest "Locale:Catalogs/deutsch")
            )
            (copyfiles
                (prompt "Installing german catalog for MI")
                (source "Catalogs/deutsch/MI.catalog")
                (dest "Locale:Catalogs/deutsch")
            )
        )        
        )
    )
    )
)

(complete 80)

(if (askbool (help "This will copy MTool_E.guide") (prompt "Do you want to install the docs?"))
(
    (set docdest
        (askdir
             (prompt "Please select a place for the docs.")
             (help "It doesn't matter where you put in the docs. Preferably where you can find them...")
             (default "Work:")
             (newpath)
        )
    )
    (copyfiles
        (prompt "Copying docs for MTool...")
        (source "MTool_E.guide")
        (infos)
        (dest docdest)
    )
)
)

(complete 90)

(if (askbool (help "The DatMon font is useful in HEX-mode of MI, FineLine 11 is used for the about requester of MTool.") (prompt "Do you want to install the fonts?"))
(
    (set fontdest
        (askdir
            (prompt "Please select a place for the fonts.")
            (help "If you haven't added another directory to your Fonts:-drawer, you should leave this setting on Fonts:")
            (default "Fonts:")
            (newpath)
        )
    )
    (copyfiles
        (prompt "Copying fonts...")
        (source "Fonts")
        (dest fontdest)
        (pattern "#?")
    )
)
)

(complete 99)

(exit)
