#!/bin/sh -e

wine64=/usr/bin/wine64
wine32=/usr/bin/wine32

if test -x $wine64; then
    wine=$wine64
    if test -z "$WINELOADER"; then
        export WINELOADER=$wine64
    fi
elif test -x $wine32; then
    wine=$wine32
else
    echo "error: unable to find wine executable, this shouldn't happen." >&2
    exit 1
fi

if test -z "$WINEDEBUG"; then
    export WINEDEBUG=fixme-all
fi

exec $wine "$@"
