[Windows] VMP prerequisite check fails on non-English Windows

Open Beginner friendly
#155 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
88/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
c

Research direction

Start in src/backend_win/prereq.c and inspect how the DISM command output is used to determine whether VirtualMachinePlatform is enabled. Reproduce the headless prerequisite check on a non-English Windows installation, then verify that an enabled feature is accepted without the false prerequisite error.

Written by the indexing model from the issue text.

Description

Your issue

Description

On Windows 11 with a non-English system language, App Sandbox v0.1.8 incorrectly reports that the VirtualMachinePlatform feature is not enabled, even when it is enabled.

Environment

App Sandbox: v0.1.8
Windows 11 Home 25H2
Windows build: 26200.9445
System language: French
VirtualMachinePlatform: Enabled
HCS: Available
HCN: Available

Problem

Running:

dism.exe /Online /Get-FeatureInfo /FeatureName:VirtualMachinePlatform

on my French Windows installation returns localized output:

État : Activé

However, src/backend_win/prereq.c checks the DISM output for the hard-coded English string:

State : Enabled

As a result, App Sandbox reports:

App Sandbox --headless requires the 'VirtualMachinePlatform' Windows feature, which is not enabled.

even though the feature is actually enabled.

Reproduction
Enable VirtualMachinePlatform on a non-English Windows installation.
Run App Sandbox v0.1.8 in headless mode.
App Sandbox incorrectly reports that VirtualMachinePlatform is not enabled.

Workaround / tested fix

I changed the DISM invocation in src/backend_win/prereq.c from:

L"C:\Windows\System32\dism.exe /online /Get-FeatureInfo /FeatureName:%ls"

to:

L"C:\Windows\System32\dism.exe /English /online /Get-FeatureInfo /FeatureName:%ls"

After rebuilding App Sandbox v0.1.8 with this one-line change, AppSandbox.exe --headless no longer reports the false prerequisite error on my French Windows installation.

The change also avoids depending on localized DISM output.

A more robust long-term solution may be possible by avoiding parsing localized DISM text entirely, but /English appears to be a minimal fix.

Thanks for the project!

Dominant language
C
Stars
704
Forks
75
Avg merge
9m
Merged PRs (30d)
6

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from jamesstringer90/appsandbox

All issues in jamesstringer90/appsandbox

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.