Juozas Kontvainis
Juozas Kontvainis

Reputation: 9597

How to determine if a registry key exists in Wix

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?

Upvotes: 3

Views: 6011

Answers (1)

CheGueVerra
CheGueVerra

Reputation: 7963

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>

Upvotes: 6

Related Questions