2

我正在创建一个 WiX 安装程序,需要检查是否安装了特定版本的 Crystal Reports for .NET Framework 4.0 (v. 13.0.3)。

我发现了两种似乎都可以工作的方法(在我的 W7 机器上),但不确定其中一种是否有任何缺点,例如在 XP 上工作等。

选项 1(我对此选项的担忧是,如果安装了具有不同产品代码的更高版本,则此条件不会通过):

<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>

选项 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>
4

1 回答 1

3

我喜欢 option2,因为我个人不喜欢依赖HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall中的注册表项。第三种选择是在安装过程中检查文件的版本号

于 2012-07-13T18:23:20.293 回答