#!/bin/sh

cd `dirname $0`

DISPLAY=:0
export DISPLAY

DUNEOPTIONS=" "
export DUNEOPTIONS

DUNEPATH=`dirname $0`
export DUNEPATH

DUNEDOCS=`echo file://$DUNEPATH/../Resources/WhiteDuneHelp/docs | awk '{gsub("\/[^\/]*\/\.\.\/","/");print $0};'`
export DUNEDOCS

$DUNEPATH/white_dune
rc=$?
if test $rc = 133 ; then
# use the sign # at the beginnig of the next line to disable the errormessage 
    osascript -l AppleScript -e "tell Application \"Finder\" to display dialog \"white_dune xcode program failed, try to start dune directly. Edit $0 to disable this error message\" " &
    $DUNEPATH/dune -startX11aqua $DUNEOPTIONS
fi
