#!/bin/sh

PROGRAM=simpress
sofficedir=/usr/lib/OpenOffice
VERSION=1.0.1

# execute soffice binary if the user has already run this script once
# there is a bug in solaris sh that prevents the use of "$@"
# because it cannot cope with spaces in directory names
if [ ! "`grep -q "OpenOffice.org $VERSION" $HOME/.sversionrc 2> /dev/null`" ]
then
   /usr/bin/office-setup
fi

# if you upgrade to version 641d, you need to add some additional registry
# files or it is likely to crash
if [ ! -f $HOME/OpenOffice/user/config/registry/instance/org/openoffice/Office/Impress.xml ]
then
	cp /usr/lib/OpenOffice/share/config/registry/instance/org/openoffice/Office/* $HOME/OpenOffice/user/config/registry/instance/org/openoffice/Office/
fi

exec ${sofficedir}/program/$PROGRAM $@
