Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bundling Apple's Windows Bonjour installer into our msi

I've been asked to bundle Apple's Bonjour installer into our own msi installer, so that Bonjour automatically gets installed alongside our software. Anyone done this before? It doesn't seem to be trivial, as an msi installer cannot include and kick off another one. I assume I'd need some kind of batch file to run the two installers sequentially?

like image 560
Tom Davies Avatar asked Jun 20 '11 15:06

Tom Davies


2 Answers

You'll need to use a bootstrapper to chain the Bonjour install with your installer. If you are using WiX 3.6 or later, using Burn to create a package bundle is a good option.

I found the Bonjour installer by downloading the Bonjour SDK and opening it in 7-zip, though I'm sure installing the SDK would provide access to it as well.

The way I typically like to do this is to add a new source file to your setup project for each dependency package to keep that logic separate from the main application setup.

The Bonjour package can be listed as a remote payload to retrieve on the fly, or build it into your setup. In this case, it seems more likely to build it in (Compressed="yes"). If you need to add any extra dependencies related to bonjour or parameters to pass into it, you could define them here as well.

<Fragment>
    <!-- if a web link actually exists, I didn't find it... -->
    <?define BonjourWebLink = "http://path/to/Bonjour.msi"?>

    <PackageGroup Id="BonjourWeb">
        <MsiPackage Id="BonjourWeb"
                    Compressed="no"
                    DownloadUrl="$(var.BonjourWebLink)">
        </MsiPackage>
    </PackageGroup>

    <PackageGroup Id="Bonjour">
        <MsiPackage Id="Bonjour"
                    Compressed="yes"
                    SourceFile="path\to\Bonjour.msi"/>
    </PackageGroup>
</Fragment>

In your main bundle you just need to add a reference to the correct package group.

<Chain>
    <PackageGroupRef Id="Bonjour"/>

    <MsiPackage SourceFile="path\to\YourProduct.msi"/>
</Chain>

Since Bonjour uses MSI instead of an executable, you don't need to do anything to detect whether it is present or not; Burn will handle that for you. Actually, since WiX harvests most of the information your bundle needs from the MSI, this might be overkill, and you could just put in the MsiPackage element in your chain directly.

Don't forget to carefully check Apple's terms for doing this.

like image 91
Dave Andersen Avatar answered Nov 12 '22 20:11

Dave Andersen


This would be a bit more work, and is prone to issues with upgrading, but you can take the Bonjour MSI and decompile it using dark. Convert the decompiled MSI into a Merge module that can be included with your installer, and you will have a single install. I have done this with some driver installs in the past, and it is usually not that complicated.

like image 34
RCGoforth Avatar answered Nov 12 '22 18:11

RCGoforth