但这行不通,因为 MsiNetAssemblySupport 属性会检查 fusion.dll 的版-6ren">
gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-03 02:19:48 24 4
gpt4 key购买 nike

我正在尝试使用 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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com