Sunday, October 30, 2011

Introducing Managed Bootstrapper Applications

Now that WiX v3.6 has been released, I introduce the managed bootstrapper application (MBA) interoperability layer. It’s been available for a while actually, and if you’ve installed any builds of WiX v3.6, or the Microsoft Visual Studio 11.0 Developer Preview you’ve seen it in action.

While Burn – the WiX bootstrapper engine – and the core bootstrapper application interfaces are native and allow you to develop completely native bootstrapper applications, MBA allows managed code developers to utilize their skills to develop rich interactive setups. WPF designers can also utilize their skills to make the setup UI look great. In fact, both of the setup applications mentioned above are written for WPF and running atop the MBA interop layer.

The MBA interop layer leverages COM interoperability features of the CLR, but without requiring previous registration of the assemblies as COM servers as in previous examples. The MBA interop layer is composed of both a native CLR host and the managed framework. It’s in this native CLR host that the managed framework assembly is loaded and COM interfaces marshaled as in-process pointers. Message passing is not required since the Burn engine is written as a free-threaded component. Once the managed framework assembly is loaded, a class factory will create the actual managed bootstrapper application authored in the configuration file and pass its IBootstrapperApplication interface pointers back to the engine.

Because MBA is managed, the .NET Framework is of course required. A simple native bootstrapper application (BA) written atop wixstdba is used to bootstrap the .NET Framework. When you use the WixBalExtension to author your MBA you define the WixMbaPrereqPackageId WixVariable to reference the package ID of the .NET Framework you want to install.

In the following example the .NET Framework 4.0 will be installed if required.

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
     xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
    <Bundle
        Name="Test"
        Version="1.0.0.0"
        IconSourceFile="Setup.ico">
        <BootstrapperApplicationRef
            Id="ManagedBootstrapperApplicationHost">
            <Payload
                Name="BootstrapperCore.config"
                SourceFile="$(var.TestUX.TargetDir)\TestUX.BootstrapperCore.config"/>
            <Payload
                SourceFile="$(var.TestUX.TargetPath)"/>
            <Payload
                SourceFile="NetfxLicense.rtf"/>


Read more: Heath Stewart's Blog
QR: introducing-managed-bootstrapper-applications.aspx

Posted via email from Jasper-Net