Commit 213c8998 authored by Nurlan's avatar Nurlan

Avoid corruption of W_PROGRAMS_WIN and W_PROGRAMS_X86_WIN when running from…

Avoid corruption of W_PROGRAMS_WIN and W_PROGRAMS_X86_WIN when running from syswo64 (eterbug #18331)
parent d7254198
From bb795de7455f8f4c6b5e6ae12a45aa5aa481417b Mon Sep 17 00:00:00 2001
From: Nurlan Usenov <suren@etersoft.ru>
Date: Mon, 22 Dec 2025 13:00:54 +0300
Subject: [PATCH] Avoid corruption of W_PROGRAMS_WIN and W_PROGRAMS_X86_WIN
when running from syswo64
---
src/winetricks | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/winetricks b/src/winetricks
index 9a66f56..66abb12 100755
--- a/src/winetricks
+++ b/src/winetricks
@@ -1078,9 +1078,14 @@ w_pathconv()
}
# Expand an environment variable and print it to stdout
+# Move to $WINEPREFIX to avoid corruption of W_PROGRAMS_WIN and W_PROGRAMS_X86_WIN when running from syswo64
w_expand_env()
{
+ _W_dl_olddir=$(pwd)
+ w_try_cd "${WINEPREFIX}"
winetricks_early_wine_arch cmd.exe /c "chcp 65001 > nul & echo %$1%"
+ w_try_cd "${_W_dl_olddir}"
+ unset _W_dl_olddir
}
# Determine what architecture a binary file is built for, silently continue in case of failure.
--
2.33.8
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment