.net - 如何在 WiX 中检测 .NET 3.5?

标签 .net wix version

我正在尝试使用 WiX 检测安装的 .NET 版本。我试过:

<Condition Message='This setup requires the .NET Framework 3.5 or higher.'>
  <![CDATA[MsiNetAssemblySupport >= "3.5.0.0"]]>
</Condition>

但这行不通,因为 MsiNetAssemblySupport 属性会检查 fusion.dll 的版本,该版本在 .NET 3.0 或 3.5 中并未从 2.0 版本更新。

检查系统目录中是否存在 .NET 库是否可行?我该如何使用 WiX 来做到这一点?或者有什么方法可以使用注册表来做到这一点?

(我意识到有一个 WiX 用户电子邮件列表,但这就是我应该做的——我不喜欢 20 世纪 80 年代的技术,我喜欢可以轻松搜索的东西。)

最佳答案

Visual Studio -> WiX 项目 -> 添加引用 -> WixNetFxExtension.dll,然后:

<PropertyRef Id="NETFRAMEWORK35" />
<Condition Message="This setup requires the .NET Framework 3.5 to be installed.">
  Installed OR NETFRAMEWORK35
</Condition>

Full details ,包括所有.NET version properties在扩展中可用。还要考虑条件消息是否应该是 localized .

关于.net - 如何在 WiX 中检测 .NET 3.5?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/682805/

相关文章:

react-native - 找不到“React/RCTComponentEvent.h”文件

.net - 我应该使用 Web API 还是 Web 方法?

java - 检测两个 GPS 坐标边界框重叠

.net - .Net 中的接口(interface)和 JSON 序列化

.net - 在 MAC OS 上安装 WIX 工具集并创建 MSI

Wix 安装程序 - "DLL required for this install to complete"错误

c# - 将同步代码包装为异步任务的最佳方式是什么?

powershell - 如何创建 Windows 安装程序

php - 使用哪个tinyMCE包?

amazon-web-services - 在整个 s3 存储桶上回滚版本