Skip to content

Samples

Heath Stewart edited this page Feb 13, 2017 · 1 revision

You can use and even redistribute VSIXBootstrapper.exe to easily locate VSIXInstaller.exe and pass through any command line arguments.

Windows Installer XML (WiX)

VSIXBootstrapper.exe is also useful in cases where installing a workload or components as a dependency may install other Windows Installer packages (.msi files). MSIs cannot install concurrently, so installing your extension that depends on workloads and components not installed by default with Visual Studio may fail.

To work around this, use VSIXBootstrapper.exe in your bundle to install one or more extensions.

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
  <Bundle Name="Example" Version="1.0.0.0" Manufacturer="Example" UpgradeCode="c8fcda9c-ca1a-4b2c-a1ee-86fb32c3ee2b">
    <BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense" />
    <Chain>
      <ExePackage
        Id="MyVSIX"
        SourceFile="packages\VSIXBootstrapper.exe"
        PerMachine="yes"
        InstallCommand="/q /admin /logFile:&quot;[WixBundleLog_MyVSIX]&quot; &quot;[WixBundleOriginalSource]\packages\MyVSIX.vsix&quot;"
        UninstallCommand="/q /admin /logFile:&quot;[WixBundleLog_MyVSIX]&quot; /u:MyVSIX"
        >
        <PayloadGroupRef Id="MyVSIX"/>
      </ExePackage>
    </Chain>
  </Bundle>
  <Fragment>
    <PayloadGroup Id="VSIXBootstrapper">
      <Payload
        SourceFile="packages\VSIXBootstrapper.exe"
        Compressed="yes"/>
    </PayloadGroup>
  </Fragment>
  <Fragment>
    <PayloadGroup Id="MyVSIX">
      <PayloadGroupRef Id="VSIXBootstrapper"/>
      <Payload
        SourceFile="packages\MyVSIX.vsix"
        Compressed="yes"/>
    </PayloadGroup>
  </Fragment>
</Wix>

This puts VSIXBootstrapper.exe in a separate PayloadGroup you can reference from one or more extensions so that only a single copy is in your bundle or gets downloaded if not compressed. The command line is the same as if you installed an extension within an MSI.

Clone this wiki locally