[pkg-wine-party] Call for testing: automatically detect wine arch and WoW64

Jens Reyer jre.winesim at gmail.com
Fri Dec 11 22:13:04 UTC 2015


Hi all,

I'd love to hear feedback about my previous commits, including tests.

As you can see I was quite surprised about WoW64, and I still don't
know, if/what I miss there.

For one side I was very pleased with my testing results.

However winetricks seems not to work quite good with WoW64, but I
already heard that before from other distros.

Also I'm not sure about the problems I had with installing Origin (no
output although I WINEDEBUG=fixme+all,err+all). It worked perfectliy
once I tried with WINEARCH=win32. Also with my first try I had the same
problem with the offical winehq packages and doing a wineboot first. But
later on it always worked there flawlessly. So it just might be some
mixture of a upstream bug and an unrelated debian bug.

So generally I'm happy with those and it makes life simpler. But given
the caveats, I am not sure if this is something ready to release.

Anyway, for your convenience I attached my current version of
/usr/bin/wine, with all previous patches applied.

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

name=$(basename $0)
bindir=/usr/lib/$name

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

if test -n "$WINEARCH"; then
    true
elif [ -n "$WINEPREFIX" ] &&
         [ -e "${WINEPREFIX}/system.reg" ] &&
         grep -q "^\#arch=win32" "${WINEPREFIX}/system.reg"; then
    echo "Setting WINEARCH=win32 because $WINEPREFIX is a 32-bit installation."
    WINEARCH=win32
elif [ -n "$WINEPREFIX" ] &&
         [ -e "${WINEPREFIX}/system.reg" ] &&
         grep -q "^\#arch=win64" "${WINEPREFIX}/system.reg"; then
    echo "Setting WINEARCH=win64 because $WINEPREFIX is a 64-bit installation."
    WINEARCH=win64
elif [ -n "$WINELOADER" ] &&
         [ "$(echo $WINELOADER|sed "s|-preloader||;s|wine32|wine|")" = "/usr/lib/$name/wine" ]; then
    echo "Setting WINEARCH=win32 because of WINELOADER $WINELOADER."
    WINEARCH=win32
elif [ -n "$WINELOADER" ] &&
         [ "$(echo $WINELOADER|sed "s|-preloader||")" = "/usr/lib/$name/wine64" ]; then
    echo "Setting WINEARCH=win64 because of WINELOADER $WINELOADER."
    WINEARCH=win64
elif [ -f "$1" ] &&
         file -bL "$1"|grep -Eq "PE32+ executable.*x86-64"; then
    echo "Setting WINEARCH=win64 because $1 is a PE32+ executable."
    WINEARCH=win64
fi

if test -x $wine64 -a "$WINEARCH" != "win32"; then
    wine=$wine64
    if [ ! -x "$wine32" -a "$(dpkg --print-architecture)" = "amd64" -a "$(dpkg --print-foreign-architectures | grep -cx "i386")" -ne 1 ]; 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
elif test -x $wine32 -a "$WINEARCH" != "win64"; then
    wine=$wine32
else
    echo "error: unable to find wine executable.  this shouldn't happen."
    exit 1
fi

if test -z "$WINEPREFIX"; then
    if test "$wine" = "$wine64"; then
        wineprefix=$HOME/.wine64
    else
        wineprefix=$HOME/.wine
    fi
else
    wineprefix=$WINEPREFIX
fi

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

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

WINEPREFIX=$wineprefix WINELOADER=$wineloader WINEDEBUG=$winedebug $wine "$@"


More information about the pkg-wine-party mailing list