microsoft / microsoft/WindowsAppSDK

RegistryWriteVirtualization does not work with the new syntax on Windows 10 supported versions

Open
#3,369 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area-AppExtension
Dominant language
C++
Stars
4.7k
Forks
471
Avg merge
3d 13h
Merged PRs (30d)
28

Description

Describe the bug

Trying to specify your app that it can write in the registry by disabling virtualization will only work with the old available syntax even if Windows 10 supports the new one.

the new syntax, introduced in Windows 10 (2004), build 19042

<virtualization:RegistryWriteVirtualization>

    <!-- Child elements -->
    virtualization:ExcludedKeys

</virtualization:RegistryWriteVirtualization>

the old syntax that worked prior to Windows 10 (2004)

<desktop6:RegistryWriteVirtualization>disabled</desktop6:RegistryWriteVirtualization>

Running an app on Windows 10 20H2 or more recent versions will ignore the new syntax and it will start to write in the virtualized Registry. The only way it works is by using the old syntax which should no longer be supported. The old syntax also works on Windows 11.

The information is written in the documentation.

If an application includes both syntaxes for disabling file system virtualization, the old declaration will be used on pre-2004 OS versions while the new declaration will be used on 2004 and later OS versions.

This is false as the new declaration is not used.

Steps to reproduce the bug
  1. Create a WASDK packaged app
  2. Specify the needed capabilities to write in the registry using the new syntax
  3. Run the app as administrator
  4. Try to write something in the registry
  5. Check the registry using Registry Editor to see that the value is not there
  6. Change it to the old syntax
  7. Try to write in the registry again
  8. Check the registry using Registry Editor to find the value there

You can download my full repro example.

RegistryRepro.zip

Expected behavior

If it's a bug, I would expect that the new syntax should be supported on Windows 10 2004 and later, and that the information will be written in the unvirtualized Registry. If this is intended behaviour the documentation should be updated as people can spend a lot of time trying to understand what's wrong, considering the documentation says it should work.

Screenshots

No response

NuGet package version

Windows App SDK 1.2.2: 1.2.221209.1

Packaging type

Packaged (MSIX)

Windows version

Windows 10 version 22H2 (19045, 2022 Update)

IDE

Visual Studio 2022

Additional context

No response

Contributor guide

No contributing guide indexed for this repository

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.

Research direction

Start with the manifest declarations and reproduction steps in the linked RegistryRepro.zip, then compare the new virtualization syntax with the documented behavior for Windows 10 version 2004 and later. Verify the result on Windows 10 22H2 using Registry Editor. Done means the new declaration produces the expected unvirtualized registry write, or the documentation accurately explains the supported behavior.

Written by the indexing model from the issue text.

Assessment

Domain
desktop, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.