From 74bbd5c53fd298971df8600bae0d99c42b95d6ab Mon Sep 17 00:00:00 2001 From: The412Banner <205237651+The412Banner@users.noreply.github.com> Date: Wed, 18 Nov 2026 09:41:21 -0500 Subject: [PATCH] fix(bionic): keep Wine's update from deleting the tool's .NET stubs and comctl32 v6 wine.inf has Wine's update delete ngen.exe, fusion.dll, mscorwks.dll, comctl32_v6.dll and seven more from system32 and syswow64 ("11,,name,-" in FakeDlls and FakeDllsWow64): in Windows they live only under Microsoft.NET and winsxs. link_dir linked every file of the tool into those folders, and Wine deletes through the link, so the first launch after each install removed the tool's own copies (10 files in each Wine folder, seen on the Pocket FIT and the Elite for r25 and r27). Prefixes made after that lack comctl32 v6 in winsxs. launch.sh now reads those names from the tool's wine.inf and link_dir leaves them out of system32 and syswow64, removing a link an earlier run left there. DroidDeck-Proton has no such links: it links only what its default_pfx holds. Tested on the Pocket FIT (r27 with this launch.sh, Brawlhalla, relink and Wine's update forced, winsxs comctl32 v6 moved aside): the tool keeps all 1042 / 1026 files, Wine rebuilt winsxs comctl32 v6 from the tool (same bytes), the game runs, no stack overflow, no c0000142. --- tools/bionic-runtime/tool/launch.sh | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/tools/bionic-runtime/tool/launch.sh b/tools/bionic-runtime/tool/launch.sh index 4a43f69148..cf7a34235b 100644 --- a/tools/bionic-runtime/tool/launch.sh +++ b/tools/bionic-runtime/tool/launch.sh @@ -147,11 +147,28 @@ wine_() { LD_LIBRARY_PATH=$LIBS LD_PRELOAD=$PRELOAD "$LINKER" "$F/lib/wine/aarch wineserver_() { LD_LIBRARY_PATH=$LIBS LD_PRELOAD=$PRELOAD "$LINKER" "$F/bin/wineserver" "$@"; } is_builtin() { head -c 128 "$1" 2>/dev/null | grep -q "Wine builtin DLL"; } -link_dir() { # src dst: links every file of src into dst; replaces links and Wine builtin copies, keeps native DLLs +# Names wine.inf has Wine's update delete from system32 (section FakeDlls) or syswow64 (FakeDllsWow64), "11,,name,-": +# in Windows they live only under Microsoft.NET or winsxs. Wine deletes through a link, so a link there cost this +# tool its own fusion.dll, ngen.exe, comctl32_v6.dll and the rest, and later prefixes their .NET stubs and comctl32 v6. +inf_drops() { + awk -v s="[$1]" '/^\[/ { h = $0; sub(/[ \t\r]+$/, "", h); on = (h == s); next } + on && /^11,,[^,]+,-[ \t\r]*$/ { split($0, a, ","); print a[3] }' "$F/share/wine/wine.inf" 2>/dev/null +} +dropped() { # name patterns + set -f + for p in $2; do case "$1" in $p) set +f; return 0 ;; esac; done + set +f; return 1 +} +link_dir() { # src dst [names]: links every file of src into dst; replaces links and Wine builtin copies, keeps native + # DLLs; names (wine.inf patterns) are not linked and a link left under one is removed [ -d "$1" ] || return 0 for f in "$1"/*; do [ -f "$f" ] || continue t=$2/${f##*/} + if [ -n "${3:-}" ] && dropped "${f##*/}" "$3"; then + [ -L "$t" ] && rm -f "$t" + continue + fi if [ -L "$t" ]; then [ "$(readlink "$t")" = "$f" ] && continue rm -f "$t" @@ -178,8 +195,8 @@ prepare_prefix() { W=$P/drive_c/windows mkdir -p "$W/system32" "$W/syswow64" "$P/dosdevices" echo "$(date +%H:%M:%S) linking builtins" - link_dir "$F/lib/wine/aarch64-windows" "$W/system32" - link_dir "$F/lib/wine/i386-windows" "$W/syswow64" + link_dir "$F/lib/wine/aarch64-windows" "$W/system32" "$(inf_drops FakeDlls)" + link_dir "$F/lib/wine/i386-windows" "$W/syswow64" "$(inf_drops FakeDllsWow64)" for c in dxvk vkd3d-proton; do link_dir "$F/lib/wine/$c/aarch64-windows" "$W/system32" link_dir "$F/lib/wine/$c/i386-windows" "$W/syswow64"