如何在 WiX 中检测 .NET 3.5? [英] How can I detect .NET 3.5 in WiX?

查看:29
本文介绍了如何在 WiX 中检测 .NET 3.5?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I'm trying to detect which version .NET is installed using WiX. I've tried:

<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 版更新的.

But that won't work, because the MsiNetAssemblySupport property checks the version of fusion.dll, which wasn't updated from version 2.0 in .NET 3.0 or 3.5.

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

Is it feasible to check for the presence of the .NET libraries in the system directory? How would I do that using WiX? Or is there some way to do that using the registry?

(我知道有一个 WiX 用户电子邮件列表,但这是应该的——我不喜欢 1980 年代的技术,我喜欢可以轻松搜索的东西.)

(I realize that there's a WiX user email list, but this is the Oughts-- I don't like 1980s technology, I like stuff I can easily search.)

推荐答案

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

Visual Studio -> WiX project -> Add Reference -> WixNetFxExtension.dll and then:

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

完整详情,包括所有.NET 版本属性 在扩展中可用.还要考虑条件消息是否应该本地化.

Full details, including all .NET version properties available in the extension. Also consider whether condition message should be localized.

这篇关于如何在 WiX 中检测 .NET 3.5?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆