views:

558

answers:

1

I want to determine if a Registry key exists in Wix. I cannot make any assumptions about value names in that key, but at least one exists. Default value is not set. Is it possible to check if the key exists (and optionally, if it has any values) without using custom actions?

+2  A: 

Have a look at the RegistrySearch

Sample of use:

 <Property Id="MYRegSearch" Value="AVaLue" Secure="yes">
  <RegistrySearch Id="RegSearch" Root="HKLM" Key="Software\!(wix.Manufacturer)\!(wix.ShortProduct)" Name="Values" Type="raw"/>
 </Property>
CheGueVerra
I know about RegistrySearch, but I don't know how to use it to check if a key exists
Juozas Kontvainis
I would put a flag value to the property like -1, then you can check in a condition that the property is different than -1
CheGueVerra
As default key value does not have a value set, Property value doesn't get changed. It seems I will need custom action to test it.
Juozas Kontvainis
If the key exists the value will change, otherwise it will stay the same.
CheGueVerra