From a831d5f2d56a14bfb6d3a9a594d3e18f79a47c81 Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Thu, 23 Apr 2026 00:42:45 -0400 Subject: [PATCH] More careful about replacing dlls with the correct version. --- .../.functions/game_install_functions.sh | 29 +++++++-------- .../stormux/.local/.functions/install_game.sh | 6 ++-- .../.local/bin/stormux_launch_helpers.sh | 35 +++++++++---------- 3 files changed, 34 insertions(+), 36 deletions(-) diff --git a/home/stormux/.local/.functions/game_install_functions.sh b/home/stormux/.local/.functions/game_install_functions.sh index 6bc7b62..8a2a1e7 100755 --- a/home/stormux/.local/.functions/game_install_functions.sh +++ b/home/stormux/.local/.functions/game_install_functions.sh @@ -214,6 +214,7 @@ replace_wine_nvda_dlls() { local dllFile local dllName local replacement + local fileInfo [[ -d "${WINEPREFIX:-}" ]] || return 0 @@ -225,21 +226,21 @@ replace_wine_nvda_dlls() { dllName="${dllFile##*/}" replacement="" - case "${dllName,,}" in - nvdacontrollerclient32.dll) - replacement="${accessibilityDir}/nvdaControllerClient32.dll" - ;; - nvdacontrollerclient64.dll) - replacement="${accessibilityDir}/nvdaControllerClient64.dll" - ;; - nvdacontrollerclient.dll) - if file "$dllFile" | grep -q 'PE32+'; then - replacement="${accessibilityDir}/nvdaControllerClient64.dll" - elif file "$dllFile" | grep -q 'PE32'; then + fileInfo="$(file "$dllFile" 2> /dev/null || true)" + if grep -q 'PE32+' <<< "$fileInfo"; then + replacement="${accessibilityDir}/nvdaControllerClient64.dll" + elif grep -q 'PE32' <<< "$fileInfo"; then + replacement="${accessibilityDir}/nvdaControllerClient32.dll" + else + case "${dllName,,}" in + nvdacontrollerclient32.dll) replacement="${accessibilityDir}/nvdaControllerClient32.dll" - fi - ;; - esac + ;; + nvdacontrollerclient64.dll) + replacement="${accessibilityDir}/nvdaControllerClient64.dll" + ;; + esac + fi if [[ -n "$replacement" && -f "$replacement" ]]; then cp -f "$replacement" "$dllFile" diff --git a/home/stormux/.local/.functions/install_game.sh b/home/stormux/.local/.functions/install_game.sh index de4ecc2..539ddcd 100755 --- a/home/stormux/.local/.functions/install_game.sh +++ b/home/stormux/.local/.functions/install_game.sh @@ -37,15 +37,13 @@ prune_old_logs() { } setup_logging() { - local timestamp local safeName mkdir -p "$logDir" prune_old_logs - timestamp="$(date '+%Y%m%d-%H%M%S')" safeName="$(safe_log_name "$gameName")" - logFile="${logDir}/${safeName}-${timestamp}.log" - exec > >(tee -a "$logFile") 2>&1 + logFile="${logDir}/${safeName}.log" + exec > >(tee "$logFile") 2>&1 printf 'Installing %s [%s]\n' "$gameName" "$(date)" printf 'Installer path: %s\n' "$installerPath" } diff --git a/home/stormux/.local/bin/stormux_launch_helpers.sh b/home/stormux/.local/bin/stormux_launch_helpers.sh index d5b23a8..02ce7a4 100755 --- a/home/stormux/.local/bin/stormux_launch_helpers.sh +++ b/home/stormux/.local/bin/stormux_launch_helpers.sh @@ -22,14 +22,12 @@ prune_old_launch_logs() { setup_launch_logging() { local launchName="$1" - local timestamp local safeName prune_old_launch_logs - timestamp="$(date '+%Y%m%d-%H%M%S')" safeName="$(safe_log_name "$launchName")" - launchLogFile="${launchLogDir}/${safeName}-${timestamp}.log" - exec > >(tee -a "$launchLogFile") 2>&1 + launchLogFile="${launchLogDir}/${safeName}.log" + exec > >(tee "$launchLogFile") 2>&1 printf 'Launching %s [%s]\n' "$launchName" "$(date)" } @@ -158,6 +156,7 @@ update_wine_nvda_dlls() { local dllFile local dllName local replacement + local fileInfo [[ -f "${accessibilityDir}/nvdaControllerClient32.dll" ]] || return 0 [[ -f "${accessibilityDir}/nvdaControllerClient64.dll" ]] || return 0 @@ -169,21 +168,21 @@ update_wine_nvda_dlls() { dllName="${dllFile##*/}" replacement="" - case "${dllName,,}" in - nvdacontrollerclient32.dll) - replacement="${accessibilityDir}/nvdaControllerClient32.dll" - ;; - nvdacontrollerclient64.dll) - replacement="${accessibilityDir}/nvdaControllerClient64.dll" - ;; - nvdacontrollerclient.dll) - if file "$dllFile" | grep -q 'PE32+'; then - replacement="${accessibilityDir}/nvdaControllerClient64.dll" - elif file "$dllFile" | grep -q 'PE32'; then + fileInfo="$(file "$dllFile" 2> /dev/null || true)" + if grep -q 'PE32+' <<< "$fileInfo"; then + replacement="${accessibilityDir}/nvdaControllerClient64.dll" + elif grep -q 'PE32' <<< "$fileInfo"; then + replacement="${accessibilityDir}/nvdaControllerClient32.dll" + else + case "${dllName,,}" in + nvdacontrollerclient32.dll) replacement="${accessibilityDir}/nvdaControllerClient32.dll" - fi - ;; - esac + ;; + nvdacontrollerclient64.dll) + replacement="${accessibilityDir}/nvdaControllerClient64.dll" + ;; + esac + fi if [[ -n "$replacement" && -f "$replacement" ]]; then printf 'Updating %s with nvdaControllerClient\n' "$dllFile"