我是 Wix/Burn 的新手,正在尝试了解一些基础知识。我有一个简单的 Bootstrap ,它使用以下链安装所需的 .net 4.0 框架:
<Chain>
<PackageGroupRef Id="NetFx40ClientRedist"/>
<MsiPackage Id="MyApp" SourceFile="$(var.WixInstaller.TargetPath)" DisplayInternalUI="yes" />
</Chain>
由 How To: Install the .NET Framework Using Burn 推荐. 该应用程序可能在无法访问 Web 的服务器上使用,因此从本地可再发行组件安装 .net 非常重要。 Bootstrap 似乎运行良好,并按预期安装了框架。不过,setup.exe 文件的大小与应用程序的大小大致相同(< 5 MB),因此我必须假设框架在安装过程中仍在下载。
问题
那么,WixNetfxExtension 包中的“NetFx40ClientWeb”和“NetFx40ClientRedist”有什么区别?
如何在 boostrapper 中包含一个本地可再发行组件,这样就不需要下载了?
编辑:
我相信我找到了答案 here :
WiXNetFxExtension will check a sub-directory called "redist" where your bundle is for the package then download it if it doesn't exist at that path e.g. "redist\dotNetFx40_Client_setup.exe". This is standard Burn behaviour.
最佳答案
两者的区别是:
1. clientWeb - 意味着您必须连接到网络,然后将下载 .net 4.0 并将其安装在机器上。
2.clientRedist - 表示可再发行 - 表示不需要任何互联网连接的完整软件包,您可以将其安装在任何计算机上。
如果您使用可再发行包,您应该没问题 - 这是 .Net 4.5 的示例,它与 .Net 4.0 相同,唯一不同的是可再发行包。
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension" xmlns:bal="http://schemas.microsoft.com/wix/BalExtension" xmlns:netfx="http://schemas.microsoft.com/wix/NetFxExtension">
<Bundle Name="Prog" Version="1.0.0.0" Manufacturer="my Corporation" UpgradeCode="*">
<Chain>
<!-- TODO: Define the list of chained packages. -->
<PackageGroupRef Id="Netfx45FullPackage" />
</Chain>
</Bundle>
<Fragment>
<PackageGroup Id="Netfx45FullPackage">
<ExePackage Id="Netfx45Xxx" Cache="no" Compressed="no" PerMachine="yes" Permanent="yes" Vital="no" InstallCommand="/q" SourceFile="..\SetupProject\dotnetfx45_full_x86_x64.exe" DetectCondition="(Netfx4FullVersion="4.5.50709") AND (NOT VersionNT64 OR (Netfx4x64FullVersion="4.5.50709"))" InstallCondition="(VersionNT >= v6.0 OR VersionNT64 >= v6.0) AND (NOT (Netfx4FullVersion="4.5.50709" OR Netfx4x64FullVersion="4.5.50709"))" />
<MsiPackage Id="MyProg" Cache="no" Compressed="no" DisplayInternalUI="yes" Vital="yes" SourceFile="$(var.installerPath)\MyProgCore.msi" />
</PackageGroup>
</Fragment>
</Wix>
关于c# - 使用 Wix Bootstrapper (Burn) 安装 .NET 可再发行组件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20099486/