From 25c9aeaa5ab570a66531ae882168a0c2a10beda6 Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Tue, 5 Aug 2025 01:06:04 -0400 Subject: [PATCH] Because of the major reworking of how audiogame-manager works, had to almost completely rewrite the -r (remove game) function. Will be testing it quite a bit to make sure nothing is critically broken. --- .includes/bottle.sh | 20 ++++++++++++++------ audiogame-manager.sh | 30 ++++++++++++++++++++---------- 2 files changed, 34 insertions(+), 16 deletions(-) diff --git a/.includes/bottle.sh b/.includes/bottle.sh index 6e43cc7..a7ba5a7 100644 --- a/.includes/bottle.sh +++ b/.includes/bottle.sh @@ -73,14 +73,22 @@ install_rhvoice() { } install_wine_bottle() { - # Simple rule: wine64 for everything, let WOW64 handle 32-bit speech APIs - local architecture=64 - export WINEARCH="win64" + # Respect explicit WINEARCH settings, otherwise default to wine64 + if [[ -z "$WINEARCH" ]]; then + # Default behavior: wine32 only for legacy speechsdk, wine64 for everything else + if [[ "$*" =~ speechsdk ]]; then + export WINEARCH="win32" + else + export WINEARCH="win64" + fi + fi - if [[ "$*" =~ speechsdk || "$*" =~ sapi ]]; then - echo "Using wine64 with WOW64 for speech API compatibility" + # Set architecture for WINEPREFIX path + local architecture + if [[ "$WINEARCH" == "win32" ]]; then + architecture=32 else - echo "Using wine64 for optimal performance" + architecture=64 fi export WINEPREFIX="$HOME/.local/wine${architecture}" diff --git a/audiogame-manager.sh b/audiogame-manager.sh index b4a1098..576a2cc 100755 --- a/audiogame-manager.sh +++ b/audiogame-manager.sh @@ -101,18 +101,28 @@ game_removal() { local wineExec="${game#*|}" wineExec="${wineExec%|*}" wineExec="${wineExec##*\\}" - # Confirm removal - get_bottle "${game%|*}" - # Make sure the game can be handled by remove - if [[ "${HOME}/.local/wine/${game%|*}" == "${WINEPREFIX}" ]]; then - read -rp "To remove the wine bottle \"${WINEPREFIX##*/}\" and all of its contents press enter. To cancel press control+c. " continue + # With shared bottles, always remove only the game files, never the entire bottle + create_game_array "$game" + if [[ ${#game[@]} -gt 0 ]]; then + # Set up wine environment for this game + source .includes/bottle.sh + get_bottle "${game[0]}" + + read -rp "This will remove the game files for \"${game[2]}\" from the shared wine bottle. To continue press enter. To cancel press control+c. " continue + # kill any previous existing wineservers for this prefix in case they didn't shut down properly. wineserver -k - # remove the game - rm -rf "${WINEPREFIX}" - else - read -rp "This bottle \"${WINEPREFIX##*/}\" contains multiple entries, so only the game will be removed. To continue press enter. To cancel press control+c. " continue - rm -rf "$(winepath "${winePath}")" + + # Remove only the game's installation directory + if [[ -n "$winePath" ]]; then + local gameDir="$(winepath "$winePath")" + if [[ -d "$gameDir" ]]; then + echo "Removing game directory: $gameDir" + rm -rf "$gameDir" + else + echo "Game directory not found, skipping file removal." + fi + fi fi # remove the launcher gawk -i inplace -vLine="${game//\\/\\\\}" '!index($0,Line)' "$configFile"