wix - 如何使用 Wix 3.11 检查 .net framework 4.7.1

标签 wix wix3

我正在尝试通过条件检查带有 Wix 3.11 的 .net 版本。这在 4.5 之前都可以正常工作,如下所示:

<PropertyRef Id="NETFRAMEWORK45" />
  <Condition Message="This application requires .NET Framework 4.5. Please install the .NET Framework then run this installer again.">
    <![CDATA[Installed OR NETFRAMEWORK45]]>
  </Condition>

检查任何高于 4.5 的东西似乎是不可能的 - 至少不能使用这种机制。我怎样才能做到这一点?

最佳答案

该方法(PropertyRef)是语法糖。 NetFxExtension 预处理器在编译时注入(inject)实现。 WiX 目前落后。您正在寻找的实现将类似于:

<PropertyRef Id="NETFRAMEWORK45" />
<Condition Message="This application requires .NET Framework 4.7.1. Please install the .NET Framework then run this installer again."><![CDATA[Installed OR NETFRAMEWORK45>=#461308]]>
</Condition>

https://github.com/wixtoolset/issues/issues/5575

更新(hot33331):在数字 461308 之前添加了一个 #。没有它,它对我不起作用。

关于wix - 如何使用 Wix 3.11 检查 .net framework 4.7.1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49778581/

相关文章:

.net - 如果检测到相同版本,则升级 Bootstrap 包

Wix XML 错误 - 当 Component 元素嵌套在 Directory 元素下时,无法指定 Component/@Directory 属性

windows - Wix - 在安装结束时运行一个 exe(带参数),当前 MSI 没有安装它

wix - 在 WiX 3.7 中结合绝对路径和相对路径

wix - Wix:不允许安装组件:因为存在具有更高版本 key 文件的相同组件

wix - 为不同片段中的 WiX 文件添加快捷方式

.net - 是否可以安装或运行 dotnetredist.exe(或任何任意 EXE)作为 .MSI 的一部分?

.net - WiX:如何注册应用程序以在 Windows 启动时启动?

wix - 在wix中控制快捷方式顺序

WIX 错误文档元素名称 'Wix' 无效