WIX: How can the registry key be changed based on

2019-02-10 16:15发布

问题:

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.

回答1:

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.