A ton of updates. We now have working 32 bit wine, Swamp installs and works, many other 32 bit games should as well. Improvements to the user interface both GUI and CLI. Tons of bug fixes. Not quite yet ready for mainstream testing, but getting closer.

This commit is contained in:
Storm Dragon
2025-08-07 20:18:11 -04:00
parent e5c6798c80
commit 9515c25ea3
130 changed files with 309 additions and 196 deletions

View File

@@ -6,12 +6,35 @@ get_bottle() {
architecture="${architecture/win/}"
export WINEPREFIX="$HOME/.local/wine${architecture}"
# Set wine executables based on architecture
# Set wine executables based on architecture - FOR LAUNCHER
if [[ "$architecture" == "32" ]] && [[ -n "$wine32" ]]; then
# Set environment variables for winetricks compatibility
export WINE="$wine32"
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)"
else
unset WINE WINESERVER # Use system defaults
# Clear wine variables for system wine
unset WINE WINESERVER WINEARCH
echo "DEBUG: Using system wine for LAUNCHER (architecture $architecture)"
fi
}
# Set wine environment for installation (called from install_wine_bottle)
set_wine_env() {
local architecture="$1"
if [[ "$architecture" == "32" ]] && [[ -n "$wine32" ]]; then
export WINE="$wine32"
export WINESERVER="$wine32server"
export PATH="${wine32%/*}:$PATH"
unset WINEARCH
echo "DEBUG: Set wine32 environment for INSTALLATION (WINE=$WINE)"
else
unset WINE WINESERVER WINEARCH
echo "DEBUG: Set system wine environment for INSTALLATION"
fi
}
@@ -81,13 +104,15 @@ install_rhvoice() {
}
install_wine_bottle() {
# Respect explicit WINEARCH settings, otherwise default to wine64
# Simplified - bottles are now pre-created with dependencies
# Just set up the wine environment for game installation
# Determine architecture from WINEARCH or speechsdk dependency
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"
export WINEARCH="win64"
fi
fi
@@ -101,63 +126,40 @@ install_wine_bottle() {
export WINEPREFIX="$HOME/.local/wine${architecture}"
# Check if bottle already exists and is properly initialized
local bottleExists=false
if [[ -d "$WINEPREFIX" ]] && [[ -f "$WINEPREFIX/system.reg" ]] && [[ -f "$WINEPREFIX/user.reg" ]]; then
bottleExists=true
echo "Using existing wine${architecture} bottle at $WINEPREFIX"
fi
# Set wine environment
set_wine_env "$architecture"
# Only do basic setup if bottle doesn't exist
if [[ "$bottleExists" == false ]]; then
echo -n "Creating new wine${architecture} bottle - Using "
wine --version
DISPLAY="" wine wineboot -u | agm_progressbox "Wine Setup" "Initializing wine bottle..."
echo "Using pre-configured wine${architecture} bottle at $WINEPREFIX"
# Install any additional game-specific dependencies if specified
if [[ $# -gt 0 ]]; then
# Filter out dependencies that are already installed in bottle creation
local depsToInstall=()
local alreadyInstalled="speechsdk corefonts isolate_home"
# Install mono and gecko only for new bottles
monoPath="$(find /usr/share/wine/ -maxdepth 1 -type d -name mono 2> /dev/null)"
geckoPath="$(find /usr/share/wine/ -maxdepth 1 -type d -name "gecko" 2> /dev/null)"
if [[ -z "$monoPath" ]]; then
download 'http://dl.winehq.org/wine/wine-mono/6.0.0/wine-mono-6.0.0-x86.msi'
monoPath="${cache}/wine-mono-6.0.0-x86.msi"
for dep in "$@"; do
# Skip dependencies already installed during bottle creation
if [[ ! " $alreadyInstalled " =~ " $dep " ]] && [[ ! "$dep" =~ ^win(7|8|10)$ ]]; then
depsToInstall+=("$dep")
fi
done
if [[ ${#depsToInstall[@]} -gt 0 ]]; then
echo "Installing additional dependencies: ${depsToInstall[*]}"
{
env WINE="$WINE" WINESERVER="$WINESERVER" DISPLAY="${DISPLAY:-:0}" winetricks -q isolate_home "${depsToInstall[@]}" "${winVer:-win7}" ${winetricksSettings}
} | agm_progressbox "Wine Setup" "Installing additional dependencies..."
fi
if [[ -z "$geckoPath" ]]; then
download 'http://dl.winehq.org/wine/wine-gecko/2.40/wine_gecko-2.40-x86.msi'
geckoPath="${cache}/wine_gecko-2.40-x86.msi"
fi
wine msiexec /i z:"$monoPath" /quiet | agm_progressbox "Wine Setup" "Installing .NET Framework..."
wine msiexec /i z:"$geckoPath" /quiet | agm_progressbox "Wine Setup" "Installing Web Browser support..."
fi
# Install RHVoice only if needed and not already installed
if [[ "${*}" =~ (speechsdk|sapi) ]]; then
install_rhvoice
fi
# Setup nvda2speechd for wine64 bottles (only once)
if [[ "${WINEARCH}" == "win64" ]]; then
download "https://github.com/RastislavKish/nvda2speechd/releases/download/v0.1/nvda2speechd"
if [[ ! -f "${XDG_DATA_HOME:-$HOME/.local/share}/audiogame-manager/nvda2speechd" ]]; then
cp "${cache}/nvda2speechd" "${XDG_DATA_HOME:-$HOME/.local/share}/audiogame-manager/nvda2speechd"
chmod +x "${XDG_DATA_HOME:-$HOME/.local/share}/audiogame-manager/nvda2speechd"
fi
fi
# Install winetricks dependencies - this is more complex to optimize
# For now, let winetricks handle checking if packages are already installed
if [[ $# -gt 0 ]] || [[ -n "${winVer}" ]] || [[ -n "${winetricksSettings}" ]]; then
winetricks -q isolate_home "$@" "${winVer:-win7}" ${winetricksSettings} | agm_progressbox "Wine Setup" "Installing wine dependencies..."
fi
# Set default voice for speech-enabled games (only if not already set)
if [[ ${#defaultVoice} -ge 2 ]] && [[ "$*" =~ (speechsdk|sapi) ]]; then
echo "Setting default voice for wine${architecture}."
"${0%/*}/speech/set-voice.sh" -b "wine${architecture}" -r "${defaultRate:-7}" -v "${defaultVoice}"
fi
}
add_launcher() {
local launchSettings="${WINEARCH:-win64}|${1}|${game}"
# Determine architecture from WINEPREFIX path instead of WINEARCH variable
local architecture="win64" # default
if [[ "$WINEPREFIX" =~ wine32 ]]; then
architecture="win32"
fi
local launchSettings="${architecture}|${1}|${game}"
shift
while [[ $# -gt 0 ]]; do
launchSettings+="|$1"

View File

@@ -250,23 +250,18 @@ agm_progressbox() {
beepPid=$!
fi
# Start visual progress dialog with auto-close
# Start visual progress dialog with auto-close, redirect stdin to prevent conflicts
yad --progress \
--title="$title" \
--text="$text" \
--auto-close \
--pulsate \
--width=400 \
--height=100 &
--height=100 </dev/null &
yadPid=$!
# Process command output
local lineCount=0
local lastLine="Starting..."
while IFS= read -r line; do
((lineCount++))
lastLine="$line"
done < <(stdbuf -oL cat)
# Pass through all input completely unchanged
cat
# Clean up background processes
cleanup_progress