3 # Wrapper script to start a Winelib application once it is installed
5 # Copyright (C) 2002 Alexandre Julliard
7 # This library is free software; you can redistribute it and/or
8 # modify it under the terms of the GNU Lesser General Public
9 # License as published by the Free Software Foundation; either
10 # version 2.1 of the License, or (at your option) any later version.
12 # This library is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 # Lesser General Public License for more details.
17 # You should have received a copy of the GNU Lesser General Public
18 # License along with this library; if not, write to the Free Software
19 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
22 # determine the app Winelib library name
23 appname
=`basename "$0" .exe`.exe
25 # first try explicit WINELOADER
26 if [ -x "$WINELOADER" ]; then exec "$WINELOADER" "$appname" "$@"; fi
28 # now try the directory containing $0
32 # $0 contains a path, use it
36 # no directory in $0, search in PATH
42 if [ -x "$d/$0" ]; then appdir
="$d"; break; fi
46 if [ -x "$appdir/wine" ]; then exec "$appdir/wine" "$appname" "$@"; fi
47 if [ -x "$appdir/wine64" ]; then exec "$appdir/wine64" "$appname" "$@"; fi
55 if [ -x "$d/wine" ]; then exec "$d/wine" "$appname" "$@"; fi
56 if [ -x "$d/wine64" ]; then exec "$d/wine64" "$appname" "$@"; fi
59 # finally, the default bin directory
60 if [ -x "@bindir@/wine" ]; then exec "@bindir@/wine" "$appname" "$@"; fi
61 if [ -x "@bindir@/wine64" ]; then exec "@bindir@/wine64" "$appname" "$@"; fi
63 echo "$0: the Wine loader is missing"