AQuirky
AQuirky

Reputation: 5256

Do I need 2 WIX projects when creating WiX Bootstrapper in visual studio?

Just getting started with WiX in Visual Studio. Cannot find a lot of documentation for the bootstrapper project template.

I created a blank WPF application. Then I created a setup project...

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="WiXBenchInstaller" Language="1033" Version="1.0.0.0" Manufacturer="None" UpgradeCode="9d845a6d-3e16-45d6-b0c4-7e818e465bfe">
    <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />

    <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
    <MediaTemplate EmbedCab="yes"/>

    <Feature Id="ProductFeature" Title="WiXBenchInstaller" Level="1">
        <ComponentGroupRef Id="ProductComponents" />
    </Feature>
</Product>

<Fragment>
    <Directory Id="TARGETDIR" Name="SourceDir">
        <Directory Id="ProgramFilesFolder">
            <Directory Id="INSTALLFOLDER" Name="WiXBench" />
        </Directory>
    </Directory>
</Fragment>

<Fragment>
    <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
        <!-- TODO: Remove the comments around this Component element and the ComponentRef below in order to add resources to this installer. -->
         <Component Id="ProductComponent">
     <File Source="$(var.WiXBench.TargetPath)"/>
         </Component> 
    </ComponentGroup>
</Fragment>

Then I created a bootstrapper project...

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Bundle Name="WixBenchBootstrap" Version="1.0.0.0" Manufacturer="None" UpgradeCode="4b1049ed-38ba-4289-8d8d-e291160201e0">
    <BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense" />

    <Chain>
  <MsiPackage SourceFile="$(var.WiXBenchInstaller.TargetPath)"/>
    </Chain>
</Bundle>

Everything working good. My question is whether this is the right approach. It seems like overkill to have 2 installer projects for a simple application. Could I simply have a single bootstrapper project that contains everything needed?

Upvotes: 2

Views: 1013

Answers (2)

Tom Blodget
Tom Blodget

Reputation: 20812

Yes, that is the right approach.

In general, VS projects produce one main output (.exe, .dll, .netmodule, .lib, .msi, etc) and wixprojs are no exception. There are no rules about this; It's just the design of the MSBuild .targets files and their related VS project designers.

If it distracts different developers, you could have different solutions that include different subsets of the projects. (A solution includes zero or more projects. A project is included in zero or more solutions.)

Upvotes: 3

Arkady Sitnitsky
Arkady Sitnitsky

Reputation: 1886

It depends on what you want to achieve, the number of package, UI ect.

http://wixtoolset.org/documentation/manual/v3/bundle/

"A bundle is a collection of installation packages that are chained together in a single user experience. Bundles are often used to install prerequisites, such as the .NET Framework or Visual C++ runtime, before an application's .MSI file. Bundles also allow very large applications or suites of applications to be broken into smaller, logical installation packages while still presenting a single product to the end-user"

If you have one msi package and you don't need complex UI than only use MSI project alone. If you have multiple packages or you want a WPF UI you will have to use a bootstrapper as you are using now.

Upvotes: 1

Related Questions