1

Closed

Compile Error

description

I like wixsharp very much I have already created a couple of msi packages. Now I want to create bootstrapper package, but get followinf compile Errors:
Severity Code Description Project File Line Suppression State
Error The Windows Installer XML variable !(wix.WixMbaPrereqLicenseUrl) is unknown. Please ensure the variable is declared on the command line for light.exe, via a WixVariable element, or inline using the syntax !(wix.WixMbaPrereqLicenseUrl=some value which doesn't contain parenthesis). CustomBA C:\build\work\eca3d12b\wix3\src\ext\BalExtension\wixlib\Mba.wxs 62
Severity Code Description Project File Line Suppression State
Error The Windows Installer XML variable !(wix.WixMbaPrereqPackageId) is unknown. Please ensure the variable is declared on the command line for light.exe, via a WixVariable element, or inline using the syntax !(wix.WixMbaPrereqPackageId=some value which doesn't contain parenthesis). CustomBA C:\build\work\eca3d12b\wix3\src\ext\BalExtension\wixlib\Mba.wxs 62
To help diagnosing I attached the Project.
How get rid of them?
Thx for your help.

file attachments

Closed Dec 3, 2016 at 9:22 AM by oleg_s
Fixed in v1.1

comments

oleg_s wrote Nov 16, 2016 at 5:24 AM

Thx for reporting. It is an interesting one.

BA is relying on two internal variables that reflect .NET version (and licence) that BA requires at runtime. This is because any Wix BA (even a standard one) is a managed application and it does require .NET to be distributed with it (bootstrapped).

What is unfortunate is that it is required to define these variables explicitly if a user defined BA is in used.
The all Wix# bootstrapper code samples are including new PackageGroupRef("NetFx40Web"), which in turn defines the missing variables. This masks the original problem.

This is a good info on the subject: http://stackoverflow.com/questions/25768179/whats-the-point-of-the-wixmbaprereqpackageid-and-wixmbaprereqlicenseurl-wix-var

The issue will be fixed in the next release by implementing support for WixVariables and setting them automatically for the user defines BA.

As a workaround until the release is available you can inject the required variables as below:
bootstrapper.WixSourceGenerated += document =>
{
    var productElement = document.Root.Select("Bundle");
    productElement.AddElement("WixVariable", "Id=WixMbaPrereqPackageId;Value=Netfx4Full");
    productElement.AddElement("WixVariable", "Id=WixMbaPrereqLicenseUrl;Value=NetfxLicense.rtf");
};

oleg_s wrote Nov 16, 2016 at 5:34 AM

Fixed in commit#c62c40cab8b6
Not released yet

urgestein wrote Nov 16, 2016 at 8:35 AM

Hi Oleg,
thx for looking into that. Although I searched the web I could not solve it. However, the quit interesting thing is: I created a completely new solution with only the WixSharp Project. There I have two msi packets which I put in a bündle. No compile Error.
But anyway, it's solved. Thx.