Update ooo320-m1
[ooovba.git] / setup_native / scripts / register_extensions
blobc7fa2815b441133f2c48b3746d107395f4917063
1 #!/bin/bash
3 USAGE="Usage: $0"
5 SCRIPTNAME=`basename "$0"`
6 PROGRAMDIR=`dirname "$0"`
7 OFFICEDIR="$PROGRAMDIR/.."
8 EXTENSIONDIR=$OFFICEDIR/share/extension/install
9 REGISTERFILE=$PROGRAMDIR/register.dat
10 UNOPKG=$PROGRAMDIR/unopkg
12 help()
14 echo
15 echo "Installation script for office extensions located in <office>/share/extension/install"
16 echo
17 echo "This installation script can be executed after successful installation of packages."
18 echo "Before uninstallation please execute the script \"deregister_extensions\" located next"
19 echo "to this script."
20 echo "Usage: $0"
21 echo "No parameter required."
22 echo
26 # This script is only for root installations
27 # (How about installations done with user privileges?)
30 # if [ $UID -ne 0 ]
31 # then
32 # printf "\nThis script is for installation only wiht administrative rights only\n"
33 # help
34 # exit 2
35 # fi
38 # Checking existence of unopkg in program directory
41 if [ ! -f "$UNOPKG" ]; then
42 echo "Error: File $UNOPKG does not exist"
43 exit 1
46 if [ ! -x "$UNOPKG" ]; then
47 echo "Error: File $UNOPKG is not an executable file"
48 exit 1
52 # Collecting all files located in share/install/extensions
55 FILELIST=`find $EXTENSIONDIR -type f -name "*.oxt" -print`
57 if [ -z "$FILELIST" ]
58 then
59 printf "\n$0: No extensions found in $EXTENSIONDIR\n"
60 exit 2
63 echo
64 echo "Installing:"
65 for i in $FILELIST; do
66 echo `basename $i`
67 done
68 echo
70 for i in $FILELIST; do
71 COMMAND="$UNOPKG add --shared $i"
72 echo $COMMAND
73 $COMMAND
74 done
76 if [ -f $REGISTERFILE ]; then
77 rm $REGISTERFILE
78 fi
80 echo
81 echo "Installation done ..."
82 echo
84 exit 0