Search code examples
visual-studio-2015wixwindows-installerwix3.10

Do we need to add RegistrySearch element in WiX 3.11 installer if checking the existence of .NET Framework version


In the older versions of WiX I've seen the following xml fragment for checking the existence of .NET Framework 4.0 and aborting the installation if the .NET Framework is not present on the operation system. But in this official documentation on How To: Check for .NET Framework Versions has not mentioned any RegistrySearch element. Question: Is RegistrySearch element still needs to be included here or it's not needed in the latest version 3.11 of WiX?

<Property Id="VSTORUNTIMEREDIST">
  <RegistrySearch
    Id="VSTORuntimeRedist"
    Root="HKLM"
    Key="SOFTWARE\Microsoft\VSTO Runtime Setup\v4R"
    Name="Version"
    Type="raw" />
</Property>
<Condition
  Message="The Visual Studio 2010 Tools for Office Runtime is not installed. Please download and install from http://www.microsoft.com/en-us/download/details.aspx?id=20479.">
  <![CDATA[Installed OR VSTORUNTIMEREDIST>="10.0.30319"]]>
</Condition>

<PropertyRef Id="NETFRAMEWORK40FULL"/>
<Condition Message="This application requires .NET Framework 4.0.">
  <![CDATA[Installed OR NETFRAMEWORK40FULL]]>
</Condition>

Solution

  • In you code RegistrySearch relates to The Visual Studio 2010 Tools for Office Runtime and not to .NET Framework. It is not needed for testing the presence of .NET.