Control: patch
Changes from previous version:
Wine version is detected using the following priorities:
1) $WINEARCH - if set
2) $WINEPREFIX/system.reg - from #arch= header
3) /usr/bin/wine64 - if installed
4) /usr/bin/wine32 - if installed
5) error
$WINELOADER is no longer set:
- wine sets WINELOADER itself since version 7.22
#!/bin/sh
set -e
WINE32=/usr/bin/wine32
WINE64=/usr/bin/wine64
if [ -z "$WINEARCH" ] ; then
if [ -n "$WINEPREFIX" ] ; then
if [ -f "$WINEPREFIX/system.reg" ] ; then
# extract WINEARCH from WINEPREFIX
WINEARCH="$( head "$WINEPREFIX/system.reg" | grep -e '^#arch=' |
sed 's/.*=//' )"
fi
fi
fi
if [ -z "$WINEARCH" ] ; then
if [ -x "$WINE64" ] ; then
WINE="$WINE64"
elif [ -x "$WINE32" ] ; then
WINE="$WINE32"
else
echo "error: unable to find wine executable, this shouldn't happen." >&2
exit 1
fi
elif [ 'win64' = "$WINEARCH" ] ; then
WINE="$WINE64"
elif [ 'win32' = "$WINEARCH" ] ; then
WINE="$WINE32"
else
echo "error: invalid WINEARCH '$WINEARCH'" >&2
exit 1
fi
if [ -z "$WINEDEBUG" ] ; then
export WINEDEBUG=fixme-all
fi
exec "$WINE" "$@"