Create a WiX installer for Office add-in:
Outlook, Excel, Word, PowerPoint

Add-in Express™
for Microsoft® Office and .net

Add-in Express Home > Add-in Express for Office and .NET > Online Guide > Deploying Office add-ins > WiX setup projects

This page covers the following topics:

Creating a WiX setup project

The below is a minimal introduction to using the Windows Installer XML technology (WiX) to deploy an Office extension created with Add-in Express. As you understand, it is not possible to describe all the features provided by WiX. We recommend that you study the WiX toolset manual.

The setup project wizard creates a WiX installer containing just one file called Product.wxs. The file is the source of the configuration information (in the XML format) for the WiX binaries mentioned in the References section of the WiX project. The product to be installed is described in the tag Product.


<Product 
    Id="*" 
    Name="MyAddin1" 
    Language="1033" 
    Version="1.0.0" 
    Manufacturer="Default Company" 
    UpgradeCode="{C8E0C7A6-CCC9-478F-AB75-5C65F8941802}" 
    Codepage="1252">
    <Package 
        AdminImage="no" 
        Comments="MyAddin1" 
        Compressed="yes" 
        Description="MyAddin1" 
        InstallerVersion="200" 
        InstallScope="perUser" 
        Languages="1033" 
        Manufacturer="Default Company" 
        Platform="x86" 
        ReadOnly="no" 
        ShortNames="no" 
        SummaryCodepage="1252" 
    />
    <!-- Cut -->
    <!-- The ".NET Framework" launch condition. -->
    <PropertyRef 
        Id="NETFRAMEWORK40FULL"/>
    <PropertyRef 
        Id="NETFRAMEWORK40CLIENT"/>
    <Condition 
        Message="This setup requires the .NET Framework 4.0.  Please install the .NET Framework and run this setup again.">
        <![CDATA[Installed OR NETFRAMEWORK40FULL OR NETFRAMEWORK40CLIENT]]>
    </Condition>
    <MajorUpgrade 
        DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
  </Product>
                

The set of important tags describes custom actions which register and unregister your Office add-in:


<Binary Id="adxregistrator_exe" 
    SourceFile="$(var.ADX_PATH)\Redistributables\adxregistrator.exe" />
<!-- The "adxregistrator.exe" custom action. -->
<CustomAction 
    Id="_A6CDF287_BEB8_4A82_AED5_2883E59F8C14" 
    BinaryKey="adxregistrator_exe" 
    Execute="deferred"
    ExeCommand="/install="[TARGETDIR]$(var.MyAddin1.TargetFileName)" /privileges=user" 
    Impersonate="yes" />
<!-- The "adxregistrator.exe" custom action. -->
<CustomAction 
    Id="_940B1264_72AA_48B3_B86E_72F60F141361" 
    BinaryKey="adxregistrator_exe" 
    Execute="rollback" 
    ExeCommand="/uninstall="[TARGETDIR]$(var.MyAddin1.TargetFileName)" /privileges=user" 
    Impersonate="yes" />
<!-- The "adxregistrator.exe" custom action. -->
<CustomAction 
    Id="_397A6B2B_71A8_4482_8C7B_9350770F391D" 
    BinaryKey="adxregistrator_exe" 
    Execute="deferred" 
    ExeCommand="/uninstall="[TARGETDIR]$(var.MyAddin1.TargetFileName)" /privileges=user" 
    Impersonate="yes" />

  <!-- Cut -->

<InstallExecuteSequence>
  <Custom 
    Action="DIRCA_TARGETDIR" 
    Before="CostInitialize"><![CDATA[TARGETDIR=""]]>
  </Custom>
  <Custom 
    Action="DIRCA_TARGETDIR_UNINSTALL"
    After="AppSearch"><![CDATA[PREVIOUSINSTALLFOLDER]]>
  </Custom>
  <Custom 
    Action="_A6CDF287_BEB8_4A82_AED5_2883E59F8C14" 
    After="StartServices"><![CDATA[$comp_8FC343D3_181B_487E_847B_AFCAB2A26520>2]]>
  </Custom>
  <Custom 
    Action="_940B1264_72AA_48B3_B86E_72F60F141361" 
    After="_A6CDF287_BEB8_4A82_AED5_2883E59F8C14">
    <![CDATA[$comp_8FC343D3_181B_487E_847B_AFCAB2A26520>2]]>
  </Custom>
  <Custom 
    Action="_397A6B2B_71A8_4482_8C7B_9350770F391D" 
    After="MsiUnpublishAssemblies">
    <![CDATA[$comp_8FC343D3_181B_487E_847B_AFCAB2A26520=2]]>
  </Custom>
</InstallExecuteSequence>
			

Finally, there are tags describing files that will be delivered to the target PC. The minimum set of files is given in Files to Deploy.

 
<Component 
  Id="comp_8FC343D3_181B_487E_847B_AFCAB2A26520" 
  Guid="02642689-64BE-4FB3-8513-3102B2FB0129" 
  Permanent="no" SharedDllRefCount="no" Transitive="no">
  <RegistryKey Root="HKCU" Key="Software\[Manufacturer]\[ProductName]">
    <RegistryValue Type="string" Name="Installed" Value="[TARGETDIR]" KeyPath="yes" />
  </RegistryKey>
  <File 
    Id="_654D0087_4440_4FFA_A002_32BAE2537B47" DiskId="1" Hidden="no" 
    ReadOnly="no" System="no" Vital="yes" Compressed="yes" Name="adxloader64.dll" 
    Source="$(var.MyAddin1.ProjectDir)Loader\adxloader64.dll" />
  <File 
    Id="_480F2DDD_7C92_4577_B2DF_848D31555275" DiskId="1" Hidden="no" 
    ReadOnly="no" System="no" Vital="yes" Compressed="yes" Name="adxloader.dll.manifest" 
    Source="$(var.MyAddin1.ProjectDir)Loader\adxloader.dll.manifest" />
  <File 
    Id="_1993E44A_8646_4412_940C_7A8EAFB53C57" DiskId="1" Hidden="no" 
    ReadOnly="no" System="no" Vital="yes" Compressed="yes" Name="adxloader.dll" 
    Source="$(var.MyAddin1.ProjectDir)Loader\adxloader.dll" />
</Component>
<Component 
  Id="comp_581118C2_DC2A_471D_AED7_5C030C7C5DD6" 
  Guid="DCDC04BD-44B5-4585-A276-42D5CFD1BD87" 
  Permanent="no" SharedDllRefCount="no" Transitive="no">
  <File 
    Id="_581118C2_DC2A_471D_AED7_5C030C7C5DD6" DiskId="1" Hidden="no" 
    ReadOnly="no" System="no" Vital="yes" Compressed="yes" 
    Name="AddinExpress.MSO.2005.dll" 
    Source="C:\Program Files (x86)\Add-in Express\Add-in Express for .NET\Bin\AddinExpress.MSO.2005.dll" />
</Component>
<Component 
  Id="comp_315D7476_9479_49EB_89B5_F21EAE192F21" 
  Guid="762F9690-B15F-476B-82AA-0B9B7D1CDB14" 
  Permanent="no" SharedDllRefCount="no" Transitive="no">
  <File 
    Id="_315D7476_9479_49EB_89B5_F21EAE192F21" DiskId="1" Hidden="no" 
    ReadOnly="no" System="no" Vital="yes" Compressed="yes" 
    Name="Microsoft.Office.Interop.Excel.dll" 
    Source="$(var.MyAddin1.TargetDir)Microsoft.Office.Interop.Excel.dll" />
</Component>
<Component 
  Id="comp_A82FC374_1237_4D8C_AB0F_D5DD3A9E5B2B" 
  Guid="3F7F32C3-A14A-404A-9633-FBDE3AA16161" 
  Permanent="no" SharedDllRefCount="no" Transitive="no">
  <File 
    Id="_A82FC374_1237_4D8C_AB0F_D5DD3A9E5B2B" DiskId="1" Hidden="no" 
    ReadOnly="no" System="no" Vital="yes" Compressed="yes" 
    Name="Microsoft.Vbe.Interop.dll" 
    Source="$(var.MyAddin1.TargetDir)Microsoft.Vbe.Interop.dll" />
</Component>
<Component 
  Id="comp_F1023CE7_433A_4963_B405_0C2C89D3F389" 
  Guid="0E8582B8-640A-4645-A656-96E494FED7F8" 
  Permanent="no" SharedDllRefCount="no" Transitive="no">
  <File 
    Id="_F1023CE7_433A_4963_B405_0C2C89D3F389" DiskId="1" Hidden="no" 
    ReadOnly="no" System="no" Vital="yes" Compressed="yes" Name="Office.dll" 
    Source="$(var.MyAddin1.TargetDir)Office.dll" />
</Component>   

			

Please refer to the WiX manual for more information, see http://wix.sourceforge.net/manual-wix3/main.htm.

Multiple-Language Installers

Specifying a localization at the second step of the setup project wizard creates a setup project supporting the selected language. To let you specify multiple languages, the wizard provides the third step (see the screenshot below).

Choose languages to support by the WiX installer of your add-in

Dual-Purpose Installers

The same wizard step (see the screenshot above) allows the developer to create a dual-purpose setup project. The end user is able to choose whether to install the add-in for all users on the PC or for the current user only. Note that starting such an installer in the elevated context (e.g. from a file manager started via the "Run as administrator" command) causes the installer to run per machine. When updating an add-in installed per user, the update will run per user only. When updating an add-in installed per machine, the update will run per machine only. To change the scope (e.g. from per-user to per-machine or vice versa), you need to uninstall the add-in first.