push 4198651bda69323c5c7f7710f437846e02cfc104
[wine/hacks.git] / programs / wineapploader.in
blob03ede5edf63fa90d19bd7c89b5274fcb324c7c58
1 #!/bin/sh
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 # then default bin directory
29 if [ -x "@bindir@/wine" ]; then exec "@bindir@/wine" "$appname" "$@"; fi
31 # now try the directory containing $0
32 appdir=""
33 case "$0" in
34 */*)
35 # $0 contains a path, use it
36 appdir=`dirname "$0"`
39 # no directory in $0, search in PATH
40 saved_ifs=$IFS
41 IFS=:
42 for d in $PATH
44 IFS=$saved_ifs
45 if [ -x "$d/$0" ]; then appdir="$d"; break; fi
46 done
48 esac
49 if [ -x "$appdir/wine" ]; then exec "$appdir/wine" "$appname" "$@"; fi
51 # finally look in PATH
52 exec wine "$appname" "$@"