[MS]Building a Bootstrapper via command line

Alright, so you want to use the Generic Bootstrapper to deploy your application but for one reason or another you aren't using ClickOnce or a SetupProject.  (You are developing a VC++ app with a custom installer, for example).  Well, unfortunately there is no designer support ouf of the box but you still can create a Bootstrapper for your application.  How?

The same way Visual Studio does, MSBuild of course!

There is no magic to creating a Bootstrapper, it is just an MSBuild target which ClickOnce and SetupProjects call for you. However, you don't have to leave all the Bootstrappin' fun to Visual Studio. Below is an example MSBuild file for creating a Generic Bootstrapper:

<Project xmlns="https://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
      <!-- Include the 'Product Code' for every package you want -->
<BootstrapperFile Include="Microsoft.Net.Framework.2.0">
      </BootstrapperFile>
</ItemGroup>

<Target Name="Bootstrapper">
<GenerateBootstrapper
ApplicationName="My Awesome Application"
ApplicationFile="MyApp.exe"
BootstrapperItems="@(BootstrapperFile)"
Culture="en"
CopyComponents="True"
OutputPath="D:\CustomBootstrapper\" />
</Target>
</Project>

That's it!  Now save that XML to a file, "CLI Bootstrapper Test.xml" for example, and on the command type:

MSBuild "CLI Bootstrapper Test.xml"

MSBuild will parse your target file, do a little magic, and *POOF* your very own private Bootstrapper.

[This is provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified in the Terms of Use.]