How to skip a bootstrapper or ignore fail in Windo

2019-08-15 01:03发布

问题:

I have a WiX installer and a number of bootstrappers. We recently added SQL LocalDB support and found we needed to package .Net 4.0.2 to get it to work. I am now testing on Windows 8, and find that this patch fails and isn't actually needed for this OS.

However, my installer fails because .Net 4.0.2 fails. I am trying to find a way of either skipping this patch in Windows 8 or just ignoring a fail for this patch?

I have "InstallConditions" and "ExitCodes" in my package.xml, but I don't know how to change these to achieve either:

  1. don't try to install when OS is windows 8, or
  2. try, but ignore a fail and continue to the next step

Any ideas?

回答1:

I figured this out by trial and error, and I'll put the solution here for others who might find it useful. The problem was I was using ValueGreaterThanOrEqualTo and it should have been VersionGreaterThanOrEqualTo

This will skip for Windows 8

<BypassIf Property="VersionNT" Compare="VersionGreaterThanOrEqualTo" Value="6.2"/>

This will skip for Windows 7 and 8

<BypassIf Property="VersionNT" Compare="VersionGreaterThanOrEqualTo" Value="6.1"/>