How can I check .NET framework 4.5 prerequestics in WiX

前端 未结 1 1336
既然无缘
既然无缘 2021-01-01 16:14

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 a

相关标签:
1条回答
  • 2021-01-01 16:42

    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>
    

    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>
    
    0 讨论(0)
提交回复
热议问题