1
votes

I'm new to WiX. I need to change the following registry-setting element:

    <Component Id="BrowserEmulation" Directory="ApplicationProgramsFolder" Guid="*">
      <RegistryValue Root="HKCU" Key="Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION" Name="MY_REG_ENTRY" Value="11000" Type="integer" KeyPath="yes"/>
    </Component>

So that the registry entry gets installed under HKEY_LOCAL_MACHINE instead of HKEY_CURRENT_USER. I tried changing the Root value and the Key value:

    <Component Id="BrowserEmulation" Directory="ApplicationProgramsFolder" Guid="*">
      <RegistryValue Root="HKLM" Key="SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION" Name="MY_REG_ENTRY" Value="11000" Type="integer" KeyPath="yes"/>
    </Component>

I also tried removing the KeyPath component. But when I try to build the .msi I get the following error:

error LGHT0204: ICE38: Component Browser Emulation installs to user profile. It's KeyPath registry key must fall under HKCU

I looked at the WiX docs that describe Component KeyPaths but wasn't able to figure out how to get around this.

1
Would be nice with some more context - as in seeing some more of the source. IEBrowser Emulation looks like a different ID than the one you show in your source. Is there another, similar component in there? Try removing all attributes that are not needed and compile again. Also be aware of the issue with 32-bit and 64-bit registry hives in HKLM: HKLM\SOFTWARE\WOW6432Node etc...Stein Åsmul

1 Answers

2
votes

Directory: Looks like you need to take out the Directory attribute from your component. Maybe try something like this:

<Component Feature="MainApplication">
  <RegistryValue Root="HKLM" Key="SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION" Name="MY_REG_ENTRY" Value="11000" Type="integer" KeyPath="yes"/>
</Component>

Bitness: Also be aware of the issue with 32-bit and 64-bit registry hives in HKLM: HKLM\SOFTWARE\WOW6432Node etc... Please see this answer for more details. I have inlined the most important part:

Registry:

  • 64-Bit: HKEY_LOCAL_MACHINE\SOFTWARE
  • 32-Bit: HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node

64-Bit: Maybe what you need is to mark your component as a 64-bit component? In order to write under HKEY_LOCAL_MACHINE\SOFTWARE?:

<Component Feature="MainApplication" Win64="yes">
   <RegistryValue Root="HKLM" Key="SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION" Name="MY_REG_ENTRY" Value="11000" Type="integer" KeyPath="yes"/>
</Component>