home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Dream 52
/
Amiga_Dream_52.iso
/
Applix
/
install.cd
/
Office
< prev
next >
Wrap
Text File
|
1998-05-09
|
4KB
|
134 lines
#!/bin/bash
# Office
# CrΘation automatique du menu de lancement d'APPLIXware
#------------------------------------------------------------
#
tmp="/var/lib/applix-setup"
BACKTITLE="APPLIXware Office 4.3.7 (DEMO - Epire le 31/08/98)"
NB_LANGUE=0
rm -f /tmp/Selection
if [ -f $tmp/ROOT_DIR ]; then
DEST_DIR="`cat $tmp/ROOT_DIR`"
fi
if [ ! -d $DEST_DIR/applix/bin ]; then
exit 1
fi
# AXLANG=1 Anglais
# AXLANG=2 Allemand
# AXLANG=3 Franτais
#
# CrΘation automatique du menu pour lancer APPLIXware
#------------------------------------------------------
#
if [ -d $DEST_DIR/applix/bin ]; then
if [ ! -f $DEST_DIR/applix/bin/uninstal ]; then
cp $CHEMIN/uninstal $DEST_DIR/applix/bin 2> /dev/null
fi
if [ ! -f $DEST_DIR/applix/bin/dialog ]; then
cp $CHEMIN/bin/dialog $DEST_DIR/applix/bin 2> /dev/null
fi
if [ ! -f $DEST_DIR/applix/bin/.dialogrc ]; then
cp $CHEMIN/bin/.dialogrc $DEST_DIR/applix/bin 2> /dev/null
fi
if [ ! -f $DEST_DIR/applix/bin/Office ]; then
cp $CHEMIN/Office $DEST_DIR/applix/bin 2> /dev/null
fi
fi
menu_file="$DEST_DIR/applix/bin/menu"
rm -f $menu_file
cat << END > $menu_file
#!/bin/bash
#
tmp="/var/lib/applix-setup"
CHEMIN="\`cat \$tmp/ROOT_DIR\`/applix/bin"
DIALOG="\$CHEMIN/dialog"
export DIALOGRC="\$CHEMIN/.dialogrc"
\$DIALOG --title "CHOISIR LA LANGUE" --backtitle "$BACKTITLE" --menu \\
"Vous avez installΘ plusieurs langues dans
APPLIXware, vous devez choisir la langue
α utiliser avec les menus d'APPLIXware." 0 0 0 \\
END
[ -z "$AXLANG" ] && {
if [ -f $DEST_DIR/applix/etc/applix.wmconfig-US ] ; then
AXLANG=1
NB_LANGUE="`expr $NB_LANGUE + 1`"
echo "\"1\" \"Menus en Anglais\" \\" >> $menu_file
fi
if [ -d $DEST_DIR/applix/axdata/eng ] ; then
if [ "`grep AXLANG $DEST_DIR/applix/applixUS`" != "export AXLANG=1" ] ; then
echo "export AXLANG=1" >> $DEST_DIR/applix/applixUS
echo "exec $DEST_DIR/applix/bin/applixUS" >> $DEST_DIR/applix/applixUS
chmod 755 $DEST_DIR/applix/applixUS
fi
fi
if [ -f $DEST_DIR/applix/etc/applix.wmconfig-GR ] ; then
AXLANG=2
NB_LANGUE="`expr $NB_LANGUE + 1`"
echo "\"2\" \"Menus en Allemand\" \\" >> $menu_file
fi
if [ -d $DEST_DIR/applix/axdata/grm ] ; then
if [ "`grep AXLANG $DEST_DIR/applix/applixGR`" != "export AXLANG=2" ] ; then
echo "export AXLANG=2" >> $DEST_DIR/applix/applixGR
echo "exec $DEST_DIR/applix/bin/applixGR" >> $DEST_DIR/applix/applixGR
chmod 755 $DEST_DIR/applix/applixGR
fi
fi
if [ -f $DEST_DIR/applix/etc/applix.wmconfig-FR ] ; then
AXLANG=3
NB_LANGUE="`expr $NB_LANGUE + 1`"
echo "\"3\" \"Menus en Franτais\" \\" >> $menu_file
fi
if [ -d $DEST_DIR/applix/axdata/frn ] ; then
if [ "`grep AXLANG $DEST_DIR/applix/applixFR`" != "export AXLANG=3" ] ; then
echo "export AXLANG=3" >> $DEST_DIR/applix/applixFR
echo "exec $DEST_DIR/applix/bin/applixFR" >> $DEST_DIR/applix/applixFR
chmod 755 $DEST_DIR/applix/applixFR
fi
fi
if [ "$NB_LANGUE" -eq "0" ]; then
rm -f $menu_file
exit 1
else
echo "2> /tmp/Selection" >> $menu_file
echo "" >> $menu_file
echo "if [ \$? = 1 -o \$? = 255 ]; then rm -f /tmp/Selection; exit; fi" >> $menu_file
echo "" >> $menu_file
echo "Selection=\"\`cat /tmp/Selection\`\"" >> $menu_file
echo "rm -f /tmp/Selection" >> $menu_file
echo "" >> $menu_file
echo "export AXLANG=\$Selection" >> $menu_file
echo "exec $DEST_DIR/applix/applix" >> $menu_file
echo "" >> $menu_file
fi
}
if [ "$NB_LANGUE" -gt "1" ]; then
chmod 755 $menu_file
else
rm -f $menu_file
ln -s $DEST_DIR/applix/applix $DEST_DIR/applix/bin/menu
chmod 755 $DEST_DIR/applix/bin/menu
fi