Alexandre Julliard : tools: Allow running installed builtin apps even when the 32-bit loader is missing.
Alexandre Julliard
julliard at wine.codeweavers.com
Fri Dec 4 08:19:27 CST 2015
Module: wine
Branch: master
Commit: 57f9c33c08782399d6729bc58b68d73812560638
URL: http://source.winehq.org/git/wine.git/?a=commit;h=57f9c33c08782399d6729bc58b68d73812560638
Author: Alexandre Julliard <julliard at winehq.org>
Date: Fri Dec 4 18:10:35 2015 +0900
tools: Allow running installed builtin apps even when the 32-bit loader is missing.
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
tools/wineapploader.in | 22 +++++++++++++++++-----
1 file changed, 17 insertions(+), 5 deletions(-)
diff --git a/tools/wineapploader.in b/tools/wineapploader.in
index 03ede5e..f48d552 100755
--- a/tools/wineapploader.in
+++ b/tools/wineapploader.in
@@ -25,9 +25,6 @@ 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
@@ -47,6 +44,21 @@ case "$0" in
;;
esac
if [ -x "$appdir/wine" ]; then exec "$appdir/wine" "$appname" "$@"; fi
+if [ -x "$appdir/wine64" ]; then exec "$appdir/wine64" "$appname" "$@"; fi
+
+# now look in PATH
+saved_ifs=$IFS
+IFS=:
+for d in $PATH
+do
+ IFS=$saved_ifs
+ if [ -x "$d/wine" ]; then exec "$d/wine" "$appname" "$@"; fi
+ if [ -x "$d/wine64" ]; then exec "$d/wine64" "$appname" "$@"; fi
+done
+
+# finally, the default bin directory
+if [ -x "@bindir@/wine" ]; then exec "@bindir@/wine" "$appname" "$@"; fi
+if [ -x "@bindir@/wine64" ]; then exec "@bindir@/wine64" "$appname" "$@"; fi
-# finally look in PATH
-exec wine "$appname" "$@"
+echo "$0: the Wine loader is missing"
+exit 1
More information about the wine-cvs
mailing list