#
# BootManager Installer Script
# Script version 1.1
#

SET "SRC_BOOT" "$PWD$/BOOT"

IF NEQ "$ARG1$" ""
    SET "DST_BOOT" "$ARG1$"
ELSE
    SET "DST_BOOT" "mc0:/BOOT"
ENDIF

SET "SRC_BM" "$SRC_BOOT$/BM"
SET "DST_BM" "$DST_BOOT$/BM"

MKDIR "$DST_BOOT$"
MKDIR "$DST_BOOT$/APPS"
MKDIR "$DST_BM$"
MKDIR "$DST_BM$/MEDIA"

IFFAIL COPY "$SRC_BOOT$/BOOT.ELF" "$DST_BOOT$/BOOT.ELF"
    RETURN "-1"
ELSEIFFAIL COPY "$SRC_BOOT$/REDIR.IRX" "$DST_BOOT$/REDIR.IRX"
    RETURN "-1"
ELSEIFFAIL COPY "$SRC_BOOT$/ICON.SYS" "$DST_BOOT$/ICON.SYS"
    RETURN "-1"
ELSEIFFAIL COPY "$SRC_BOOT$/BMAN.ICN" "$DST_BOOT$/BMAN.ICN"
    RETURN "-1"
ELSEIFFAIL COPY "$SRC_BM$/BMINIT.PBT" "$DST_BM$/BMINIT.PBT"
    RETURN "-1"
ELSEIFFAIL COPY "$SRC_BM$/BOOTMENU.PBT" "$DST_BM$/BOOTMENU.PBT"
    RETURN "-1"
ELSEIFFAIL COPY "$SRC_BM$/PS1LOGO.BIN" "$DST_BM$/PS1LOGO.BIN"
    RETURN "-1"
ENDIF

RETURN "0"
