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:
@@ -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"
|
||||
|
||||
if [[ "$*" =~ speechsdk || "$*" =~ sapi ]]; then
|
||||
echo "Using wine64 with WOW64 for speech API compatibility"
|
||||
# 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
|
||||
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
|
||||
|
||||
export WINEPREFIX="$HOME/.local/wine${architecture}"
|
||||
|
@@ -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}"
|
||||
|
||||
# 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
|
||||
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}")"
|
||||
echo "Game directory not found, skipping file removal."
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
# remove the launcher
|
||||
gawk -i inplace -vLine="${game//\\/\\\\}" '!index($0,Line)' "$configFile"
|
||||
|
Reference in New Issue
Block a user