WIX: How can the registry key be changed based on the OS on which the installer is running?

windows-installer, wix

Solution

Technically speaking, you should use two different Components to install those Registry keys since they are completely different paths. Then you can Condition the Components with the VersionNT property.

Problem

I want to set registry keys in following way if OS is Vista then HKLM\MyKey1\MyValue=1 else HKLM\MyKey2\MyValue=1 I know how to set Registry keys in WIX but it seems the condition cannot be set on element.

Original source