From 5590a4cde639ece75258174c7fb9e83fc6be62e5 Mon Sep 17 00:00:00 2001 From: Hunter Jozwiak Date: Tue, 9 Sep 2025 17:46:00 -0400 Subject: [PATCH] Fix WINEARCH preservation in wine bottle management Preserve explicitly set WINEARCH variables instead of unsetting them in wine environment functions. This ensures that installers setting WINEARCH="win32" are properly respected for architecture selection. Changes: - Remove unset WINEARCH from get_bottle() and set_wine_env() - Add comments explaining WINEARCH preservation - Update debug messages to show current WINEARCH value --- .includes/bottle.sh | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/.includes/bottle.sh b/.includes/bottle.sh index 9bce43b..e88f3a4 100644 --- a/.includes/bottle.sh +++ b/.includes/bottle.sh @@ -13,12 +13,11 @@ get_bottle() { export WINESERVER="$wine32server" # Also prepend to PATH for regular wine calls export PATH="${wine32%/*}:$PATH" - # Unset WINEARCH to avoid conflicts with system wine - unset WINEARCH - echo "DEBUG: Using managed wine32 for LAUNCHER (WINE=$WINE, PATH updated, WINEARCH unset)" + # Keep WINEARCH for compatibility + echo "DEBUG: Using managed wine32 for LAUNCHER (WINE=$WINE, PATH updated)" else - # Clear wine variables for system wine - unset WINE WINESERVER WINEARCH + # Clear wine variables for system wine but preserve WINEARCH if set + unset WINE WINESERVER echo "DEBUG: Using system wine for LAUNCHER (architecture $architecture)" fi } @@ -30,11 +29,12 @@ set_wine_env() { export WINE="$wine32" export WINESERVER="$wine32server" export PATH="${wine32%/*}:$PATH" - unset WINEARCH - echo "DEBUG: Set wine32 environment for INSTALLATION (WINE=$WINE)" + # Don't unset WINEARCH - preserve it for proper architecture selection + echo "DEBUG: Set wine32 environment for INSTALLATION (WINE=$WINE, WINEARCH=$WINEARCH)" else - unset WINE WINESERVER WINEARCH - echo "DEBUG: Set system wine environment for INSTALLATION" + unset WINE WINESERVER + # Don't unset WINEARCH - preserve it for proper architecture selection + echo "DEBUG: Set system wine environment for INSTALLATION (WINEARCH=$WINEARCH)" fi } @@ -108,6 +108,7 @@ install_wine_bottle() { # Just set up the wine environment for game installation # Determine architecture from WINEARCH or speechsdk dependency + # Preserve existing WINEARCH if already set if [[ -z "$WINEARCH" ]]; then if [[ "$*" =~ speechsdk ]]; then export WINEARCH="win32"