diff --git a/audiogame-manager.sh b/audiogame-manager.sh index 3af3671..9dd5a0c 100755 --- a/audiogame-manager.sh +++ b/audiogame-manager.sh @@ -305,7 +305,9 @@ get_bottle() { "puzzle-divided"*) ;& "revelation"*) ;& "swamp"*) ;& - "triple -triad"*) export WINEPREFIX="${HOME}/.local/wine/aprone" ;; + "triple -triad"*) + version="7.7" + export WINEPREFIX="${HOME}/.local/wine/aprone" ;; "bg-"*) export WINEPREFIX="${HOME}/.local/wine/bg";; # ESP Pinball games "esp-pinball-classic"*) export WINEPREFIX="${HOME}/.local/wine/esp-pinball";; @@ -470,6 +472,7 @@ install_wine() { if [[ -d "${wineInstallationPath}" ]]; then return fi + mkdir -p "${wineInstallationPath}" 2> /dev/null # This probably does not need to be cached, so download to tmp. installationFile="$(mktemp)" local v=$2 @@ -747,7 +750,6 @@ game_launcher() { # kill any previous existing wineservers for this prefix in case they didn't shut down properly. wineserver -k # launch the game - # launch the game if command -v qjoypad &> /dev/null ; then mkdir -p ~/.qjoypad3 touch "${HOME}/.qjoypad3/${game%|*}.lyt" @@ -843,9 +845,23 @@ game_launcher() { fi if [[ -d "${WINEPREFIX}/drive_c/windows/syswow64" ]]; then pgrep -u "$USER" nvda2speechd &> /dev/null || ${XDG_DATA_HOME:-$HOME/.local/share}/audiogame-manager/nvda2speechd & - wine64 start /realtime /d "${winePath}" "$wineExec" + # Figure out which wine version to use + if [[ -n "${version}" ]]; then + install_wine "${version}" "64" + wine="${XDG_DATA_HOME:-$HOME/.local/share}/audiogame-manager/wine_64/${version}/bin/wine" + else + wine="$(command -v wine64)" + fi + $wine start /realtime /d "${winePath}" "$wineExec" else - wine start /d "${winePath}" "$wineExec" /realtime + # Figure out which wine version to use + if [[ -n "${version}" ]]; then + install_wine "${version}" "32" + wine="${XDG_DATA_HOME:-$HOME/.local/share}/audiogame-manager/wine_32/${version}/bin/wine" + else + wine="$(command -v wine)" + fi + $wine start /d "${winePath}" "$wineExec" /realtime fi fi exit 0 @@ -914,6 +930,7 @@ export BOX86_NOBANNER=1 unset noCache # Manual installation is not default, make sure it's unset unset manualInstall +unset version # The list of games available for installation.