How can I detect .NET 3.5 in WiX?(如何在 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?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何在 WiX 中检测 .NET 3.5?
基础教程推荐
- 如何使用 .Net 检查 Active Directory 服务器是否已启动并正在运行? 2022-01-01
- Azure Functions:CosmosDBTrigger 未在 Visual Studio 中触发 2022-01-01
- 禁止输入少量字符,例如'<'、'&a 2022-01-01
- .NET SerialPort DataReceived 事件未触发 2022-01-01
- C# 从 List<List<int>> 中删除重 2022-01-01
- Moq It.Is<>不匹配 2022-01-01
- 当值可以是对象或空数组时反序列化 JSON 2022-01-01
- 如果有人提交恶意软件Nuget包怎么办? 2022-01-01
- WPF 模态进度窗口 2022-01-01
- 我应该在后面的代码中直接使用 Linq To SQL 还是使 2022-01-01
