Project Won't Build if Using SilentBootstrapperApplication

Oct 22, 2015 at 10:04 AM
Edited Oct 22, 2015 at 10:05 AM
I have a single project componenet and the Wix# project to build the bootstrapper and installer in one solution. All works well if I simply accept the default bootstrapper application, but if I use the SilentBootstrapperApplication as show below, I get the errors also shown below when building the solution.
var msiFile = Compiler.BuildMsi(project);

var bootstrapper =
            new Bundle("MyProject",
                new MsiPackage(msiFile))
                Version = assemblyVersion,
                UpgradeCode = new Guid("5ECB207C-4150-47F8-8A06-0E9509B7A5E4"),
                OutDir = Environment.GetEnvironmentVariable("OutDir") + @"\Installer\" + assemblyVersion,
                Manufacturer = "MyCo",
                Compressed = true

        bootstrapper.Application = new SilentBootstrapperApplication();
<snip>The Windows Installer XML variable !(wix.WixMbaPrereqPackageId) is unknown</snip>
<snip>The Windows Installer XML variable !(wix.WixMbaPrereqLicenseUrl) is unknown</snip>

Where am I going wrong? I cannot see what I've missed. Other than that, I'm liking Wix# a lot!
Oct 25, 2015 at 3:01 AM
Edited Oct 25, 2015 at 3:02 AM
Wix# SilentBootstrapperApplication is built using WiX ManagedBootstrapperApplicationHost bootstrapper app which is a WiX managed module. Thus WiX introduces .NET package dependency for both ManagedBootstrapperApplicationHost and WixStandardBootstrapperApplication application types expressed via WixMbaPrereqPackageId WiX variable referencing the specific .NET package to be installed.

The easiest way to handle this problem is to indicate what .NET you want to be installed. The following change will make light happy:
var bootstrapper =
            new Bundle("MyProject",
                new PackageGroupRef("NetFx40Web"),
                new MsiPackage(msiFile))
Oct 28, 2015 at 1:44 PM
Ah I see - I misunderstood and thought that since I wasn't bothered about any pre requisites I did not need that line. I've tried it out and it works as I expect, plus it's no bad thing to have a pre req check since we do technically require .Net 4 on the target machine.

Many thanks Oleg - keep up the good work!