[ -n "$DISPLAY" ] || fatal "Wine needs be run in X environment with DISPLAY variable"
}
-check_process()
-{
- ps xu | grep -v grep | grep "$1" >/dev/null
-}
-
# trap signals to be able to correct exit from script
trap signal_handler HUP PIPE INT TERM QUIT EXIT
-first_run()
+check_first_run()
{
- local SP=$1
- # FIXME
+ tty -s && return
check_display
- [ -z "$SP" ] && ! check_process wineserver && init_splash gray 15 1
+ # FIXME: add real checking if needed
+ #check_process wineserver && return
+ init_splash gray 10 1
$WINELOADER wineboot.exe --only-first
- [ -z "$SP" ] && stop_splash
+ stop_splash
}
# run program with wine
run_wine()
{
+ export WINEDLLOVERRIDES="$saved_WINEDLLOVERRIDES"
# do not check DISPLAY here, console programs can be started without DISPLAY
if tty -s ; then
- first_run
- export WINEDLLOVERRIDES="$saved_WINEDLLOVERRIDES"
exec $WINELOADER "$@"
else
echo "$0: Running without console, disable input" >&2
if false && [ -z "$WINELOGFILO" ] ; then
- first_run splash </dev/null >$WINEPREFIX/wine.log 2>$WINEPREFIX/wine.log
- export WINEDLLOVERRIDES="$saved_WINEDLLOVERRIDES"
exec $WINELOADER "$@" </dev/null >>$WINEPREFIX/wine.log 2>>$WINEPREFIX/wine.log
else
- first_run splash </dev/null
- export WINEDLLOVERRIDES="$saved_WINEDLLOVERRIDES"
exec $WINELOADER "$@" </dev/null
fi
fi
echo "It is recommended to rename (remove) old $WINEPREFIX and set new WINE environment." >&2
fatal
else
+ # FIXME
# check for version consistency
CURLINE=`head -n2 < ${WINEPREFIX}/.etersoft-release | tail -n1`
NEWLINE=`$WINELOADER --version | head -n1`
exit 0
fi
+check_first_run
+
if [ "$1" = "--workdir" ] ; then
WINEWORKDIRPATH=$($WINELOADER winepath "$2")
shift 2