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?
基础教程推荐
- JSON.NET 中基于属性的类型解析 2022-01-01
- 经典 Asp 中的 ResolveUrl/Url.Content 等效项 2022-01-01
- 将事件 TextChanged 分配给表单中的所有文本框 2022-01-01
- 错误“此流不支持搜索操作"在 C# 中 2022-01-01
- 从 VS 2017 .NET Core 项目的发布目录中排除文件 2022-01-01
- 全局 ASAX - 获取服务器名称 2022-01-01
- 首先创建代码,多对多,关联表中的附加字段 2022-01-01
- 是否可以在 asp classic 和 asp.net 之间共享会话状态 2022-01-01
- 如何动态获取文本框中datagridview列的总和 2022-01-01
- 在 VS2010 中的 Post Build 事件中将 bin 文件复制到物 2022-01-01
