For Swamp wine version < 11.17 require the quarts override from winetricks. In wine 17.11 and probably later, it needs the internal wine provided version. Added a function to deal with this.
This commit is contained in:
@@ -22,6 +22,35 @@ get_bottle() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
apply_swamp_quartz_override() {
|
||||||
|
local exePath="$1"
|
||||||
|
local wineVersion="$2"
|
||||||
|
local exeName="${exePath##*\\}"
|
||||||
|
local wineMajor
|
||||||
|
local wineMinor
|
||||||
|
local quartzOverride
|
||||||
|
|
||||||
|
exeName="${exeName##*/}"
|
||||||
|
if [[ "${exeName,,}" != "swamp.exe" ]]; then
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ ! "$wineVersion" =~ wine-([0-9]+)\.([0-9]+) ]]; then
|
||||||
|
echo 'Could not determine the Wine version.' >&2
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
wineMajor="${BASH_REMATCH[1]}"
|
||||||
|
wineMinor="${BASH_REMATCH[2]}"
|
||||||
|
if (( wineMajor > 11 || (wineMajor == 11 && wineMinor >= 17) )); then
|
||||||
|
quartzOverride="b"
|
||||||
|
else
|
||||||
|
quartzOverride="n,b"
|
||||||
|
fi
|
||||||
|
|
||||||
|
export WINEDLLOVERRIDES="${WINEDLLOVERRIDES:+${WINEDLLOVERRIDES};}quartz=${quartzOverride}"
|
||||||
|
}
|
||||||
|
|
||||||
# Set wine environment for installation (called from install_wine_bottle)
|
# Set wine environment for installation (called from install_wine_bottle)
|
||||||
set_wine_env() {
|
set_wine_env() {
|
||||||
local architecture="$1"
|
local architecture="$1"
|
||||||
|
|||||||
@@ -820,8 +820,10 @@ game_launcher() {
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
get_bottle "${game[0]}"
|
get_bottle "${game[0]}"
|
||||||
echo -n "launching "
|
local wineVersion
|
||||||
wine --version
|
wineVersion="$(wine --version)"
|
||||||
|
printf 'launching %s\n' "$wineVersion"
|
||||||
|
apply_swamp_quartz_override "${game[1]}" "$wineVersion"
|
||||||
# kill any previous existing wineservers for this prefix in case they didn't shut down properly.
|
# kill any previous existing wineservers for this prefix in case they didn't shut down properly.
|
||||||
wineserver -k
|
wineserver -k
|
||||||
# launch the game
|
# launch the game
|
||||||
|
|||||||
Reference in New Issue
Block a user