Visio Wix Installer Project Template

This project was migrated over time to "Extended Visio Add-In" (open-source), now it is a part of it. Check it out at the marketplace

The WiX project template for Visio allows you to create an installer for installing Microsoft Visio content (stencils, templates, VSL and EXE add-ons, help files).

This project brings the functionality of Visio Solution Publishing tool from Visio SDK into WiX, so now you can author setup which includes registration (publishing) of Visio-related stuff completely in WiX.

Check it out in Visual Studio gallery:

 11-05-2013 4-19-38

To add Visio publishing to your files to the installer, you can just use one of <visio:Publish > wix extension elements (nest under <File> element). The wizard creates a "starter" sample wix file to build your installer, with two sample Visio files – a template and a stencil.

The project adds the following Visio-specific items (implemented as WiX extension):

PublishStencil

Registers a stencil file for Microsoft Visio.

Minimal code to publish a stencil:

<File Name="Stencil_1_M.vss">
  <visio:PublishStencil MenuPath="My Stencils\Stencil 1" />
</File>

Parent item: File

Attributes:

Attribute Description Required Default Value
Visio2003 Install for Visio 2003 and below. By default is “no”. No no
Visio2007 Install for Visio 2007. By default is “yes” if file format is supported by Visio 2007. No yes
Visio2010 Install for Visio 2010. By default is “yes” if file format is supported by Visio 2010. No yes
Visio2013 Install for Visio 2013. By default is “yes” if file format is supported by Visio 2013. No yes
VisioEdition Specifies Visio Edition the item should be registered with (x32/x64). If not specified, then then the template is registered for both Visio x32 and Visio x64 No all editions
Language Specifies language the stencil should be registered with. You can specify either LCID, such as “1033” or language code, such as “en-us”. If not specified, publishing will be done in all languages. No all languages
MenuPath The MenuPath specifies where the stencil is displayed in the stencils menu tree. If this value is an empty string, the template or stencil is not displayed in the menus. If an underscore character (_) comes before any name in the menu path, the template is not displayed in the menus.The last portion of the menu path is also used in the file name in the Visio user interface. For stencils, the file name is displayed in the title bar of the stencil.Use backslash to separate levels, for example: “My Group\My Stencil”. Yes
AltNames A semicolon-delimited list of alternate names for the file. If this value is specified, the value overrides any alternate names that are stored in the file by the AlternateNames property of the Document object No
QuickShapeCount Specifies number of quick shapes. By default (if no specified) is 0. No 0

PublishTemplate

Registers a template file for Microsoft Visio.

Minimal code to publish an add-on:

<File Name="MyAddon.vsl">
 <visio:PublishAddon VisioEdition="x86" />
</File>

Parent item: File

Attributes:

Attribute Description Required Default Value
Visio2003 Install for Visio 2003 and below. By default is “no”. No no
Visio2007 Install for Visio 2007. By default is “yes” if file format is supported by Visio 2007. No yes
Visio2010 Install for Visio 2010. By default is “yes” if file format is supported by Visio 2010. No yes
Visio2013 Install for Visio 2013. By default is “yes” if file format is supported by Visio 2013. No yes
VisioEdition Specifies Visio Edition the item should be registered with (x32/x64). If not specified, then then the template is registered for both Visio x32 and Visio x64 No all editions
Language Specifies language the stencil should be registered with. You can specify either LCID, such as “1033” or language code, such as “en-us”. If not specified, publishing will be done in all languages. No all languages
MenuPath The MenuPath specifies where the template is displayed in the templates menu tree and in the Choose Drawing Type task pane. If this value is an empty string, the template is not displayed in the menus. If an underscore character (_) comes before any name in the menu path, the template is not displayed in the menus.The last portion of the menu path is also used in the file name in the Visio user interface. For templates, the file name is displayed in the most-recently used templates list.Use backslash to separate between levels, for example: “My Group\My Template”. Yes
AltNames A semicolon-delimited list of alternate names for the file. If this value is specified, the value overrides any alternate names that are stored in the file by the AlternateNames property of the Document object No
FeaturedTemplate For Visio 2003/2007, specifies if the template should be shown on the start page. Does not have any effect for Visio 2010 and later (the template is always shown on the start page). No yes

PublishAddon

Registers an addon EXE/VSL addon for Microsoft Visio.

Minimal code to publish an add-on:

<File Name="MyAddon.vsl">
 <visio:PublishAddon VisioEdition="x86" />
</File>

Parent item: File

Attributes:

Attribute Description Required Default Value
Visio2003 Install for Visio 2003 and below. By default is “no”. No no
Visio2007 Install for Visio 2007. By default is “yes” if file format is supported by Visio 2007. No yes
Visio2010 Install for Visio 2010. By default is “yes” if file format is supported by Visio 2010. No yes
Visio2013 Install for Visio 2013. By default is “yes” if file format is supported by Visio 2013. No yes
VisioEdition Specifies Visio Edition the item should be registered with (x32/x64). If not specified, then then the template is registered for both Visio x32 and Visio x64 Yes
Language Specifies language the stencil should be registered with. You can specify either LCID, such as “1033” or language code, such as “en-us”. If not specified, publishing will be done in all languages. No all languages
MenuPath The Menu-Path describes where the add-on is displayed in the add-ons menu tree. If this value is an empty string, the add-on is not displayed in the menus.If an underscore (_) comes before any name in the menu path, the add-on is not displayed in the menus.Use backslash to separate between levels, for example: “My Group\My Addon”. No file name
LocalizedName The localized name of the add-on. This name is displayed in locations in the Visio interface that lists add-ons. No file name
UniversalName The non-localized name of the add-on. This name is not displayed in the Visio interface but may appear in the ShapeSheet when used with the RUNADDON() and RUNADDONWARGS ShapeSheet functions. This name is used to call an add-on from code. Executable add-ons must be published to use this field because they cannot be queried at runtime. No file name
Ordinal Specifies the ordinal position of an add-on that is implemented as a Visio solution library file (VSL).            Determines the middle part (between the two backslashes) of the entry in the Qualifier column for the record in the MSI PublishComponent table for this add-on.
Also corresponds to the value of VAO_ORDINAL in the file VAO.H. (For more information about VAO.H, see the comments in the file VAO.H in the Visio SDK.) Cannot be zero. This value is ignored for EXE add-ons.The value that you specify must correlate with what the add-on itself publishes as its ordinal value. Visio uses this number to reference the add-on in its VSL file;  if the number that you specify here does not match what is programmatically set in the code, the add-on will not be able to be run, or the wrong add-on might be run.
No 1
PerformsActions Indicates whether the add-on does anything (performs any actions) when the Run method is called on it. Unlike COM add-ins, add-ons can perform actions when the Run method is called, and not only when they are loaded or unloaded. If you use the library files Vaddon.h and Vaddon.cpp when you create your add-on, this attribute determines whether the Run method is ever called (whether Visio sends the V2LMSG_RUN message, defined in Vaddon.h). For most add-ons, this option should be selected.
Executable (EXE) add-ons will not run unless it is selected. VSL add-ons can perform actions on load or unload and do not require that the Run method ever be called on them, but in that case, they provide no advantages in that regard over COM add-ins.
No yes
HasAboutBox Specifies that a message box or dialog box appears when the user clicks About in the Run Add-On dialog box.  If this option is selected, Visio sends the V2LMSG_RUNABOUT message to the add-on and makes the About button available when the add-on is selected in the Select add-on list in the Run Add-on dialog box. If you use the library files Vaddon.h and Vaddon.cpp when you create your add-on, this attribute determines whether the About method is ever called. No no
ProvidesHelp Specifies that add-on specific Help appears when the user presses CTRL and clicks Help in the Run Add-On dialog box.
If this option is selected, Visio sends the V2LMSG_RUNHELP message to the add-on. If you use the library files Vaddon.h and Vaddon.cpp when you create your add-on, this attribute determines whether the Help method is ever called.
No no
DisplayWaitCursor Specifies whether Visio displays the “working in background” cursor whenever the add-on is called No no
HideInUI Specifies whether add-on name appears on Visio menus, on the list of add-ons in the Run Add-On dialog box, and in the Run macro list on the Double-Click tab of the Behavior dialog box (Developer tab). No no
InvokeOnStartup Specifies whether the add-on starts when Visio starts. If not selected, the add-on starts only when the user runs it from the Visio UI. Applies to both VSL and EXE add-ons. No no
EnablingPolicy Options that specify when the Microsoft Visio commands that run the add-on are available to the user. Options:
AlwaysEnabled: Specifies that the commands that run the add-on are always enabled
DynamicallyEnabled: Specifies that before it enables the commands that run the add-on, Visio must query the add-on to determine whether the enable conditions set by the add-on are met
StaticallyEnabled: Specifies that before it enables the commands that run the add-on, Visio must validate that the selected static enable conditions for the add-on are met
StaticallyThenDynamicallyEnabled: Specifies that after first validating the selected static enable conditions,  and before enabling commands that run the add-on, Visio must query the add-on to determine whether the additional enable conditions set by the add-on are met.
No AlwaysEnabled
StaticEnableConditions Enable conditions that Visio must check to determine whether to make commands that run the add-on available to the user. These options are available only if “Statically enabled” or “Statically then dynamically enabled” is selected for Add-on enabling policy. No

PublishTemplate

Registers a help file for Microsoft Visio.

Minimal code to publish a help file:

<File Name="MyHelp.chm">
  <visio:PublishHelpFile />
</File>

Parent item: File

Attributes:

Attribute Description Required Default Value
Visio2003 Install for Visio 2003 and below. By default is “no”. No no
Visio2007 Install for Visio 2007. By default is “yes” if file format is supported by Visio 2007. No yes
Visio2010 Install for Visio 2010. By default is “yes” if file format is supported by Visio 2010. No yes
Visio2013 Install for Visio 2013. By default is “yes” if file format is supported by Visio 2013. No yes
VisioEdition Specifies Visio Edition the item should be registered with (x32/x64). If not specified, then then the template is registered for both Visio x32 and Visio x64 No all editions
Language Specifies language the stencil should be registered with. You can specify either LCID, such as “1033” or language code, such as “en-us”. If not specified, publishing will be done in all languages. No all languages

Project source code on github: https://github.com/nbelyh/VisioWixSetup/

Leave a Reply