views:

118

answers:

1

I've built an installer with WIX and have packaged it with the .NET 4.0 framework using the GenerateBootstrapper task. Now .NET 4.0 cannot be installed on XP SP2, but it appears to have no precondition check for this so its installer fails halfway through.

I'd like to add my own check to make sure the OS that the entire package is being installed on is supported by the .NET 4.0 framework. Is there a way to embed an OS/Service Pack check in the bootstrapper when you use GenerateBootstrapper? If not, how else can I accomplish this?

+1  A: 

You could add a condition to the bootstrapper package definition file so that the bootstrapper will check for the Windows version. The description file is located at

C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bootstrapper\
    Packages\DotNetFX40\Product.xml

on a 64-bit Windows system or at

C:\Program Files\Microsoft SDKs\Windows\v7.0A\Bootstrapper\
    Packages\DotNetFX40\Product.xml

on a 32-bit Windows system. The package.xml already contains such a check, see the line

<!--  Block install on less than Windows XP SP2 --> 
<FailIf Property="VersionNT" Compare="VersionLessThan" 
        Value="5.1.2" String="InvalidPlatformWinNT" /> 

I couldn't find the relevant documentation, but it looks as if the third number of the VersionNT value is the service pack level, so probably changing the condition to check for a value of "5.1.3" will do the job.

0xA3
We decided internally to remove the framework from the installer and let the client install it separately (to separate MS's foibles from our own). Pretty sure your answer would have worked in my situation, so you get the biscuit. Thanks!
roufamatic