Skip to content

iso-patch: force English DISM output for ISO language detection (fixes #84)#102

Open
n0dai wants to merge 1 commit into
jamesstringer90:mainfrom
n0dai:fix/iso-patch-localized-dism
Open

iso-patch: force English DISM output for ISO language detection (fixes #84)#102
n0dai wants to merge 1 commit into
jamesstringer90:mainfrom
n0dai:fix/iso-patch-localized-dism

Conversation

@n0dai

@n0dai n0dai commented Jul 18, 2026

Copy link
Copy Markdown

Problem

The Windows ISO language detection (tools/iso-patch/iso-patch.c, Step 2.5) parses dism /Get-WimInfo output looking for the literal string "(Default)". DISM localizes its output to the host UI language, so on any non-English host the marker never matches — French DISM prints (Par défaut), Korean prints (기본값), etc. Detection then silently falls back to en-US regardless of the ISO's actual language, and the guest is provisioned with an en-US unattend: wrong UI language, wrong keyboard layout (e.g. QWERTY on a French fr-FR ISO).

This is exactly what #84 reports (Detected ISO language: en-US for a Korean ISO from the official Microsoft page).

Fix

Pass DISM's documented global /English switch so the output is always in English and the "(Default)" pattern matches on every host locale:

dism.exe /English /Get-WimInfo /WimFile:"..." /Index:N

Failure behavior is unchanged: if the pattern is still absent for any reason, the code falls back to en-US exactly as before.

Testing

Rebuilt iso-patch.exe (MSBuild, Release x64) on a French Windows 11 host and created a VM from a French Win11_25H2_French_x64_v2.iso:

  • Before: Detected ISO language: en-US → guest installs with en-US locale + US keyboard.
  • After: the language is detected correctly and the guest gets the matching unattend (fr-FR locale, AZERTY layout).

Fixes #84

The Windows ISO language detection (Step 2.5) parses `dism /Get-WimInfo`
output for the literal string "(Default)". DISM localizes its output to
the host UI language, so on any non-English host the marker never matches
("(Par defaut)" on French, etc.) and detection silently falls back to
en-US regardless of the ISO's actual language. The guest then gets an
en-US unattend (wrong keyboard layout / locale) even for fr-FR, ko-KR,
de-DE... ISOs.

Fix: pass DISM's documented global /English switch so the output is
always parseable. Failure behavior is unchanged (still falls back to
en-US if the pattern is absent).

Fixes jamesstringer90#84
@n0dai
n0dai force-pushed the fix/iso-patch-localized-dism branch from 8db90ae to 6e28946 Compare July 18, 2026 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ISO file language detection is not working properly

1 participant