tags:

views:

32

answers:

3

Hi,

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.

+1  A: 

It sounds like the compiler is alerting you to behavior which may not be what you want: if you register a file association for the user only, other users will not see that association. That's an unusual behavior for an application. So, it depends on your requirements: do you want the app registered to handle all documents of that type for all users, or only the installing user?

Stabledog
Hmm. I probably want the app registered to handle all documents of that type for all users. Can you tell me what it will do as it is written currently?
Scott Langham
Maybe you're saying the fragment as it is will register the file association only for the installing user.
Scott Langham
+3  A: 

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.

heavyd
Interestring. So ProgId can go to per user or per machine hives. I wonder, does the presence of RegistryKey entry do anything to force the ProgId to go to HKCU instead of HKLM?
Scott Langham
No, the [KHCR](http://msdn.microsoft.com/en-us/library/ms724475%28VS.85%29.aspx) link explains the rules for when it goes to HKCU vs HKLM.
heavyd
+1  A: 

See if this can help.

Yan Sklyarenko