build: Support custom Wine versions
This commit is contained in:
parent
25c4bc18e7
commit
4d35f16899
|
@ -48,36 +48,36 @@ export WINEDEBUG=-all
|
||||||
# wine gecko and mono
|
# wine gecko and mono
|
||||||
export WINEDLLOVERRIDES="mscoree,mshtml="
|
export WINEDLLOVERRIDES="mscoree,mshtml="
|
||||||
|
|
||||||
wine="wine"
|
# support custom Wine versions
|
||||||
wine64="wine64"
|
[ -z "$WINE" ] && WINE="$(command -v wine)"
|
||||||
wineboot="wineboot"
|
[ -z "$WINE64" ] && WINE64="${WINE}64"
|
||||||
|
|
||||||
# $PATH is the way for user to control where wine is located (including custom Wine versions).
|
# $PATH is the way for user to control where wine is located (including custom Wine versions).
|
||||||
# Pure 64-bit Wine (non Wow64) requries skipping 32-bit steps.
|
# Pure 64-bit Wine (non Wow64) requries skipping 32-bit steps.
|
||||||
# In such case, wine64 and winebooot will be present, but wine binary will be missing,
|
# In such case, wine64 and winebooot will be present, but wine binary will be missing,
|
||||||
# however it can be present in other PATHs, so it shouldn't be used, to avoid versions mixing.
|
# however it can be present in other PATHs, so it shouldn't be used, to avoid versions mixing.
|
||||||
wine_path=$(dirname "$(which $wineboot)")
|
wine_path=$(dirname "$WINE")
|
||||||
wow64=true
|
wow64=true
|
||||||
if ! [ -f "$wine_path/$wine" ]; then
|
if ! [ -f "$wine_path/wine" ]; then
|
||||||
wine=$wine64
|
WINE="$WINE64"
|
||||||
wow64=false
|
wow64=false
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# resolve 32-bit and 64-bit system32 path
|
# resolve 32-bit and 64-bit system32 path
|
||||||
winever=$($wine --version | grep wine)
|
winever=$("$WINE" --version | grep wine)
|
||||||
if [ -z "$winever" ]; then
|
if [ -z "$winever" ]; then
|
||||||
echo "$wine: Not a wine executable. Check your $wine." >&2
|
echo "$WINE: Not a wine executable. Check your $WINE." >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# ensure wine placeholder dlls are recreated
|
# ensure wine placeholder dlls are recreated
|
||||||
# if they are missing
|
# if they are missing
|
||||||
$wineboot -u
|
"$WINE" wineboot -u
|
||||||
|
|
||||||
win64_sys_path=$($wine64 winepath -u 'C:\windows\system32' 2> /dev/null)
|
win64_sys_path=$("$WINE64" winepath -u 'C:\windows\system32' 2> /dev/null)
|
||||||
win64_sys_path="${win64_sys_path/$'\r'/}"
|
win64_sys_path="${win64_sys_path/$'\r'/}"
|
||||||
if $wow64; then
|
if $wow64; then
|
||||||
win32_sys_path=$($wine winepath -u 'C:\windows\system32' 2> /dev/null)
|
win32_sys_path=$("$WINE" winepath -u 'C:\windows\system32' 2> /dev/null)
|
||||||
win32_sys_path="${win32_sys_path/$'\r'/}"
|
win32_sys_path="${win32_sys_path/$'\r'/}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -88,7 +88,7 @@ fi
|
||||||
|
|
||||||
# create native dll override
|
# create native dll override
|
||||||
overrideDll() {
|
overrideDll() {
|
||||||
if ! $wine reg add 'HKEY_CURRENT_USER\Software\Wine\DllOverrides' /v "$1" /d native /f >/dev/null 2>&1
|
if ! "$WINE" reg add 'HKEY_CURRENT_USER\Software\Wine\DllOverrides' /v "$1" /d native /f >/dev/null 2>&1
|
||||||
then
|
then
|
||||||
echo -e "Failed to add override for $1"
|
echo -e "Failed to add override for $1"
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -97,7 +97,7 @@ overrideDll() {
|
||||||
|
|
||||||
# remove dll override
|
# remove dll override
|
||||||
restoreDll() {
|
restoreDll() {
|
||||||
if ! $wine reg delete 'HKEY_CURRENT_USER\Software\Wine\DllOverrides' /v "$1" /f > /dev/null 2>&1
|
if ! "$WINE" reg delete 'HKEY_CURRENT_USER\Software\Wine\DllOverrides' /v "$1" /f > /dev/null 2>&1
|
||||||
then
|
then
|
||||||
echo "Failed to remove override for $1"
|
echo "Failed to remove override for $1"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue