#!/bin/sh
# $Id: Win4Lin.gdm-session,v 1.1 2004/01/10 17:01:33 lreiter Exp $
# GDM session type to launch full screen Windows from the gdm login

. /etc/mrgssv.sh
. $STATICMERGE/set_nls.sh

# if running as root, launch the administration tool; otherwise attempt to
# start a Windows session for this user
USERID=`"$STATICMERGE"/bin/print_uid`
if [ "$USERID" = "0" ]; then
	exec "$STATICMERGE"/bin/mini-installer skipintro
else
	# If Windows is not install, run the administration tool if the user
	# answers "Yes" to installing it
	MERGE_POSITION=fullscreen; export MERGE_POSITION
	"$STATICMERGE"/adminbin/profile-info >/dev/null 2>&1
	if [ $? = 0 ]; then

		# Windows does not appear to be installed
		DM="LCC.PCI.UNIX.JANUS"
		usrMsg STRING GUI_WIN9X_NOT_INSTALLED \
		"Windows is not installed\nDo you want to install it now?"
		"$STATICMERGE"/g_msg -q "$USRMSG_STRING"
		if [ $? = 0 ]; then
			"$STATICMERGE"/bin/mini-installer skipintro
		else
			exit 0
		fi
	else

		# Windows appears to be installed or !(not installed); try to
		# run it
		exec win --fwin
	fi
fi

