问题
I've been looking to make my bootstrapper work with installing .NET 4.0 and my own application. I reviewed several blogs and tutorials, but I can't get it to work.
I read in Stack Overflow question Initiate / call bootstrapper in WiX that you need to invoke both in the bootstrapper. My bootstrapper only invokes the .NET 4.0 installer. This is the part that should invoke both parts:
<Chain>
<PackageGroupRef Id="NetFx40Redist" />
<MsiPackage SourceFile="C:\my app.msi" Cache="yes" Visible="no" After="NetFx40Redist"></MsiPackage>
</Chain>
It only invokes the packagegroupref. While installing the .NET 4.0 package, it gives an error. It's probably something easy and small, but I can't find it.
回答1:
The following works for me:
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Bundle Name="Bootstrapper1" Version="1.0.0.0" Manufacturer="Test" UpgradeCode="5e5f0f1e-58e0-42e5-8306-37533d677535">
<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense" />
<Variable Name="InstallFolder" Type="string" Value="[ProgramFilesFolder]Test\App"/>
<Chain>
<PackageGroupRef Id="NetFx40Web" />
<MsiPackage
Id="Setup"
Compressed="yes"
SourceFile="$(var.SetupProject1.TargetPath)"
Vital="yes">
<MsiProperty Name="INSTALLLOCATION" Value="[InstallFolder]" />
</MsiPackage>
</Chain>
</Bundle>
</Wix>
Make sure you add your project and WixNetFxExtension
as references to the bootstrapper project. I found this blog very helpful.
来源:https://stackoverflow.com/questions/13174507/making-wix-bootstrapper-work-for-bootstrapping-with-net-4-0