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.

This commit is contained in:
Storm Dragon
2025-08-05 01:06:04 -04:00
parent abb0bbbb20
commit 25c9aeaa5a
2 changed files with 34 additions and 16 deletions

View File

@@ -73,14 +73,22 @@ install_rhvoice() {
} }
install_wine_bottle() { install_wine_bottle() {
# Simple rule: wine64 for everything, let WOW64 handle 32-bit speech APIs # Respect explicit WINEARCH settings, otherwise default to wine64
local architecture=64 if [[ -z "$WINEARCH" ]]; then
export WINEARCH="win64" # Default behavior: wine32 only for legacy speechsdk, wine64 for everything else
if [[ "$*" =~ speechsdk ]]; then
if [[ "$*" =~ speechsdk || "$*" =~ sapi ]]; then export WINEARCH="win32"
echo "Using wine64 with WOW64 for speech API compatibility"
else else
echo "Using wine64 for optimal performance" export WINEARCH="win64"
fi
fi
# Set architecture for WINEPREFIX path
local architecture
if [[ "$WINEARCH" == "win32" ]]; then
architecture=32
else
architecture=64
fi fi
export WINEPREFIX="$HOME/.local/wine${architecture}" export WINEPREFIX="$HOME/.local/wine${architecture}"

View File

@@ -101,18 +101,28 @@ game_removal() {
local wineExec="${game#*|}" local wineExec="${game#*|}"
wineExec="${wineExec%|*}" wineExec="${wineExec%|*}"
wineExec="${wineExec##*\\}" wineExec="${wineExec##*\\}"
# Confirm removal # With shared bottles, always remove only the game files, never the entire bottle
get_bottle "${game%|*}" create_game_array "$game"
# Make sure the game can be handled by remove if [[ ${#game[@]} -gt 0 ]]; then
if [[ "${HOME}/.local/wine/${game%|*}" == "${WINEPREFIX}" ]]; then # Set up wine environment for this game
read -rp "To remove the wine bottle \"${WINEPREFIX##*/}\" and all of its contents press enter. To cancel press control+c. " continue 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. # kill any previous existing wineservers for this prefix in case they didn't shut down properly.
wineserver -k wineserver -k
# remove the game
rm -rf "${WINEPREFIX}" # 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 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 echo "Game directory not found, skipping file removal."
rm -rf "$(winepath "${winePath}")" fi
fi
fi fi
# remove the launcher # remove the launcher
gawk -i inplace -vLine="${game//\\/\\\\}" '!index($0,Line)' "$configFile" gawk -i inplace -vLine="${game//\\/\\\\}" '!index($0,Line)' "$configFile"