[wix-users] Using RemoveRegistryValue to remove entry in HKCU

Hoover, Jacob Jacob.Hoover at greenheck.com
Thu Dec 3 11:08:54 PST 2015

Just a guess, but I don't think RemoveRegistryValue is valid for a KeyPath.  Either move it to a component with a keypath (ex your main exe), or create a Reg key in this component to indicate you've removed the other key.

-----Original Message-----
From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On Behalf Of Chris Moxon
Sent: Thursday, December 03, 2015 10:38 AM
To: wix-users at lists.wixtoolset.org
Subject: [wix-users] Using RemoveRegistryValue to remove entry in HKCU


The current version of our app requires the Windows 7 compatability flag to be set "on the icon" (well really in the registry) for it to work.  Very early versions of our app, required the user to set this manually after they'd installed the app ... but apparently that was too difficult for some users (?!) so later versions of our installer did it for them.  Now we have produced a version of our app, that no longer needs this set (in fact if it is set, then other things stop working) and so have removed the setting of this in the new version of the installer.  So installing the new version removes the reg setting and all is well ....

But if the users upgrade from our first release (where they had to set it manually) to the new release, then the manual settings will remain (because they didn't go via the intermediate release that would set it).  So I thought I'd use the RemoveRegistryValue element of WiX to get rid of the settings under HKCU (if they exist), but am running into some issues building the installer ( which btw is set to perMachine ):

<Component Id="CMP_Removal_Manual_Win7Compat_MyApp"

  <RemoveRegistryValue Id="ID_Removal_Manual_Win7Compat_MyApp"
                       Key="SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers"

When I try and build the installer; I get:

Error 1    ICE38: Component CMP_Removal_Manual_Win7Compat_MyApp installs to user profile. It must use a registry key under HKCU as its KeyPath, not a file.

Slightly confused as it mentions a file in the error, but no files are been delt with here, just registry settings; also I tried adding KeyPath to the RemoveRegistryValue part, but that's an invalid entry for that "command".

So can someone please tell me how I can remove the reg settings under HKCU when our installer is built as perMachine ?



If you've received this email by mistake, we're sorry for bothering you. It may contain information that's confidential, so please delete it without sharing it. And if you let us know, we can try to stop it from happening again. Thank you.

We may monitor any emails sent or received by us, or on our behalf. If we do, this will be in line with relevant law and our own policies.

Eque2 Limited. Registered in England at Freetrade Exchange, 37 Peter Street, Manchester, M2 5GB. Registered number 08179642.

WiX Toolset Users Mailing List provided by FireGiant http://www.firegiant.com/

More information about the wix-users mailing list