tags:

views:

23

answers:

1

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?

A: 

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.

Lluis Sanchez
Make sure you fix it in the Execute sequence also or otherwise it could fail during a silent install since the UI sequence isn't executed.
Christopher Painter