Prerequisites and Bootstrapper Manifest Generator

Prerequisites

Possible solutions for implementing nested installations or nested executables in a Setup Project created in Visual Studio - without making use of installer tools (like InstallShield) - are listed below :

  • Bootstrapping
  • Custom Actions in a Setup Project (Install action > executable output)
  • Custom Actions in a Setup Project (Install action > Installer class > override Install > Process.Start())

In this post, I will explain the Bootstrapping solution, which is generally the most prefered one. So what is 'bootstrapping' exactly?

"Bootstrapping is the process of installing prerequisite components"

Other common descriptions for Bootstrapping are : Prerequisites and Redistributable package.

A list of Prerequisites, which are installed on your workstation, can easily be obtained in Visual Studio by opening the Properties window of your Setup Project, then press button Prerequisites.... This list of Prerequisites, which is generated by Visual Studio, is based on the content of this specific folder:

\Program Files\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages

Each subfolder in this Pa ckages folder represents a Prerequisite (Redistributable package) and contains the following files:

  • product.xml manifest file
  • package.xml manifest file
  • the redistributable files (Optional. If not present, the software will be downloaded over the internet.)

As you will notice, there are some Prerequisites which are standard included with Visual Studio, such as Crystal Reports 
Basic
and SQL Server 2005 Express Edition. If an essential Prerequisite is not in the list, you will have to generate the Redistributable package manually. This is where the free downloadable Bootstrapper Manifest Generator tool will come in hand.

Bootstrapper Manifest Generator

As explained, a redistributable package consists of the XML Manifest files (product.xml, package.xml) and the Redistributable package (e.g. the executable file for installing Adobe Reader).

The Bootstrapper Manifest Generator (BMG) will enable you to quickly and easily configure and build the essential Prerequisite with corresponding Redistributable package. After you have build the Prerequisite, the contents of the Prerequisite will be copied to the Packages folder (mentioned before), after which Visual Studio will recognize this newly added Prerequisite.

There is some minor bug in this tool when re-opening a saved BMG file (extension .VSBootstrapperManifest), therefore the BMG tool will always be used for building new prerequisite packages, not for modifying existing BMG files. There are only a few required configuration settings, so that this minor limitation of the BMG should not cause a problem.

The following steps have to be accomplished in the BMG, in order to generate a Prerequisite :

1. Download and install the BMG

- Download : http://code.msdn.microsoft.com/bmg
- Open the downloaded file "BMG2008Setup.msi" to install the BMG

2. Starting the BMG tool

- The BMG executable file location is C:\Program Files\Microsoft\Bootstrapper Manifest Generator for VS2008\BMG.exe

In the following  instructions, the example for generating the Prerequisite for Adobe Reader 9.0 will be used, for which the file
C:\Program Files\Adobe\Reader 9.0\ReadMe.htm will be applied to recognize if Adobe Reader 9.0. has already been installed. The executable file AdbeRdr920_en_US.exe, which has been downloaded from the Adobe website, represents the setup file for Adobe Reader 9.0.

3. Start the BMG tool (BMG.exe)

4. File > New > Package Manifest

5. Enter the Project Name, for example 'Adobe Reader 9.0'

6. Click in the textbox for Product Code to automatically enter a value in it ('Adobe.Reader.9.0')

7. In the white column area on the left side, right-click Package > Add Install File

- Press button Browse..., select the executable file which will install the Adobe Reader software ('AdbeRdr920_en_US.exe')
- Press button OK

8. Field Display Name - the value for this will be shown as the Prerequisite name in Visual Studio, enter the value 'Adobe Reader 9.0 en-US'

9. Tab page System Checks

- Click the icon File Check
- Property for Result: - enter an obvious value here, for example 'EXISTACROBATFILE'
- File name to search for:  - enter the name of a file which will be installed, for this example, enter the value 'ReadMe.htm'
- Start Search in Special Folder: - check this if the mentioned file is located in the Program Files, in this example, ReadMe.htm is in the Program Files folder, so check this option
- The value in the dropdownlistbox : keep this unchanged ('ProgramFilesFolder')
- Path: - a relative path to the mentioned file, IF option Start Search in Special Folder: is checked (in this example, the value will be 'Adobe\Reader 9.0'), else an absolute path

10. Tab page Install Conditions

 - Type : 'ByPassIf'
 - Propery : 'EXISTACROBATFILE'
 - Comparison : 'Exists'

11. Tab page Exit Codes

- Use Default System Exit Codes - keep this checked
- Result: select value 'Success'
- Format Message From System - uncheck

12. In the white column area on the left side, on top, click the icon Build

- Dialog window Build Results will be opened
- The last line in the log field should read:
'Build Succeeded. Warnings: 0, Errors: 0'
- Click the hyperlink on top of the window, next to 'Build Output'
- In Windows Explorer, the folder containing the prerequisite package (product.xml etc. etc.) will be openend
- Copy this folder (folder Adobe Reader 9.0 !!) to the Packages folder
\Program Files\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages
- The Prerequisite should now be in folder:
C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages\Adobe Reader 9.0

This concludes the generation of the Adobe Reader 9.0 Prerequisite. In Visual Studio, in the Prerequisites window (Properties dialog-window of a Setup Project > button Prerequisites...), the newly added Prerequisite Adobe Reader 9.0 en-US should now be an item in the list. Build your Setup Project, and the generated setup.exe file is the bootstrapper.

.Net Framework 3.5 SP1 Redistributable Package

Although the .Net Framework 3.5 SP1 Prerequisite is included with Visual Studio 2008, this Prerequisite does not include the Redistributable package. It is set up to downloadeded the 200Mb content of the package, thus a connection with the internet is required during the setup, which is not always desirable.

In order to make the Redistributable package for the .Net Framework 3.5 SP1 Prerequisite - to bypass the download during setup - several steps have to be accomplished, which are described in this document (paragraph 2.3.1.1).

Reference links

Bootstrapper Manifest Generator
Adding Custom Prerequisites
Product and Package Schema Reference
Visual Studio 2008 Service Pack 1 (SP1) Readme 

Regards,

Wesly

23. February 2010 00:40 by Wez | Comments (0) | Permalink

WCF 'one address per scheme in this collection' error

It might occur that you have developed a WCF service, which works perfectly on your development environment, but gives the following error when it is deployed on your hosting environment:

"This collection already contains an address with scheme http. There can be at most one address per scheme in this collection."

A workaround for this problem has been described in this MSDN forum topic (in the second to last post). By modifying specific values for the serviceHostingEnvironment node, as presented in the code example below, the WCF service should also run on your development environment :

<system.serviceModel>
	<serviceHostingEnvironment>
		<baseAddressPrefixFilters>
			<add prefix="http://www.example.com"/>
		</baseAddressPrefixFilters>
	</serviceHostingEnvironment>
</system.serviceModel>

Regards, Wez.

19. February 2010 23:29 by Wez | Comments (0) | Permalink

Merry X-Mas Silverlight 3

John Bruin has created a Silverlight demo in which simulated dropping sticky snowflakes fall on the Christmas greeting text. The text has been converted to Path. He is using Andy Beaulieu’s Improved HitTest method to determine the snow hitting the Path.

Click here to read his post.

I  have downloaded his Silverlight project and made little modifications to the size and path:

Get Microsoft Silverlight

Merry X-mas and enjoy the holidays!

25. December 2009 03:24 by Wez | Comments (1) | Permalink

Welcome to my personal blog

Hi there,

this is my first post on my brand new personal blog!

This blog is powered by BlogEngine.Net. As I am a Microsoft Certified professional software developer, most of the upcoming posts will be about .Net technology : Windows Forms development, Web development, WCF Services, Silverlight, XAML, WPF, SharePoint, VSTO etc.

Regards,

Wesly van Zoen

(Wez)

24. December 2009 20:51 by Wez | Comments (0) | Permalink

About the author

Wesly van Zoen is a .Net Software Developer, working at HUMIQ.

Tag cloud

    Month List

    Page List