#!/bin/sh
# dos6 shell script

# When running this script directly from some session/window managers
# (e.g. dxsession, mwm) we may need to set-up the user's environment in order
# for SoftWindows to run correctly (e.g get the value of LM_LICENSE_FILE if
# required). To do this the script must be invoked with -ls as it's first
# argument .... (c.f xterm, dxterm).
test "$1" = "-ls" && {
	test -r $HOME/.profile && . $HOME/.profile
	shift
}

# First look for SoftWindows2 in SWIN2HOME/bin
test $SWIN2HOME && test -x $SWIN2HOME/bin/SoftWindows2 && {
	exec $SWIN2HOME/bin/SoftWindows2
}

# SWIN2HOME not defined or $SWIN2HOME/bin doesn't contain a SoftWindows2
# Look for a SoftWindows2 in the directory that this script was found in.
case $0 in
/*)
	BINDIR=`dirname $0`
	;;
*)
	mypath=`dirname $0`
	BINDIR=`(cd $mypath;pwd)`
	;;
esac

test -x $BINDIR/SoftWindows2 && {
	exec $BINDIR/SoftWindows2
}

# Couldn't find a SoftWindows2, so just try for one on the path somewhere.
exec SoftWindows2
