Lluis Sanchez
Lluis Sanchez

Reputation: 1737

RegistrySearch not working in Wix project

I'm trying to add a check in my installer, so that if a specific registry key is not present it has to fail. That's roughly what I'm doing:

<Property Id="REGVALUE">
  <RegistrySearch Id="regval" Root="HKLM" Key="SOFTWARE\Foo" Type="raw"/>
</Property>
<Condition Message="Valid Foo value not present. Found [REGVALUE]">
  <![CDATA[REGVALUE = "Bar" OR REMOVE ~= "ALL"]]>
</Condition>

The problem I'm having is that this condition always fail. I tried querying different registry keys and no matter what I try, I always get a blank value. In the install log I can't see any access to the registry, nor any error related to the registry. So I'm a bit lost. Am I missing something obvious?

Upvotes: 1

Views: 1160

Answers (1)

Lluis Sanchez
Lluis Sanchez

Reputation: 1737

Found the problem. The issue was an incorrect ordering of actions in the installer ui sequence, which caused the conditions to be checked before running the registry queries.

Upvotes: 1

Related Questions