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?


- 输入按键事件处理程序 2022-01-01
- C# 中多线程网络服务器的模式 2022-01-01
- 良好实践:如何重用 .csproj 和 .sln 文件来为 CI 创建 2022-01-01
- MoreLinq maxBy vs LINQ max + where 2022-01-01
- 如何用自己压缩一个 IEnumerable 2022-01-01
- 在哪里可以找到使用中的C#/XML文档注释的好例子? 2022-01-01
- 带有服务/守护程序应用程序的 Microsoft Graph CSharp SDK 和 OneDrive for Business - 配额方面返回 null 2022-01-01
- C#MongoDB使用Builders查找派生对象 2022-09-04
- Web Api 中的 Swagger .netcore 3.1,使用 swagger UI 设置日期时间格式 2022-01-01
- WebMatrix WebSecurity PasswordSalt 2022-01-01