Alexandre Julliard | 3536316 | 2002-05-22 21:32:49 +0000 | [diff] [blame] | 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 | # 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. |
| 11 | # |
| 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. |
| 16 | # |
| 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 20 | # |
| 21 | |
| 22 | # determine the app Winelib library name |
| 23 | appname=`basename "$0" .exe`.exe |
| 24 | |
| 25 | # first try explicit WINELOADER |
| 26 | if [ -x "$WINELOADER" ]; then exec "$WINELOADER" "$appname" "$@"; fi |
| 27 | |
| 28 | # then default bin directory |
| 29 | if [ -x "@bindir@/wine" ]; then exec "@bindir@/wine" "$appname" "$@"; fi |
| 30 | |
| 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"` |
| 37 | ;; |
| 38 | *) |
| 39 | # no directory in $0, search in PATH |
| 40 | saved_ifs=$IFS |
| 41 | IFS=: |
| 42 | for d in $PATH |
| 43 | do |
| 44 | IFS=$saved_ifs |
| 45 | if [ -x "$d/$0" ]; then appdir="$d"; break; fi |
| 46 | done |
| 47 | ;; |
| 48 | esac |
| 49 | if [ -x "$appdir/wine" ]; then exec "$appdir/wine" "$appname" "$@"; fi |
| 50 | |
| 51 | # finally look in PATH |
| 52 | exec wine "$appname" "$@" |