tags:

views:

23

answers:

0

Hi,

I am new to WIX. What I am trying to do: Windows registry maintains entries under Uninstall for my product. Now, when I upgrade to a later version it creates another entry there. So in upgraded version there are two entries under the Uninstall key. Things are fine till now. When I need to downgrade from upgraded version it should remove the new entry under the install and not the older one. And suppose I remove the product completely from the upgraded version then it should remove both of the entries.

How I am trying to achieve the above: I am trying to use conditional component installation but it's not working. Like this:

<Component Id="RemoveOldKey" Guid="MY_GUID" Transitive="yes">

<Condition>DOWNGRADEFLAG=0</Condition>

<CreateFolder/>

<RemoveRegistryKey Action="removeOnUninstall" Id="RemoveKey" Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\[\{][PREINSTALLED_PRODUCTID][\}]" Root="HKLM" />

</Component>

If the DOWNGRADEFLAG equals 1 then I don't want this component to remove the older registry entry. Else I want it to remove the registry entry. But the above code is not working.

Thanks in advance. Thanks for reading.