#!/bin/sh

if test -f $INSTALL_LOCK
then
	X=`cat $INSTALL_LOCK`

	case $X in
	  "")
		cat >&2 <<EOM
Another process is installing Empress. You properly clicked
the 'Begin Installation' more than once.
EOM
		;;
	  *)
		cat >&2 <<EOM
Another process ($X) is installing Empress. You properly clicked
the 'Begin Installation' more than once.
EOM
		;;
	esac
	exit 1 
fi

echo $$ > $INSTALL_LOCK

case $XTERM in
 kterm | */kterm)
	# kterm prints 'Warning: Actions not found: StartScroll'
	# to stderr in some TurboLinux X server.

	KTERM_OUTFILE=/tmp/kterm_output.$$

	$XTERM -geometry 80x40 -sl 500 -sb -title "Empress Installation" \
		-e sh $INSTUTIL_DIR/inst_t.sh \
		> $KTERM_OUTFILE 2>&1

	sed -e '/StartScroll/d' < $KTERM_OUTFILE
	rm -fr $KTERM_OUTFILE
	;;
 *winterm)
	$XTERM -geometry 80x40 -title "Empress Installation" \
		-bg black -fg white \
		-e "sh $INSTUTIL_DIR/inst_t.sh"
	;;
 *konsole)
	KCONSOLE_OUTFILE=/tmp/konsole_output.$$
        $XTERM -T "Empress Installation" \
		-e sh $INSTUTIL_DIR/inst_t.sh > $KCONSOLE_OUTFILE 2>&1
	sed -e '/kbuildsycoca/d' < $KCONSOLE_OUTFILE
	rm -fr $KCONSOLE_OUTFILE
	;;
 *)
	$XTERM -geometry 80x40 -sl 500 -sb -title "Empress Installation" \
		-e sh $INSTUTIL_DIR/inst_t.sh
	;;
esac

rm -fr $INSTALL_LOCK
