2135ec
--- openoffice.org.orig/desktop/scripts/unopkg.sh	2008-01-14 15:55:26.000000000 +0000
2135ec
+++ openoffice.org/desktop/scripts/unopkg.sh	2008-02-14 10:52:10.000000000 +0000
2135ec
@@ -62,6 +62,33 @@
2135ec
     ;;
2135ec
 esac
2135ec
 
2135ec
+isnotuser=0
2135ec
+for arg in $@
2135ec
+do
2135ec
+if [ "$arg" = "--shared" -o "$arg" = "--bundled" ]; then 
2135ec
+    isnotuser=1
2135ec
+fi
2135ec
+done
2135ec
+if [ $isnotuser -eq 1 ]; then
2135ec
+    echo $@ | grep -q env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY
2135ec
+    if [ $? -ne 0 ]; then
2135ec
+        set -- $@ '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1'
2135ec
+    fi
2135ec
+    echo $@ | grep -q env:UNO_JAVA_JFW_INSTALL_DATA
2135ec
+    if [ $? -ne 0 -a -w $sd_prog/../share/config/javasettingsunopkginstall.xml ]; then
2135ec
+        set -- $@ '-env:UNO_JAVA_JFW_INSTALL_DATA=$$ORIGIN/../share/config/javasettingsunopkginstall.xml'
2135ec
+    fi
2135ec
+    echo $@ | grep -q env:UserInstallation
2135ec
+    if [ $? -ne 0 ]; then
2135ec
+        INSTDIR=`/bin/mktemp -d --tmpdir unoinstall.XXXXXX`
2135ec
+        if [ $? -ne 0 ]; then
2135ec
+            echo "Could not create tmp dir" >&2
2135ec
+            exit 1
2135ec
+        fi
2135ec
+        set -- $@ '-env:UserInstallation=file://'$INSTDIR
2135ec
+    fi
2135ec
+fi
2135ec
+
2135ec
 #collect all bootstrap variables specified on the command line
2135ec
 #so that they can be passed as arguments to javaldx later on
2135ec
 for arg in $@
2135ec
@@ -110,6 +137,8 @@
2135ec
 # SAL_NO_XINITTHREADS=true; export SAL_NO_XINITTHREADS
2135ec
 
2135ec
 # execute binary
2135ec
-exec "$sd_prog/unopkg.bin" "$@" \
2135ec
+"$sd_prog/unopkg.bin" "$@" \
2135ec
     "-env:INIFILENAME=vnd.sun.star.pathname:$sd_prog/redirectrc"
2135ec
-
2135ec
+if [ -n "$INSTDIR" ]; then
2135ec
+   rm -rf $INSTDIR
2135ec
+fi