home *** CD-ROM | disk | FTP | other *** search
/ Dream 52 / Amiga_Dream_52.iso / Applix / install.cd / Office < prev    next >
Text File  |  1998-05-09  |  4KB  |  134 lines

  1. #!/bin/bash
  2. # Office 
  3. # CrΘation automatique du menu de lancement d'APPLIXware
  4. #------------------------------------------------------------
  5. #
  6.  
  7.     tmp="/var/lib/applix-setup"
  8.     BACKTITLE="APPLIXware Office 4.3.7 (DEMO - Epire le 31/08/98)"
  9.     NB_LANGUE=0
  10.     rm -f /tmp/Selection
  11.  
  12.     if [ -f $tmp/ROOT_DIR ]; then
  13.         DEST_DIR="`cat $tmp/ROOT_DIR`"
  14.     fi
  15.     
  16.         if [ ! -d $DEST_DIR/applix/bin ]; then
  17.             exit 1
  18.     fi
  19.     
  20.  
  21.     # AXLANG=1 Anglais 
  22.     # AXLANG=2 Allemand
  23.     # AXLANG=3 Franτais
  24.  
  25.     #
  26.     # CrΘation automatique du menu pour lancer APPLIXware
  27.     #------------------------------------------------------
  28.     #
  29.  
  30.     if [ -d $DEST_DIR/applix/bin ]; then
  31.     
  32.       if [ ! -f $DEST_DIR/applix/bin/uninstal ]; then
  33.         cp $CHEMIN/uninstal $DEST_DIR/applix/bin 2> /dev/null
  34.       fi
  35.       
  36.       if [ ! -f $DEST_DIR/applix/bin/dialog ]; then
  37.         cp $CHEMIN/bin/dialog $DEST_DIR/applix/bin 2> /dev/null
  38.       fi
  39.       
  40.       if [ ! -f $DEST_DIR/applix/bin/.dialogrc ]; then
  41.         cp $CHEMIN/bin/.dialogrc $DEST_DIR/applix/bin 2> /dev/null
  42.       fi
  43.       
  44.       if [ ! -f $DEST_DIR/applix/bin/Office ]; then
  45.         cp $CHEMIN/Office $DEST_DIR/applix/bin 2> /dev/null        
  46.       fi
  47.       
  48.     fi
  49.  
  50.         menu_file="$DEST_DIR/applix/bin/menu"
  51.         rm -f $menu_file
  52.         cat << END > $menu_file
  53. #!/bin/bash
  54. #
  55. tmp="/var/lib/applix-setup"
  56. CHEMIN="\`cat \$tmp/ROOT_DIR\`/applix/bin"
  57. DIALOG="\$CHEMIN/dialog"
  58. export DIALOGRC="\$CHEMIN/.dialogrc"
  59.  
  60. \$DIALOG --title "CHOISIR LA LANGUE" --backtitle "$BACKTITLE" --menu \\
  61. "Vous avez installΘ plusieurs langues dans
  62. APPLIXware, vous devez choisir la  langue
  63. α utiliser avec les menus d'APPLIXware." 0 0 0 \\
  64. END
  65.  
  66.         [ -z "$AXLANG" ] && {
  67.                 if [ -f $DEST_DIR/applix/etc/applix.wmconfig-US ] ; then
  68.             AXLANG=1
  69.             NB_LANGUE="`expr $NB_LANGUE + 1`"
  70.             echo "\"1\" \"Menus en Anglais\" \\" >> $menu_file
  71.         fi
  72.         
  73.         if [ -d $DEST_DIR/applix/axdata/eng ] ; then
  74.           if [ "`grep AXLANG $DEST_DIR/applix/applixUS`" != "export AXLANG=1" ] ; then
  75.                         echo "export AXLANG=1" >> $DEST_DIR/applix/applixUS
  76.             echo "exec $DEST_DIR/applix/bin/applixUS" >> $DEST_DIR/applix/applixUS
  77.             chmod 755 $DEST_DIR/applix/applixUS
  78.           fi    
  79.         fi  
  80.  
  81.                 if [ -f $DEST_DIR/applix/etc/applix.wmconfig-GR ] ; then
  82.                         AXLANG=2
  83.             NB_LANGUE="`expr $NB_LANGUE + 1`"
  84.             echo "\"2\" \"Menus en Allemand\" \\" >> $menu_file
  85.         fi
  86.         
  87.         if [ -d $DEST_DIR/applix/axdata/grm ] ; then
  88.           if [ "`grep AXLANG $DEST_DIR/applix/applixGR`" != "export AXLANG=2" ] ; then
  89.                 echo "export AXLANG=2" >> $DEST_DIR/applix/applixGR
  90.                 echo "exec $DEST_DIR/applix/bin/applixGR" >> $DEST_DIR/applix/applixGR
  91.             chmod 755 $DEST_DIR/applix/applixGR
  92.           fi
  93.         fi
  94.  
  95.                 if [ -f $DEST_DIR/applix/etc/applix.wmconfig-FR ] ; then
  96.             AXLANG=3
  97.             NB_LANGUE="`expr $NB_LANGUE + 1`"
  98.             echo "\"3\"  \"Menus en Franτais\" \\" >> $menu_file
  99.         fi
  100.         
  101.         if [ -d $DEST_DIR/applix/axdata/frn ] ; then
  102.           if [ "`grep AXLANG $DEST_DIR/applix/applixFR`" != "export AXLANG=3" ] ; then
  103.                         echo "export AXLANG=3" >> $DEST_DIR/applix/applixFR
  104.                 echo "exec $DEST_DIR/applix/bin/applixFR" >> $DEST_DIR/applix/applixFR
  105.                 chmod 755 $DEST_DIR/applix/applixFR
  106.           fi    
  107.         fi
  108.  
  109.         if [ "$NB_LANGUE" -eq "0" ]; then
  110.             rm -f $menu_file
  111.             exit 1
  112.         else
  113.             echo "2> /tmp/Selection" >> $menu_file
  114.             echo "" >> $menu_file
  115.             echo "if [ \$? = 1 -o \$? = 255 ]; then rm -f /tmp/Selection; exit; fi" >> $menu_file
  116.             echo "" >> $menu_file
  117.             echo "Selection=\"\`cat /tmp/Selection\`\"" >> $menu_file
  118.             echo "rm -f /tmp/Selection" >> $menu_file
  119.             echo "" >> $menu_file
  120.             echo "export AXLANG=\$Selection" >> $menu_file
  121.             echo "exec $DEST_DIR/applix/applix" >> $menu_file
  122.             echo "" >> $menu_file
  123.         fi
  124. }
  125.  
  126.             if [ "$NB_LANGUE" -gt "1" ]; then
  127.             chmod 755 $menu_file
  128.         else
  129.             rm -f $menu_file
  130.             ln -s $DEST_DIR/applix/applix $DEST_DIR/applix/bin/menu
  131.             chmod 755 $DEST_DIR/applix/bin/menu
  132.         fi
  133.  
  134.