[pkg-wine-party] 32-bit exe in 64-bit WINEPREFIX

jre jre.winesim at gmail.com
Thu Aug 21 00:32:27 UTC 2014


Hi,

I'm just working on 32-bit/64-bit in the wine-development packages.


What works:
- Setting up a 32-bit WINEPREFIX and running a 32-bit exe.
- Setting up a 64-bit WINEPREFIX and running a 64-bit exe.
- Detecting that a 32-bit exe is to be run in a 64-bit WINEPREFIX.

What works not:
- Running a 32bit exe in a 64bit WINEPREFIX.


Question 1:
Am I right that the latter should work?


I try the following:

~~~~~
> WINELOADER=/usr/lib/wine-development/wine
WINESERVER=/usr/lib/x86_64-linux-gnu/wine-development/wineserver
/usr/lib/wine-development/wine OriginSetup.exe

wine: '/home/jens/.wine64' is a 64-bit installation, it cannot be used
with a 32-bit wineserver.

> ps aux|grep wineserver
[...]/usr/lib/i386-linux-gnu/wine-development/./wineserver
~~~~~

... so although I specify the 64-bit WINESERVER the 32-bit one is run.

Question 2:
Should the 32-bit wine start the 64-bit wineserver if I specify
WINESERVER= accordingly?

Question 3:
Should 32-bit wine (from wine32-development 1.7.24-5) work with the
64-bit wineserver (from libwine-development:amd64 1.7.24-5)

Anyone? Currently I'm stuck and wonder whether there is a bug in wine or
in the packages (except the wine script that I'm working on) or if I'm
on a completely false track.

See attached my current wine(-development) script.
If you remove the wineserver related lines, my comments and debug lines
you can use it in the packaging as debian/scripts/wine, solving at least
the basic 64-bit issues.

jre
-------------- next part --------------
#!/bin/sh

# I use [ -f $1 ] && [ ... ] || [ ... ] instead of "test", because this prevents the second test to be tried at all if the first one is false.
# TODO: Part of the wineserver path is hardcoded.

set -e

name="$(basename $(readlink -f $(which $0)))"
echo "DEBUG: name $name"
bindir=/usr/lib/$name
echo "DEBUG: bindir $bindir"

wine32=$bindir/wine
wine64=$bindir/wine64

# NOTE: http://wiki.winehq.org/Wine64ForPackagers
if [ -f "$1" ] && [ "$(file -b -L "$1" | cut -d\  -f1)" = "PE32+" ] || [ "$WINEARCH" = "win64" ]; then
    echo "DEBUG: 64bit"
    if test -x $wine64; then
	wine=$wine64
    else
	# TODO: better message:
	echo "wine64 required"
	exit 1
    fi
    # TODO: Don't hardcode path:
    if test -z $WINESERVER; then SERVER=/usr/lib/x86_64-linux-gnu/$name/wineserver; fi
elif test -x $wine32; then
    echo "DEBUG: 32bit"
    wine=$wine32
    # NOTE: http://wiki.winehq.org/Wine64ForPackagers
    # In a 64bit prefix 32bit programs do run, but 64bit wineserver is required!
    # Test if WINEPREFIX already exists and is a 64bit
    if test -z $WINEPREFIX; then WINEPREFIX="~/.wine"; fi
    if [ -f "$WINEPREFIX/system.reg" ] && [ "$(cat $WINEPREFIX/system.reg | grep "PROCESSOR_ARCHITECTURE" | cut -d= -f2)" = "\"AMD64\"" ]; then
	echo "DEBUG: ..... but in a 64bit WINEPREFIX"
	if test -z $WINESERVER;then SERVER=/usr/lib/x86_64-linux-gnu/$name/wineserver; fi
    else
        if test -z $WINESERVER;then SERVER=/usr/lib/i386-linux-gnu/$name/wineserver; fi
    fi
else
    if [ "$(dpkg --print-architecture)" = "amd64" -a "$(dpkg --print-foreign-architectures)" != "i386" ]; then
        echo "it looks like multiarch needs to be enabled.  as root, please"
        echo "execute \"dpkg --add-architecture i386 && apt-get update &&"
        echo "apt-get install $(echo $name | sed s/wine/wine32/)\""
    fi
    echo "error: unable to find wine executable.  this shouldn't happen."
    exit 1
fi

if test -z $WINELOADER; then
    wineloader=$wine
else
    wineloader=$WINELOADER
fi

if test -z $WINEDEBUG; then
    winedebug=-all
else
    winedebug=$WINEDEBUG
fi

# Possibel other variables that need to be set:
# See http://wiki.winehq.org/FAQ#head-5d2fd5010318b5facd3ebf67930d1259e67c465f (FAQ: Can I install more than one Wine version on my system?)
#export WINEVERPATH=$W
#export PATH=$W/bin:$PATH
#export WINESERVER=$W/bin/wineserver
#export WINELOADER=$W/bin/wine
#export WINEDLLPATH=$W/lib/wine/fakedlls
#export LD_LIBRARY_PATH="$W/lib:$LD_LIBRARY_PATH" 

echo "DEBUG: WINEVERPATH is     $WINEVERPATH"
echo "DEBUG: PATH is            $PATH"
echo "DEBUG: SERVER is          $SERVER"
echo "DEBUG: WINESERVER is      $WINESERVER"
echo "DEBUG: wineloader is      $wineloader"
echo "DEBUG: WINELOADER is      $WINELOADER"
echo "DEBUG: WINEDLLPATH is     $WINEDLLPATH"
echo "DEBUG: LD_LIBRARY_PATH is $LD_LIBRARY_PATH"
echo "DEBUG: wine is            $wine"
echo DEBUG: WINELOADER=$wineloader WINEDEBUG=$winedebug WINESERVER=$SERVER $wine "$@"

WINELOADER=$wineloader WINEDEBUG=$winedebug WINESERVER=$SERVER $wine "$@"


More information about the pkg-wine-party mailing list