urlmon: Use wide-char string literals.
[wine.git] / tools / wineapploader.in
blobf48d5527a7733394560384da4c433e0c596216bf
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 # now try the directory containing $0
29 appdir=""
30 case "$0" in
31 */*)
32 # $0 contains a path, use it
33 appdir=`dirname "$0"`
36 # no directory in $0, search in PATH
37 saved_ifs=$IFS
38 IFS=:
39 for d in $PATH
41 IFS=$saved_ifs
42 if [ -x "$d/$0" ]; then appdir="$d"; break; fi
43 done
45 esac
46 if [ -x "$appdir/wine" ]; then exec "$appdir/wine" "$appname" "$@"; fi
47 if [ -x "$appdir/wine64" ]; then exec "$appdir/wine64" "$appname" "$@"; fi
49 # now look in PATH
50 saved_ifs=$IFS
51 IFS=:
52 for d in $PATH
54 IFS=$saved_ifs
55 if [ -x "$d/wine" ]; then exec "$d/wine" "$appname" "$@"; fi
56 if [ -x "$d/wine64" ]; then exec "$d/wine64" "$appname" "$@"; fi
57 done
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"
64 exit 1