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
2009-09-17 15:16:06
I know about RegistrySearch, but I don't know how to use it to check if a key exists
Juozas Kontvainis
2009-09-17 15:43:34
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
2009-09-17 17:11:58
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
2009-09-18 07:51:30
If the key exists the value will change, otherwise it will stay the same.
CheGueVerra
2009-09-18 17:27:45