PlTaylor
PlTaylor

Reputation: 7515

RegistrySearch in WiX is not returning true for a value that is in the registry

I have the following commands in my WiX Bundle:

    <Variable Name="InstanceName" Value= "SQLExpress" />

    <util:RegistrySearch Id="SqlInstanceKeyFound" Root="HKLM"
        Key="SOFTWARE\Microsoft\Microsoft SQL Server\Instance Names\SQL"
        Value ="[InstanceName]" Result="exists" Variable="SqlInstanceKeyFound" />

I can see the SQL Server Express instance in Regedit on the machine, but my log file is reporting this back to me:

Registry key not found. Key = 'SOFTWARE\Microsoft\Microsoft SQL Server\Instance Names\SQL'
Setting numeric variable 'SqlInstanceKeyFound' to value 0
Condition 'SqlInstanceKeyFound' evaluates to false.

Why is this not returning true when I can see the value in Regedit? To add a little more information, this is supposed to be a check for an SQL Express 2014 instance.

Upvotes: 0

Views: 1728

Answers (2)

Hille
Hille

Reputation: 4196

I'm irritated because of your WiX syntax. Why are you prefixing RegistrySearch with a util namespace?

Also, I'm not able to find s.th. in the lines of Result and Variable in the WiX documentation? Shouldn't the registry search be a child of a Property element?

Cf. the answer in Property value set in WiX based on registry key value for an example.

Upvotes: -1

Bob Arnson
Bob Arnson

Reputation: 21886

<util:RegistrySearch> defaults to searching the 32-bit registry. To search the 64-bit registry, set Win64="yes".

Upvotes: 3

Related Questions