This commit was manufactured by cvs2svn to create branch 'mono-1-0'.
[mono.git] / mcs / class / System.Windows.Forms / System.Windows.Forms / gc-wine / wineapploader
1 #!/bin/sh
2 #
3 # Wrapper script to start a Winelib application once it is installed
4 #
5 # Copyright (C) 2002 Alexandre Julliard
6
7 # determine the app Winelib library name
8 appname=`basename "$0" .exe`.exe
9
10 #allow Wine to load Winelib application from the current directory
11 export WINEDLLPATH=$WINEDLLPATH:.
12
13 # first try explicit WINELOADER
14 if [ -x "$WINELOADER" ]; then exec "$WINELOADER" "$appname" "$@"; fi
15
16 # then default bin directory
17 if [ -x "/usr/local/bin/wine" ]; then exec "/usr/local/bin/wine" "$appname" "$@"; fi
18
19 # now try the directory containing $0
20 appdir=""
21 case "$0" in
22   */*)
23     # $0 contains a path, use it
24     appdir=`dirname "$0"`
25     ;;
26   *)
27     # no directory in $0, search in PATH
28     saved_ifs=$IFS
29     IFS=:
30     for d in $PATH
31     do
32       IFS=$saved_ifs
33       if [ -x "$d/$0" ]; then appdir="$d"; break; fi
34     done
35     ;;
36 esac
37 if [ -x "$appdir/wine" ]; then exec "$appdir/wine" "$appname" "$@"; fi
38
39 # finally look in PATH
40 exec wine "$appname" "$@"