WINE="/usr/bin/wine"
WINEDIR="`echo ~/.wine`"
DIALOG="/usr/bin/Xdialog"
BASEDIR="/usr/lib/winetools"

# find out which wine we are using
if [ "`which wine 2>/dev/null`" = "" ]; then
  echo "You don't have Wine installed on your computer. Go to http://www.winehw.org"
  echo "and download an appropiate version for your distribution!"
  exit 1
fi
if [ ! -e ~/.wine ]; then
  echo "no wine directory found... trying to create one"
  wine
  $DIALOG  --title "--- NOTICE ---" --msgbox "Wine has not been used for this user yet.\nStart with WineTools and go to \"Base setup\" first. Go through\nall sub menu entries before you install other software." 8 60

fi
WINEVER="`wine --version 2>&1 |sed -e \"s/Wine //\"`"
[ "$WINEVER" = "" ] && WINEVER="none"
echo "Wine $WINEVER"

# make windows pathnames out of parameters
PARAM="`winepath -l \"$1\"`"

# many applications want to be started from the fake windows drive
if [ -e ~/.wine/c ]; then
  cd ~/.wine/c/
elif [ -e ~/.wine/drive_c ]; then
  cd ~/.wine/drive_c/
else
  echo "no fake drive C: found!"
fi

# say what we have done
echo "wine is executed as \"$WINE\""
echo "Parameters are \"$PARAM\""
