wine/programs/wineapploader.in
Alexandre Julliard 3536316a31 New loading scheme for Winelib apps, makes them behave like builtin
dlls and takes load order into account. Install them in dlldir.
Improved MODULE_GetBinaryType to recognize ELF binaries.
Added a wrapper script to setup the environment when running directly
from inside the source tree.
2002-05-22 21:32:49 +00:00

52 lines
1.5 KiB
Bash
Executable file

#!/bin/sh
#
# Wrapper script to start a Winelib application once it is installed
#
# Copyright (C) 2002 Alexandre Julliard
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# determine the app Winelib library name
appname=`basename "$0" .exe`.exe
# first try explicit WINELOADER
if [ -x "$WINELOADER" ]; then exec "$WINELOADER" "$appname" "$@"; fi
# then default bin directory
if [ -x "@bindir@/wine" ]; then exec "@bindir@/wine" "$appname" "$@"; fi
# now try the directory containing $0
appdir=""
case "$0" in
*/*)
# $0 contains a path, use it
appdir=`dirname "$0"`
;;
*)
# no directory in $0, search in PATH
saved_ifs=$IFS
IFS=:
for d in $PATH
do
IFS=$saved_ifs
if [ -x "$d/$0" ]; then appdir="$d"; break; fi
done
;;
esac
if [ -x "$appdir/wine" ]; then exec "$appdir/wine" "$appname" "$@"; fi
# finally look in PATH
exec wine "$appname" "$@"