使用 wix burn 下载 vcruntime140 [英] Web download of vcruntime140 with wix burn
问题描述
如果需要,我想使用 WiX 引导程序 burn
自动下载并安装 vcruntime140 包(Visual C++ Redistributable for Visual Studio 2015).
I want to use the WiX bootstrapper burn
to automatically download and install the vcruntime140 package (Visual C++ Redistributable for Visual Studio 2015) if it is required.
对于 .NET 框架来说,这样做非常容易:
It's trivially easy to do this for the .NET frameworks:
<Chain>
<PackageGroupRef Id="NetFx452Web"/>
...
</Chain>
但我找不到 vcruntime 包的等价物.(是因为没有,还是我只是在 Google 中输入了错误的关键字?)
but I can't find an equivalent for the vcruntime packages. (Is that because there isn't one, or am I just typing the wrong keywords into Google?)
明确一点:我不想在我的安装程序中包含该软件包.必须是网络下载.
Just to be clear: I do not want to include the package with my installer. It must be a web download.
推荐答案
redist 和 .net 一样没有 PackageGroupRef.
There is no PackageGroupRef for the redist as for .net.
但还有其他 3 个选项:
But there is 3 other options:
在你的链中添加一个 redist exe.(对你不好)
Add a redist exe in your chain. (Not good for you)
使用 redist c++ 合并模块在您的一个 msi 中.
Use a redist c++ merge module inside one of your msi's.
尝试编写自己的 网络下载就像.net一样.这是 .net Web 下载的示例.完整文件可以在 wix 的源代码中找到,名称为NetFx46.wxs"
Try to write your own web download as .net does. Here is a sample of the .net web download. The full file can be found in the source code of wix by the name "NetFx46.wxs"
<Fragment>
<PropertyRef Id="WIXNETFX4RELEASEINSTALLED" />
<Property Id="WIX_IS_NETFRAMEWORK_46_OR_LATER_INSTALLED" Secure="yes" />
<SetProperty Id="WIX_IS_NETFRAMEWORK_46_OR_LATER_INSTALLED" Value="1" After="AppSearch">
WIXNETFX4RELEASEINSTALLED >= "#$(var.NetFx46MinRelease)"
</SetProperty>
</Fragment>
<Fragment>
<util:RegistrySearchRef Id="NETFRAMEWORK45"/>
<WixVariable Id="WixMbaPrereqPackageId" Value="NetFx46Web" />
<WixVariable Id="WixMbaPrereqLicenseUrl" Value="http://go.microsoft.com/fwlink/?LinkID=558772" />
<WixVariable Id="NetFx46WebDetectCondition" Value="NETFRAMEWORK45 >= $(var.NetFx46MinRelease)" Overridable="yes" />
<WixVariable Id="NetFx46WebInstallCondition" Value="" Overridable="yes" />
<WixVariable Id="NetFx46WebPackageDirectory" Value="redist" Overridable="yes" />
<PackageGroup Id="NetFx46Web">
<ExePackage
InstallCommand="/q /norestart /ChainingPackage "[WixBundleName]" /log "[NetFx46FullLog].html""
RepairCommand="/q /norestart /repair /ChainingPackage "[WixBundleName]" /log "[NetFx46FullLog].html""
UninstallCommand="/uninstall /q /norestart /ChainingPackage "[WixBundleName]" /log "[NetFx46FullLog].html""
PerMachine="yes"
DetectCondition="!(wix.NetFx46WebDetectCondition)"
InstallCondition="!(wix.NetFx46WebInstallCondition)"
Id="NetFx46Web"
Vital="yes"
Permanent="yes"
Protocol="netfx4"
DownloadUrl="http://go.microsoft.com/fwlink/?LinkId=560371"
LogPathVariable="NetFx46FullLog"
Compressed="no"
Name="!(wix.NetFx46WebPackageDirectory)NDP46-KB3045557-x86-x64-AllOS-ENU.exe">
<RemotePayload
CertificatePublicKey="52868DFCA6E3AF2632389E6C1EE7D0468D3797D0"
CertificateThumbprint="3BDA323E552DB1FDE5F4FBEE75D6D5B2B187EEDC"
Description="Microsoft .NET Framework 4.6 Setup"
Hash="480CA134B9E3F2437DF10719D5A8C77DDEC0A4F1"
ProductName="Microsoft .NET Framework 4.6"
Size="1497400"
Version="4.6.81.0" />
</ExePackage>
</PackageGroup>
这篇关于使用 wix burn 下载 vcruntime140的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!