#!/bin/sh

# This script checks to see whether language modules are installed without
# the corresponding mmail language subsystem installed.  If so, an
# xconfirm dialog will be displayed.

PATH=/usr/sbin:/usr/bsd:/bin:/etc:/sbin:/usr/bin:/usr/etc:/usr/bin/X11
FLAG=0
MSGFILE=/var/tmp/message.$$

if [ -n "`showprods -s chinese_sys.sw.user_env_china`" ]; then
    if [ -z "`showprods -s mmail.sw.chinese_china`" ]; then
        FLAG=1
    fi
fi

if [ -n "`showprods -s chinese_sys.sw.user_env_taiwan`" ]; then
    if [ -z "`showprods -s mmail.sw.chinese_taiwan`" ]; then
        FLAG=1
    fi
fi

if [ -n "`showprods -s japanese_sys.sw`" ]; then
    if [ -z "`showprods -s mmail.sw.japanese`" ]; then
        FLAG=1
    fi
fi

if [ -n "`showprods -s european.env.french`" ]; then
    if [ -z "`showprods -s mmail.sw.french`" ]; then
        FLAG=1
    fi
fi

if [ -n "`showprods -s european.env.german`" ]; then
    if [ -z "`showprods -s mmail.sw.german`" ]; then
        FLAG=1
    fi
fi

if [ -n "`showprods -s korean_sys.sw`" ]; then
    if [ -z "`showprods -s mmail.sw.korean`" ]; then
        FLAG=1
    fi
fi

if [ $FLAG -eq 1 ]; then
    cat <<\EOF > ${MSGFILE}
WARNING!  Media Mail installation is NOT complete.

This machine has a language module installed (Chinese, French,
German, Japanese, or Korean) and therefore requires the
corresponding MediaMail language files be installed.

1. Click the "Custom Installation" button in the Software Manager
   (if you have quit the Software Manager, double-click on the CDROM
   icon on your desktop to reopen it, or choose Software Manager
   from the System Toolchest menu, and type the path to the
   installation directory in the Available Software field),
2. Click on the arrow next to "Product: MediaMail, 3.2.3" to
   see the sub-systems,
3. Click on the install box next to the appropriate MediaMail
   Language Files to select them for installation, and
4. Click the "Start" button.

Localized versions of MediaMail will NOT run if these files are not
installed.
EOF
    xconfirm -file ${MSGFILE} -header MediaMail -icon warning -b OK -geometry +20+350 -font -*-helvetica-bold-r-*-*-15-120-*-*-*-*-iso8859-1 2>&1 >/dev/null && rm -fr ${MSGFILE} &
fi
