使用Wix,如何为Windows 7/8安装Dot net framework 4.5以及为XP和Vista安装Dot net 4.0?

8

我想在尽可能多的地方安装Dot net framework 4.5作为我的应用程序的前提条件。由于dot net framework 4.5的最低操作系统要求是Windows Vista SP2,因此我想在Windows Vista SP2及以上的操作系统上安装dot net framework 4.5,在Windows Vista SP2以下(即Windows Xp机器)的操作系统上安装dot net framework 4.0。我正在使用以下代码。

<PropertyRef Id="NETFRAMEWORK40FULL" />
<PropertyRef Id="NETFRAMEWORK45" />
<Condition Message="This application requires .NET Framework 4.0 Full or .NETFramework 4.5. Please install the .NET Framework then run this installer again.">
  <![CDATA[Installed OR NETFRAMEWORK40FULL OR NETFRAMEWORK45]]>
</Condition>

<Chain>
  <PackageGroupRef Id="NetFx40Web" />
  <PackageGroupRef Id="NetFx45Web" />
  <PackageGroupRef Id="SqlServer2008R2" />
</Chain>

但是它正在出现错误,如下所示:
The Windows Installer XML variable 'WixMbaPrereqPackageId' is declared in morethan one location.
The Windows Installer XML variable 'WixMbaPrereqLicenseUrl' is declared in more than one location.

我认为使用WixNetFxExtension库无法同时安装DotnetFramework4和DotnetFramework 4.5。那么现在我有什么选择来实现它呢?我是否需要手动编写PackageGroup以安装Dotnet Framework 4.5并检查操作系统版本是否兼容安装它?
1个回答

1

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接