Automatic account creation is now enabled. Captcha authentication required for account creation and editing unless you are trusted here.

Bootstrapper

From WiX Wiki at MindCapers

Jump to: navigation, search

Excuse the copy & paste mess, actively working on cleanup ... --Julie 12:34, 21 November 2007 (CST)

Contents

What is a Bootstrapper?

A bootstrapper can also be referred to as an install chainer. One would use this to install pre-requisite or companion installers automatically for the user.

Why a Bootstrapper?

Due to the way Windows Installer prevents two .msi files from executing at the same time, a .msi cannot call another .msi. This creates problems for the developer that has multiple installs they need to run with a single launch for the the end user.

Visual Studio 2005 Bootstrapper

Bootstrapper Packages

Each package for the Visual Studio 2005 Bootstrapper must reside within a certain directory created when installing the Visual Studio 2005 SDK. This directory, unless changed when installing Visual Studio, is C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\BootStrapper\Packages, to be referred to as the Packages directory below.

Each package has its own directory within the Packages directory. The minimal contents of this directory are:

  • product.xml
  • lang/package.xml
  • Install Files

where lang is a directory containing localized information. Install Files can live in the main package directory with product.xml or within the language directories if they contain localized information.

PackageFiles Element

The PackageFiles Element can be in the product.xml or the package.xml or both. Be warned that if you wish to run one of the PackageFiles listed under this element under a Command element, the PackageFile must reside in the same file, i.e., in the product.xml. This actually is documented on MSDN, but not in a place that makes sense.

Troubleshooting

Problem
I created my bootstrapper package, but it doesn't show up in the pre-requisites dialog.
Solution
There is probably something wrong, for example, a syntax error, in either your product.xml or platform.xml manifests. TODO: Is there a .xml file vs. schema validation to recommend? Instructions for use?


Problem
I built my setup project, but two installers are trying to run at the same time.
Solution
Is there a third party package that is a self-extracting .zip file? If so, unzip it yourself and list all the files in <PackageFile> elements. Then, run the unzipped setup.exe (or appropriate installer) in your <Command> element rather than the self-extracting .zip.

Bootstrapper Links

Original Question

Someone might have already asked this question, but I don't think anyone really answered it. For the BootstrapperFile element, where do I find all prerequisites values I can use inside of the Include attribute? I'm really interested in follow prerequisites: .NET 3.0, ReportViewer, and ADAM.
See c:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bootstrapper\Packages, and this article might be interesting if you haven't already seen it..
I would like to generate a bootstrapper using the GenerateBootstrapper task, but I want to ship with all the prerequisites with my package. In deployment environment, during an install the machine will not have Internet access. If someone can show me an example how to accomplish this or point me to the right direction would be great. I think I just figured out the answer to my 2nd question which is set ComponentsLocation="Relative".

Secondary Question

And having been fighting this for over 3 weeks now and having used a support incident and Microsoft techs (I'm on number 4 now) have been working this for 2 weeks - if there is not an example somewhere for the product you want - give up.
It is not documented and no one seems to know how to use it. I have spent so much time talking to MS techs on this I think it would have been less of my time just to write my own bootstrapper - and I still don't have a solution. And this is for this article which is supposedly all set up to use as a pre-req.
After fishing around I was able to build a custom bootstrap for the prerequsites I need which is not part of VS 2005.
Apparently this guy's trying to make bootstrappers a dash easier.
The root problem is I need info from Microsoft on what to look for to see if the 3 hotfixes need to be installed. There is no information as to what registry settings or ??? to look for. Also, the actual install files are not on Microsoft's website so they must always be copied to the directory the bootstrapper is in - so no optional download.

A Sample!

Hi, i use the GenerateBootstrapper task from msbuild to create a bootstrapper but it doesn't do what you want to do, for that you have to create your own bootstrapper.

However if you want to give it a try here you have an example:

 
 
 <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <ItemGroup>
    <BootstrapperFile Include="Microsoft.Net.Framework.2.0">
      <ProductName>.NET Framework 2.0</ProductName>
    </BootstrapperFile>
    <BootstrapperFile Include=" Microsoft.Windows.Installer.3.1">
      <ProductName>Windows Installer 3.1</ProductName>
    </BootstrapperFile>
    <BootstrapperFile Include="Microsoft.JSharp.2.0 ">
      <ProductName>Visual J# redistributable</ProductName>
    </BootstrapperFile>
    <BootstrapperFile Include="Microsoft.Sql.Server.Express.1.0">
      <ProductName>SQL Server 2005 Express Edition</ProductName> 
    </BootstrapperFile>
  </ItemGroup><br />
  <Target Name="Bootstrapper">
    <GenerateBootstrapper
      ApplicationFile="app.msi" ApplicationName="My app" 
      BootstrapperItems="@(BootstrapperFile)" OutputPath="bin"
      ComponentsLocation="Relative" Culture="pt-PT" 
      Path="$(BootstrapperPath)" />    
  </Target>
 </Project>
 
 

In this example the bootstrapper includes the MSI 3.1, net2.0, j# and SQLExpress. The property "BootstrapperPath" indicates the path to the bootstrapper required files, default is: "C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\BootStrapper", however i use a local copy for the cruise control server.

Bootstrapper Manifest Generator

http://www.codeplex.com/bmg

http://blogs.msdn.com/chrsmith/archive/2005/06/29/MSBuilding_a_Bootstrapper_via_the_command_line.aspx

Example

I have added a project to one of my solutions that generates a bootstrap to preinstall required pre-requisites. I thought I would share this with all of you:

 
 
 using System;
 using System.Collections.Generic;
 using System.Text;
 using Microsoft.Build.Tasks.Deployment.ManifestUtilities;
 using Microsoft.Build.Tasks.Deployment.Bootstrapper;
 using Microsoft.Build.Tasks;
 using Microsoft.Build.Framework;
 using Microsoft.Build.Utilities;<br />
 namespace GenerateBootstrap
 {
    class GenerateBootstrap
    {
        static void Main(string[] args)
        {
            GenerateBootstrapper gbs = new GenerateBootstrapper();
            TaskItem SqlBcRuntime;
            TaskItem WseRuntime;
            string PFiles = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles).ToString();<br />
            try
            {
                gbs.ApplicationName = "My Product";
                gbs.ApplicationFile = @"MyInstall.msi";
                SqlBcRuntime = new TaskItem(@"SQL.2005.Backwards.Compatibility");
                WseRuntime = new TaskItem(@"Web.Services.Enhancements.2.0.SP2");
                gbs.BootstrapperItems = new ITaskItem[] { SqlBcRuntime, WseRuntime };
                gbs.Path = PFiles + @"\Microsoft Visual Studio 8\SDK\v2.0\Bootstrapper";
                gbs.ComponentsLocation = ComponentsLocation.Relative.ToString();
                gbs.CopyComponents = true;
                gbs.OutputPath = @".\output";
                gbs.Execute();
            }<br />
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
    }
 }
 
 

The above code will generate a bootstrap package with a reference to the required dependencies and my product MSI. The two dependencies I am using were packages I created using the Bootstrapper Manifest Generator available here: http://www.codeplex.com/bmg

Personal tools