Alex Rivera | Logout

How do I fix WiX warning: Component 'X' has both per-user and per-machine data with an HKCU Registry KeyPath

Asked 2010-10-25T16:08:01.093
12

I'm trying to maintain some Wix code, and am getting the following warning:

warning LGHT1076 : ICE57: Component 'FILE_MY_ASSOCIATION' has both per-user and per-machine data with an HKCU Registry KeyPath.

From the following code:

<Component Id="FILE_MY_ASSOCIATION" Guid="E1DF42A5-BD00-4a80-9BE5-B66A3EF0576E" Win64="$(var.Variables_Win64)">
  <RegistryKey Root="HKCU" Key="Software\MyComany\MyProduct">
    <RegistryValue Value="" Type="string" KeyPath="yes" />
  </RegistryKey>
  <ProgId Icon="FILE_MY_FILETYPE_ICON" Id="MY_FILE_EXTENSION" Description="My Product File" >
    <Extension Id="myext" Advertise="no" >
      <Verb Id="Open" Argument="&quot;%1&quot;" TargetFile="MYUI_EXE_FILE"/>
    </Extension>
  </ProgId>
</Component>

I'm having trouble working out what's wrong or if this is a warning I really need to worry about.

  • Do I need to worry about and fix this warning? Could the code as it is currently cause problems in some circumstances?
  • Also, I'm wondering, why does the registry key use HKCU instead of HKLM. If I change it to HKLM. the warning goes away, but does this affect the behaviour of the installer?

Thanks.

wix
Edit
Report

1 Answer

11

The warning is saying that you are writing both user-specific data and system-wide data in the same component. Your registry entry is writing to HKCU which will always write to a user-specific piece of the registry. ProgId, on the other hand, writes registry entries to HKCR which could write to either HKLM or HKCU. If it does write to HKLM that is a system-wide registry space, your single component is writing to both a user specific registry hive and a system registry hive which is against the rules laid out in the ICE warning you got.

answered 2010-10-26T03:05:44.163

Your Answer