How to check for Crystal Reports for .NET Framework 4.0 installation in WiX

I am creating a WiX Installer and need to check if a specific version of Crystal Reports for .NET Framework 4.0 (v. 13.0.3) is installed.

I have found two ways that both seem to work (on my W7 machine), but am not sure if one or the other has any downfalls such as working on XP etc.

Option 1 (My concern with this option is if a later version is installed with a different product code, this condition will not pass):

<Property Id="CRVSINSTALLED">
  <RegistrySearch Id="CRVSInstalledSearch" Root="HKLM" Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\{AAD476D7-FC64-40BC-85EA-0C1FD98D8375}" Name="InstallDate" Type="raw" />
</Property>
<Condition Message="You don't have Crystal Reports for Visual Studio 2010 (v. 13.0.3)  installed.">
  <![CDATA[CRVSINSTALLED]]>
</Condition>

Option 2:

<Property Id="CRVSINSTALLED2">
  <RegistrySearch Id="CRVSInstalledSearch2" Root="HKLM" Key="Software\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Crystal Reports" Name="CRRuntime32Version" Type="raw" />
</Property>
<Condition Message="You don't have Crystal Reports for Visual Studio 2010 (v. 13.0.3)  installed 2.">
  <![CDATA[CRVSINSTALLED2 >= "13.0.3"]]>
</Condition>

Answers


I like option2 because I personally don't like depending on registry keys in HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall. A 3rd option is to check the version number of a file during installation.


Need Your Help

Having trouble passing Javascript array of objects to MVC3 controller, works with WCF service, any ideas?

c# javascript jquery asp.net-mvc-3

I am having problems passing a javascript array to an MVC3 controller, not sure what I am doing wrong but this code does work with standard WCF service.