Changing VirtualStore (UAC Virtualized) registry entries with PowerShell

Hey guys, hope you’re doing great.

I have a tricky one that I’ve been struggling with for several days now. I’ve done about as much Googling and reading as I think is humanly possible at this point :slight_smile:

I’m automating configuration of my software with PowerShell and am currently working on changing various settings on an older piece of 32-bit audio software which predates Vista.

It works perfectly in Windows 10 but of course uses registry virtualization to store data when run as non-admin.

Typically, the setting would be placed in: HKLM:\SOFTWARE\WOW6432Node\Voxengo\Voxengo Pristine Space Light VST

With virtualisation, the setting is placed in: HKCU:\Software\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\Voxengo\Voxengo Pristine Space Light VST

Creating the entry directly in the destination works but the software simply doesn’t read the value as it should:

e.g.

New-Item `
    -Path 'HKCU:\Software\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\Voxengo\Voxengo Pristine Space Light VST' `
    -Force

New-ItemProperty `
    -Path 'HKCU:\Software\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\Voxengo\Voxengo Pristine Space Light VST' `
    -Name BlockSize `
    -Type String `
    -Value '1'

The software simply doesn’t read this value and this is also seen in Process Monitor:

https://1drv.ms/u/s!AobnWXPnBeTB4WHdbNg7iifQEsCc

By comparison, this is what it looks like when I change the setting via the software itself and it is properly saved in the registry:

https://1drv.ms/u/s!AobnWXPnBeTB4WBLp-fE9o-Hs1ZP

Based on my research, writing directly to VirtualStore is not the right way to go, let alone writing to WOW6432Node, but I have found very little information on how to simulate both a 32-bit and UAC virtualized environment in 64-bit PowerShell while running as admin.

The closest solution I have is…

  1. Start PowerShell (x86) with regular user rights (not admin)
  2. Go to Task Manager and find the process in the Details tab
  3. Enable UAC Virtualization via right click context menu
  4. Run the following code
New-ItemProperty `
    -Path 'HKLM:\SOFTWARE\Voxengo\Voxengo Pristine Space Light VST' `
    -Name BlockSize `
    -Type String `
    -Value '1'
I haven't found any way to automate this properly at this stage and am left rather confused about how to move forward with this particular task.

Any help at all would be greatly greatly appreciated!!!

Huge thanks in advance
Fotis

This is not a PowerShell code issue, but a software specific one. Installer in general can do many things and unless you monitor all it is doing, during the install, regkeys only, may not be the end all be all of hooking it does to find it’s settings.

So, just like other gold imaging an OS for distribution efforts.

Build out your pristine OS.
Install all needed software
Make any other wanted / needed configuration.
sysprep the host.
Burn the image.

Or if it is just this software.

Fire up SysInternal, procmon and region.
Install the software and make whatever settings you choose.
Export all settings it created, including the registry
When you nee to rebuild, reimport the exported settings.