开发者

x64 wix installer on XP doesn't write the registry values under Wow6432Node

In case of installation on x64 I need to write two registry values:

1) <RegistryValue Root="HKLM" Key="SOFTWARE\Microsoft\Exchange" Name="Info" Type="string" Action="write" Value="8">

2) <RegistryValue Root="HKLM" Key="SOFTWARE\Wow6432Node\Microsoft\Exchange" Name="Info" Type="string" Action="write" Value="9"/>

I'm using <?if $(var.PlatformName) = x64 ?> to check if I'm on x64.

On win 7 64-bit it works fine, but on xp 64-bit it writes the value of the second key ("9") to the place of the first key (I guess it overwrites the first key). Any idea why? or how shou开发者_StackOverflow社区ld I solve it?


The correct way to do this in an .msi is to have these registry values in two separate components. Both would reference the key SOFTWARE\Microsoft\Exchange but one would be a 32-bit component and the other would be a 64-bit component. Note that a package which includes 64-bit components must have a 64-bit Template Summary value, and thus cannot be installed on a 32-bit machine.


I think that first you need to understand that windows writes registry values on SOFTWARE\Wow6432Node due to registry reflection (this happens when an 32 bit installer is trying to write registry values to SOFTWARE\ or any key that supports registry reflection).

Registry reflection can be disabled for Registry element when you set the win64 attribute to true on it's parent Component.

But, as a best practice it’s recommended to create one MSI for x64 environments and one MSI for x86 environments.

If you want to know more about registry reflection you can check the next links.

  • Registry Reflection
  • Registry Reflection in Windows
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜