fix(components): a native-only override falls back to builtin when the prefix has no native DLL (#2142)

* fix(components): a native-only override falls back to builtin when the prefix has no native DLL

A component that asks for a DLL native-only (for example .NET 4.8's mscoree=n) left the DLL unloadable when its native copy never reached the prefix. On ARM64 prefixes the .NET installer leaves Wine's builtin mscoree in system32, so every program that needs .NET exited at launch with 'mscoree.dll not found'.

At launch, an override of n for a DLL whose system32 or syswow64 copy is missing or is Wine's own (a link into the Proton build, or a builtin or placeholder stub) becomes n,b, and the session log says so. A real native copy is still loaded first, and the saved component state is unchanged, so the override returns to n once the native DLL is there.

* Treat any prefix symlink as builtin when checking native overrides

* Treat an unreadable prefix DLL as missing for native overrides
This commit is contained in:
MaxsTechReview authored and GitHub committed 2026-11-05 18:00:38 -05:00
1 parent 5624b483fb
commit 8ac5652131
2 files changed
+75 -1

No files matched your search

@@ -600,6 +600,8 @@ def apply(compat_path, app_id, selection=SELECTION, store=STORE, pending=PENDING
written, registry_notes = apply_registry(pfx, values, new_state, held)
notes += registry_notes
save_state(compat, new_state)
overrides, fallback = reachable_overrides(pfx, overrides)
notes += fallback
if copied or removed or restored or written:
note = "components %s: %d file(s) placed, %d removed" % (",".join(ids) or "none", copied, removed)
note += ", %d put back as they were" % restored if restored else ""
@@ -607,6 +609,26 @@ def apply(compat_path, app_id, selection=SELECTION, store=STORE, pending=PENDING
return overrides, notes
def native_dll(pfx, name):
for arch in ARCH_DIRS:
path = existing(pfx / "drive_c/windows" / arch / (name + ".dll"))
if path is None or builtin(path) or not os.access(path, os.R_OK):
return False
return True
def reachable_overrides(pfx, names):
kept, notes = [], []
for entry in names:
name, sep, mode = entry.partition("=")
name = name.strip().lower()
if sep and mode.strip().lower() == "n" and not native_dll(pfx, name):
entry = name + "=n,b"
notes.append("%s=n has no native DLL in the prefix; using n,b" % name)
kept.append(entry)
return kept, notes
def overrides_value(names):
modes = {}
for entry in names: