Actually" /> Actually" /> Actually"/>

How does RegistrySearchRef works without providing a key?

58 views Asked by At

I'm new to WixToolsets and I'm trying to understand the following line in one of our wxs files:

<util:RegistrySearchRef Id="NETFRAMEWORK45"/>

Actually I thought that the element util:RegistrySearchRef does a registry search, but I don't get how Wix knows where to look inside the regsitry, because there's no key or anything else provided in this element. Are there some predefined RegistrySearchRefs where "NETFRAMEWORK45" belongs to? Because I couldn't find anything about that in the documentation. "NETFRAMEWORK45" is mentioned there as a property, but can you use such a property as a RegistrySearchRef Id?

1

There are 1 answers

0
Rob Mensching On BEST ANSWER

Elements that end in Ref are "references" to elements of the same name with matching Id attributes. That means there is a RegistrySearch in the util's namespace with the Id='NETFRAMEWORK45'.

It turns out that util:RegistrySearch exists in the NETFX extension that is provided with the WiX Toolset. All the complexity of finding the .NET Framework v4.5 registry key is implemented for you there. The WiX Toolset is open source, so you can search the source code and see how it is implemented... if you desire.

To test: if you remove the reference to the NETFX extension from your build, you'll get an error saying that the registry search definition could not be found.