Embedding Bonjour in Windows Applications

The purpose of this Technical Note is to help non-Mac OS X developers understand how to add Apple's Bonjour Technology to their Windows application. It covers the range of legal, development, and installation issues you need to address before shipping a Bonjour for Windows product.





Note: Since Mac OS X ships with Bonjour by default, developers of native applications needn't concern themselves with the installation of Bonjour libraries.

Obtain the Bonjour SDK

The first thing that you will need to do is acquire the Bonjour for Windows SDK. You can find it either by navigating through the main Bonjour developer website or you can just follow this direct link to the Bonjour for Windows SDK.

Back to Top 

Create your installer

There are several things worth mentioning in order to adequately ensure that no problems arise in shipping a piece of Windows software that is using Bonjour. The biggest issue that needs to be addressed concerns the piecing together of an installer.

Why MSI vs. MSM?

Apple wants to reduce the potential for conflicts between different forms of Bonjour distributions. When Bonjour is installed as its own product (MSI) other installers e.g. iTunes, can easily detect if Bonjour is installed and up-to-date and choose not to install it. This is better than the MSM approach where other installers always install Bonjour and leave it to the Windows Installer to sort out the file versioning issues. Another point worth mentioning is that since Bonjour integrates tightly with Windows sockets, a reboot is often required when Bonjour is replaced, even if the version doesn't change.

Back to Top 

Where to get MSI?

You can get the latest MSI package at the Bonjour Downloads website.

Back to Top 

How to set installer flags?

Bonjour has four features, three of which can be disabled during installation:

  • mDNSResponder (required)

  • PrinterSetupWizard

  • ExplorerPlugin

  • JavaSupport

A nice way to avoid all extraneous components is to just pass ADDDEFAULT=mDNSResponder so that only the core component is installed.

IMPORTANT: The way to pass parameters into a generic raw MSI you would execute the following command:

msiexec raw_msi.msi PROPERTY=value [...].

Back to Top 

MSI chaining best practices

There isn't an adopted standard way of chaining MSIs together, however, a de facto standard exists which is to have a bootstrapper EXE install them one by one. The bootstrapper EXE process can then receive messages from each MSI as it installs and provide status. Usually, one of the MSIs can contain the UI, e.g., wizard panels, etc.

A suggested location to find code to create a bootstrapper EXE is within the Microsoft Windows SDK.

Back to Top 

A Thing™ to check

A major concern is if the MSM is installed and then something else then installs the MSI. A test would be installing the latest AirPort update and then installing the latest Bonjour MSI.

Back to Top 

Testing & Certification

Now that you've built your application and installer, you need to do some testing. In addition to your regular testing, you also need to ensure that Bonjour has been installed and functions properly. This is mandatory due to the terms of the Bonjour for Windows Bundling Agreement, which is what gives you the right to redistribute the Bonjour for Windows libraries. Detailed information is available on the Bonjour Licensing Page, but the key steps are:

  • Running the Conformance Test (requires access to a Mac)

  • Submitting passing test results, along with the Bonjour for Windows Bundling Agreement as instructed in the Agreement

  • Displaying the Bonjour logo as part of your application packaging

Be sure to review the various agreements carefully and/or consult with your legal counsel as necessary .

Back to Top 

Document Revision History

DateNotes
2008-01-17First Version

Posted: 2008-01-17


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.