如何在 WiX 中检查 .NET framework 4.5 prerequestics [英] How can I check .NET framework 4.5 prerequestics in WiX

查看:22
本文介绍了如何在 WiX 中检查 .NET framework 4.5 prerequestics的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在继续安装之前,我想验证 .NET Framework 4.0 和 4.5 都应该安装在服务器上.因此我使用了以下代码段,但我不知道 4.5 验证,它没有列在链接 参考

I'd like to validate both .NET framework 4.0 and 4.5 should be installed at server before proceeding a installation. Hence I used the following snippet, but I don't know about 4.5 validattion, which was not listed in the link Reference

<PropertyRef Id="NETFRAMEWORK40FULL"/>
    <Condition Message='This setup requires Microsoft .NET Framework 4.0 Full package or greater needs to be installed for this installation to continue.'>
      <![CDATA[Installed OR NETFRAMEWORK40FULL]]>
    </Condition>

推荐答案

NETFRAMEWORK45 属性可以和 NETFRAMEWORK40FULL 一样使用.请注意,.NET Framework v4.5 没有客户端"或完整"框架.只有一个.所以下面的代码应该做你想做的:

The NETFRAMEWORK45 property can be used the same as the NETFRAMEWORK40FULL. Note there is no "client" or "full" framework for The .NET Framework v4.5. There is just one. So the following code should do what you want:

<PropertyRef Id="NETFRAMEWORK40FULL"/>
<PropertyRef Id="NETFRAMEWORK45"/>

<Condition Message='This setup requires Microsoft .NET Framework 4.0 Full package or greater needs to be installed for this installation to continue.'>
  <![CDATA[Installed OR NETFRAMEWORK40FULL]]>
</Condition>
<Condition Message='This setup requires Microsoft .NET Framework 4.5 package or greater needs to be installed for this installation to continue.'>
  <![CDATA[Installed OR NETFRAMEWORK45]]>
</Condition>

请注意,.NET Framework v4.5 是 .NET Framework 4.0 的就地升级,因此检查两者可能会让您陷入永远无法满足这两个条件的境地.您可能只想检查是否安装了 .NET Framework v4.0 .NET Framework v4.5.这种情况看起来更像是:

Note that .NET Framework v4.5 is an in place upgrade of .NET Framework 4.0 so checking for both could get you into a situation where you'll never satisfy both conditions. You might want to just check that .NET Framework v4.0 or .NET Framework v4.5 is installed. That condition would look more like:

<Condition Message='This setup requires Microsoft .NET Framework 4.0 Full or 4.5 package or greater needs to be installed for this installation to continue.'>
  <![CDATA[Installed OR NETFRAMEWORK40FULL OR NETFRAMEWORK45]]>
</Condition>

这篇关于如何在 WiX 中检查 .NET framework 4.5 prerequestics的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆