Skip to main content

BootStrapper BootStrapping

Bootstrapping is the creation of a wrapper installer around already existing installars or files.
It's useful if you have multiple installation files that you'll like the user to install in on step.

The Bootstrapper itself is a .exe installer file, it also may have .SED file which contains details of the contents of the .exe.

There are a few applications out there to generate a bootstrapper, the most simple I've seen is the an app called IEXpress.
IExpress
Is actually installed on windows (System32/iexpress.exe).
This creates an installer, you tell it what files you wish it to include in the installation.
I've only played with this so far and it appears to me that the isntaller can only install upto 2 setup.exes. You can include as many files as you like, but the files cannot have the same name, because of this you will probably need to rename your setup.exes to something else because you cannot have 2 files with the same name.
After you've included all the files you wish to run the next step asks you which files you wish to run, at this stage it looks like you can only specify upto 2 .exe installer files (there maybe a way around this, by editing the .sed file afterwards).
Also the final step I recommend telling the bootstrapper to use full files paths, this seems to ensure it works.

Visual Studio
In Visual Studio the BootStrapper is read in as an XML file. Visual Studio has a set BootStrapper XML file which it reads, below I will describe how to use this default bootstrapper and then I will describe how to create your own.
Using the BootStrapper in Visual Studio
Visual Studio also has a Bootstrapper, it's actually the Launch Conditions Editor in the Setup Project. The prerequisites are what your looking for, you'll see .NET is there by default.

By right clicking the Setup Project and bringing up the Properties dialog you'll a prerequisites button, this launches another dialog which lists the prerequisites, only the default ones are there.

There is a snag with this however you can to add your own you'll need to create your own BootStrapper XML file
Create your own BootStrapper file
There are 2 ways to create the XML file
1. Write the XML file yourself and copy to the correct location:
you'll need to follow the instructions in the .zip found in the BootStrapper SDK
2. You can use an Community UI (BMG) to write the bootstrapper for you (note the web installer doesn't work funnily enough, the msi does, the program can then be found at C:\Program Files\Microsoft\Bootstrapper Manifest Generator\BMG.exe).
It allows you to add .msi files, .exe files and apply conditions for them. It also installs the bootstrapper xml file for you after, this makes it available in Visual Studios Setup Project Prerequisite dialog that I mentioned earlier.
Here's a complete description of how to install you Custom Prerequisite.
Use the Visual Studio 2005 Bootstrapper to Kick-Start Your Installation - This article is the complete version and is not msdn, Also describe Custom bootstrapping.
Adding Custom Prerequisites.

MSBuild GenerateBootStrapper Task
After you've created your Visual Studio BootStrapper you can use it with MSBuild with the GenerateBootstrapper Task.
This MSBuild task allows you to include your custom prerequisite in any Visual Studio Project.
So if you wish to create a Bootstrapper for your installer using MSBuild it's the same thing as Adding Prerequisites to your Setup Project using the Project->Properties->Prerequisite dialog.
You'll still need to have your prerequisites created and installed beforehand.
Here's and example of a project to create a BootStrapper using 2 Prerequisites:


<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{7447AF9B-33E3-41AE-9D88-833704524543}</ProjectGuid>
</PropertyGroup>
<ItemGroup>
<Content Include="MyOriginalInstaller.msi">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<Target Name="Bootstrapper">
<GenerateBootstrapper
ApplicationFile="MyOriginalInstaller.msi"
ApplicationName="MyInstallerName"
BootstrapperItems="@(BootstrapperFile)"
ComponentsLocation="Relative" Culture="en" FallbackCulture="en-IE" CopyComponents="True"
Validate="False"
OutputPath="$(OutputPath)"
Path="C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bootstrapper" />
</Target>
<ItemGroup>
<BootstrapperFile Include="Microsoft.Net.Framework.2.0">
<ProductName>.NET Framework 2.0</ProductName>
</BootstrapperFile>
<BootstrapperFile Include="ProjectAggregator2">
<ProductName>ProjectAggregator2.msi</ProductName>
</BootstrapperFile>
</ItemGroup>
</Project>


We're creating a BootStrapper called MyInstaller.msi.
We're setting our main Installer (the one whose Gui appears) to be "MyOriginalInstaller.msi".
We include this same main installer "MyOriginalInstaller.msi" in the current project, it appears that it must be found in the current project in order for this to work.
We include to pre-requisites which get installed beforehand, their ProductName must be identical to the folder name that appears in their installation location
C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\BootStrapper\Packages
e.g.
C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\BootStrapper\Packages\ProjectAggregator2.msi\

ClickOnce FAQs (installsite.org)

Comments

Anonymous said…
Thanks for the pointer to BootStrapper SDK - I've never seen it yet.

Popular posts from this blog

dotNET - Debugging

Debugging with .NET MSIL assemblies Visual Studio and debugging the CLR are different, I'll talk about both. MSIL Assemblies Assemblies compiled with .NET tools such as the CLR compiler are compiled into a file which contains MSIL (Microsoft Intermediate Language). At runtime the contents of the assembly are loaded into the CLR and ran as machine code. When you compile an assembly in debug a PDB file is generated alongside the DLL or EXE you've just created. The link between these 2 files is that the PDB contains the line numbers of the methods and classes as well as the file names of the original source code that created the assembly. When you launch the debugger in Visual Studio the assembly is loaded into the Debugger (similar to the CLR) along with the PDB file. The debugger now uses your PDB file contents to match the running code found in the assembly to locations in source files (hopefully in your present project). CLR CLR Inside Out (msdn magazine) .NET Framework Tools:...

Installer CustomAction, Debugging the CustomAction, InstallState

Custom Action The Custom Action is added to the Setup Project, select the Project node and hit the Custom Action button. This allows you add an Action to a particular phase in the Installation. But first you must create the Custom Action. To Add a Custom Action you must first have a Custom Action created, this is usually in the form of a Installer Class, this should be created in a seperate project, the Installer Class is actually one of the File Templates in the C# Projects. So it's File->New Project and select Visual C# Projects. Then add a Class Library, this will prompt you for the Class Library Types , select "Installer Class". Walkthrough - Creating Custom Action (msdn). Also here's a more comprehensive document on Setup/Installer implementations, it delves into the Registry etc Getting Started with Setup Projects (SimpleTalk). Visual Studio Setup Projects and Custom Actions (Simple Talk). Create your Installer Class and then add it as a Custom Action to the ...

dotNET - Use app.config ApplicationSettings and UserSettings

When using Settings in an Assembly or .exe you can use the Settings Designer to generate a config file using Settings. The Settings Designer provides a wrapper class which allows you to provide defaults and access the config data using Properties. But what if you're not working inside that Assembly or .exe? this presents a problem. If your loading the Assembly externally and want to access that Assembly's .config file you'll probably wish to use something in the System.Configuration namespace... unfortunately it's not of much use if you've created the .config file from the Settings Designer in Visual Studio!! This is because the Designer creates Sections and ApplicationSettings and UserSettings, the System.Configuration namespace does not provide a method to access these (it has a method to access AppSettings which are a different thing. Below I've written a workaround which locates the app.config and accesses the ApplicationSettings and UserSettings using XML i...