Wednesday, October 22, 2008

Visual Studio 2005 Bootstrapper

  • Scenario

    Assuming that you are going to package an application developed by Visual Studio 2005 and assuming also that you did the job successfully - as you think – and that you take the package and to test it right –as you think too – you install it on another developer's PC and everything goes well ..

    What is the next step ?

    A user buy this application and the following scenario is expected to occur :

    The app won't run ;D or even installed , of course, unless the .NET Framework 2.0 is installed. Consider that you use a SQL Server 2005 Express Edition database. Hmmm Okay, you have to inform the user that these components should be installed on his/her machine.

    First, the user has to check whether each component is already installed on the machine. Then he/she must manually download and run the installers for each missing component, selecting the appropriate choices in the installation UI. If any reboots are required, he/she must restart the machine and resume from where they left off. If the components need to be installed in a particular order, there are additional opportunities for things to go wrong. This is a poor user experience, to say the least, and many users would give up.


     

    The Visual Studio® 2005 Bootstrapper solves this problem by allowing you to provide an easy, integrated way to install all of the different prerequisite pieces required by your application.


     

  • What is Visual Studio 2005 Bootstrapper ?

    The Visual Studio 2005 Bootstrapper lets you provide users with a simple, automated way to detect, download, and install an application and its prerequisites. It serves as a single installer that integrates the separate installers for all the components making up an application, and provides a wealth of features and services.


     

    The Bootstrapper is a small executable that weighs in at a mere 222 KB, and takes about one minute to download on a 28.8 Kbps modem. It therefore adds only a small amount of overhead to the installation process, which can save the user from having to download much larger redistributables if he does not need them. It doesn't install a component that will not run on the target machine, the bootstrapper notifies the user and ends the installation before installing the component. It provides a flexible options for detecting whether a component is already installed or not.

    Most components include an End-User License Agreement (EULA) that serves to protect the component vendors' intellectual property. The Bootstrapper can be configured to present license agreements for individual components. It can also present a single shared license agreement for multiple components in order to minimize the number of pop-ups the user has to click through.

    The Bootstrapper can install prerequisites form local drives, web and file shares. It can be configured to download prerequisites components from the same location as the app installer. It detects whether any of the prerequisites are already installed. If any of the prerequisites are missing, the Bootstrapper shows an install dialog box that lists those components and displays their license agreement. Otherwise, if all of the prerequisites are detected, the Bootstrapper simply launches the application installer.


     

  • Configuring the Bootstrapper

    The Bootstrapper offers a couple of options for where redistributable files can be located. By default, the Bootstrapper assumes that all files, including the redistributables, the Bootstrapper setup.exe itself, and the actual application files, are located together under the same folder. This is ideal for applications that will be installed from local disk (CD-ROM, USB device) or a network share. This option also supports the application publisher who wants to serve up everything from a single deployment server. Alternatively, if the publisher wants to balance the load across different servers, or maintain a central location for prerequisite components that can be shared by multiple applications, the Bootstrapper can be configured to download any prerequisite files from a separate location.


     

  • Custom Redistributables in Visual Studio

    Adding your own redistributables to Visual Studio requires that you author the product and package manifests, then copy these files along with your redistributable files into a special folder that Visual Studio has reserved for redistributables that plug into the Bootstrapper. This folder is installed by default like so:

    C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bootstrapper


     

The problem that you might face is that you need two xml files – two manifests – that is required for installing the redistributables which are product and package. I have noticed that product.xml should be in the same folder that has the redistributable file and the package.xml file has to be in a 'en' folder in the same location of the redistributable. If you have a license agreement text file put it beside package.xml file.

Manifest files has tags that are easy to be understood ,but It will require a good effort to insert it for your redistributables may try to use Bootstrapper Manifest Generator. You have to note that when you try to open the setup project you may encounter a warnings, but it will be went away when you fix the product and package manifests.