As I mentioned in a previous post, the IIS 7.5 Express MSI can be redistributed with your software package. This is enabled by the license agreement so you don’t need any additional approval. When your software is being installed on a customer’s machine, you’ll want to install IIS Express as a prerequisite, if it isn’t already present. Installer dependencies on redistributable components, such as IIS Express, are typically handled using Bootstrapper Packages.
IIS Express doesn’t officially provide a Bootstrapper Package. This is not a showstopper since you can create one yourself. See the following links, for example.
For reference, I am including a Bootstrap Package for IIS Express as a part of this blog post. The zip file includes some XML manifests that will allow you to include IIS Express as a prerequisite for your setup package.
Disclaimer: The bootstrapper package is provided as-is, as a sample only. It is not officially supported. I have only verified that some simple cases work correctly. Please be sure to review and modify it as appropriate, and test it more thoroughly.
Relying on this manifest won’t bundle the IIS Express MSI with your package. Instead, when the user runs your setup program, the Windows installer will download and install IIS Express from Microsoft Download Center, if it isn’t already installed. This is fine if you are distributing your software over the internet and/or if your customers will be connected to the internet when they install your package. It makes your package leaner too, which is a good thing.
You can modify the manifest to include the IIS Express MSI. I won't describe how to do this in this blog post. Take a look at the MSDN links provided above for additional information.
Installing the Sample
To install the bootstrapper package on your machine, simply extract the zip file to the bootstrapper folder location. This folder contains bootstrapper packages for other Microsoft redistributable components, such as .NET 4.0.
On my 64-bit computer running Windows 7, this location is C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bootstrapper\Packages.
If you can’t find the above location, check the Path value under one of the following registry keys, depending on your architecture.
- HKLM\SOFTWARE\Microsoft\GenericBootstrapper\4.0 for 64-bit machines
- HKLM\SOFTWARE\Wow6432Node\Microsoft\GenericBootstrapper\4.0 for 34- bit machines.
A new IISExpress7.5 directory will show up under the Packages folder and will contain the product and package manifests for IIS Express.
Using the Sample
Here are steps to include IIS Express as a required component for your setup program in Visual Studio 2010.
- Launch your setup project in Visual Studio 2010
- In Solution Explorer, right-click your project and click Properties.
- Click the Prerequisites Button in the Properties dialog.
- In the ensuing dialog, select IIS Express as a prerequisite in addition to any others, as shown below. Also, make sure .NET 4.0 is checked since IIS Express requires it.
- Build your project.
Visual Studio will build a MSI as well as a setup.exe bootstrapper program. In order to make sure all prerequisites get installed, make sure your customers run setup.exe.
I hope this is useful and look forward to your feedback.