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