I have a 'legacy' XP application which writes files in the [ProgramFiles]\[Application] folder, and writes registry keys in the HKLM\Software\[Application] path. When running the application in Windows Vista or Windows 7, the files and registry entries are written in the Virtual Store instead. That's fine; it doesn't break anything, yet.
Now, we've re-written the application in .NET. It only reads and writes files in "safe," user-scoped locations, and we use an application manifest with requestedExecutionLevel
specified, in order to disable registry virtualization.
When users upgrade to the latest version, we would like to maintain compatibility with our old application, by importing settings from the previously-virtualized files and registry settings.
So, the question: Is there a way to access the files and registry keys in the Virtual Store from an application that has requestedExecutionLevel
specified in its manifest?
I supposed I've left this question open long enough. Here are my findings.
There does not appear to be any way to access both the Virtual Store and the 'real' registry and file-system from the same process. The Virtual Store is applied automatically to Windows applications which do not specify the requestedExecutionLevel
, and which are not launched "As Admin."
The answer, then, appears to be a specialized "migration" application. This application will not specify the requestedExecutionLevel
, thereby guaranteeing that the application will be placed into the "Virtual Store," when launched without administrative privileges. The application operates in 2-stages:
This application would ideally be somewhat generic, accepting any user-specified registry keys and files as input arguments during launch.