WIX: GenerateBootStrapper conditions?

倾然丶 夕夏残阳落幕 提交于 2019-12-23 22:24:07

问题


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:


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.



来源:https://stackoverflow.com/questions/3453903/wix-generatebootstrapper-conditions

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!