WiX for Visio add-ons and content deployment


Since Visual Studio has deprecated the standard MSI setup project in favor of WiX or other third party Windows Installer tools I have received many questions about using WiX for deploying Visio content; stencils, templates, add-ons, add-ins, etc.

Nikolay Belyh has already released an extension to WiX/Visual Studio for this…

You need the WiX Toolset from here - http://wixtoolset.org/

Then you can install his WiX for Visio extension from here - http://visualstudiogallery.msdn.microsoft.com/68d12e2d-eb42-4847-808a-7d80863bb90d?SRC=VSIDE

This WiX project that you create in Visual Studio using this project template gets you started with the basics for deploying stencils and templates as Nikolay Belyh has added an extension that registers (publishes) the stencils and templates as done by the Visio Publishing Tool.

If you are using VSTO you will also need to add registry entries for the manifest and load behavior.  This is simple using the Registry keys as

<Component Id="VisioAddonRegistryKeys" Guid="{6699E7EC-1A8F-40E4-840D-B0A93D6CD0E4}">

  < RegistryKey Id="VisioAddonKey" ForceCreateOnInstall="yes" ForceDeleteOnUninstall="yes" Key="Software\Microsoft\Visio\Addins\HelloVisioFromVSTO" Root="HKCU">

     < RegistryValue Name="Description" Type="string" Value="Hello Visio from VSTO" />

     < RegistryValue Name="FriendlyName" Type="string" Value="Hello Visio from VSTO" />

     < RegistryValue Name="LoadBehavior" Type="integer" Value="3" />

     < RegistryValue Name="Manifest" Type="string" Value="file:///[INSTALLDIR]HelloVisioFromVSTO.vsto|vstolocal" />

  </RegistryKey>

< /Component>

 

Then just include this component as part of the Feature

 

<Feature Id="ProductFeature" Title="Hello Visio From VSTO">

      <ComponentRef Id="VisioAddonDLL" />
      < ComponentRef Id="VisioAddonMANIFEST" />
      < ComponentRef Id="VisioAddonVSTO" />
      < ComponentRef Id="VisioAddonUtilities" />
      <ComponentRef Id="VisioAddonRegistryKeys" />
   
</Feature>