Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 179127
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T14:21:07+00:00 2026-05-11T14:21:07+00:00

I want to deploy a VSTO 3 Application Level Word 2007 addin that I’ve

  • 0

I want to deploy a VSTO 3 Application Level Word 2007 addin that I’ve written with Visual Studio 2008. I see that WiX has an extension named WixOfficeExtension that looks like it might have this functionality, but I can’t find any documentation for it, and I can’t discern it’s purpose from the source code.

Has anyone attempted this before, and were you able to pull it off successfully?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T14:21:07+00:00Added an answer on May 11, 2026 at 2:21 pm

    This is the code I ended up using. I basically ported the examples from MSDN to use WiX.

    Note: This specific solution is only for a Word 2007 addin, but the case for Excel is very similar. Simply modify the registry/component checks and keys/values according to the aforementioned MSDN Article.

    Inclusion List Custom Action

    In order to run addins with full trust, it must be added to the Inclusion List for the current user. The only way to do this reliably is with a custom action. This is a port of the custom action in the article to the new Deployment Tools Foundation included with WiX.

    To use it, create a new DTF project called VSTOCustomAction and add CustomAction.cs.

    CustomAction.cs

    using System; using System.Security; using System.Security.Permissions; using Microsoft.Deployment.WindowsInstaller; using Microsoft.VisualStudio.Tools.Office.Runtime.Security;  namespace VSTOCustomActions {     public class CustomActions     {         private static string GetPublicKey(Session session)         {             return session['VSTOCustomAction_PublicKey'];         }         private static string GetManifestLocation(Session session)         {             return session['VSTOCustomAction_ManifestLocation'];         }         private static void ErrorMessage(string message, Session session)         {             using (Record r = new Record(message))             {                 session.Message(InstallMessage.Error, r);             }         }          [CustomAction]         public static ActionResult AddToInclusionList(Session session)         {             try             {                 SecurityPermission permission =                     new SecurityPermission(PermissionState.Unrestricted);                 permission.Demand();             }             catch (SecurityException)             {                 ErrorMessage('You have insufficient privileges to ' +                     'register a trust relationship. Start Excel ' +                     'and confirm the trust dialog to run the addin.', session);                 return ActionResult.Failure;             }              Uri deploymentManifestLocation = null;             if (Uri.TryCreate(GetManifestLocation(session),                 UriKind.RelativeOrAbsolute, out deploymentManifestLocation) == false)             {                 ErrorMessage('The location of the deployment manifest is missing or invalid.', session);                 return ActionResult.Failure;             }              AddInSecurityEntry entry = new AddInSecurityEntry(deploymentManifestLocation, GetPublicKey(session));             UserInclusionList.Add(entry);              session.CustomActionData.Add('VSTOCustomAction_ManifestLocation', deploymentManifestLocation.ToString());              return ActionResult.Success;          }          [CustomAction]         public static ActionResult RemoveFromInclusionList(Session session)         {             string uriString = session.CustomActionData['VSTOCustomAction_ManifestLocation'];             if (!string.IsNullOrEmpty(uriString))             {                 Uri deploymentManifestLocation = new Uri(uriString);                 UserInclusionList.Remove(deploymentManifestLocation);             }             return ActionResult.Success;         }      } } 

    Wix Fragment

    We obviously need the actual WiX file to install the addin. Reference it from your main .wcs file with

    <FeatureRef Id='MyAddinComponent'/> 

    Addin.wcs

    <?xml version='1.0' encoding='utf-8'?> <Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>     <Fragment Id='Word2007Fragment'>        <!-- Include the VSTO Custom action  -->       <Binary Id='VSTOCustomAction' SourceFile='path\to\VSTOCustomAction.dll'/>       <CustomAction Id='AddToInclusionList' BinaryKey='VSTOCustomAction' DllEntry='AddToInclusionList' Execute='immediate'/>       <CustomAction Id='RemoveFromInclusionList' BinaryKey='VSTOCustomAction' DllEntry='RemoveFromInclusionList' Execute='immediate'/>        <!-- Set the parameters read by the Custom action -->       <!--          The public key that you used to sign your dll, looks something like <RSAKeyValue><Modulus>...</Modulus><Exponent>...</Exponent></RSAKeyValue>         Take note: There should be no whitespace in the key!       -->       <Property Id='VSTOCustomAction_PublicKey'><![CDATA[Paste you public key here]]></Property>       <CustomAction Id='PropertyAssign_ManifestLocation' Property='VSTOCustomAction_ManifestLocation' Value='[INSTALLDIR]MyAddin.MyAddin.vsto' />        <!-- Properties to check prerequisites -->       <Property Id='VSTORUNTIME'>         <RegistrySearch Id='RegistrySearchVsto'                         Root='HKLM'                         Key='SOFTWARE\Microsoft\vsto runtime Setup\v9.0.30729'                         Name='SP'                         Type='raw'/>       </Property>       <Property Id='HASWORDPIA'>         <ComponentSearch Id='ComponentSearchWordPIA'                          Guid='{816D4DFD-FF7B-4C16-8943-EEB07DF989CB}'/>       </Property>       <Property Id='HASSHAREDPIA'>         <ComponentSearch Id='ComponentSearchSharedPIA'                          Guid='{FAB10E66-B22C-4274-8647-7CA1BA5EF30F}'/>       </Property>         <!-- Feature and component to include the necessary files -->       <Feature Id='MyAddinComponent' Title ='Word 2007 Addin' Level='1' AllowAdvertise='no'>         <ComponentRef Id='MyAddinComponent'/>         <Condition Level='0'><![CDATA[NOT ((VSTORUNTIME='#1') AND HASSHAREDPIA AND HASWORDPIA)]]></Condition>       </Feature>        <DirectoryRef Id='INSTALLDIR'>           <Component Id='MyAddinComponent' Guid='your component guid here'>               <File Name='MyAddin.dll' Source='path\to\MyAddin.dll' />               <File Name='MyAddin.dll.manifest' Source='path\to\MyAddin.dll.manifest' />               <File Name='MyAddin.vsto' Source='path\to\MyAddin.vsto' />               <RegistryKey Root='HKCU'                   Key='Software\Microsoft\Office\Word\Addins\MyAddin'                   Action='createAndRemoveOnUninstall'>                 <RegistryValue Type='string' Name='FriendlyName' Value='MyAddin Word 2007 Addin' />                 <RegistryValue Type='string' Name='Description' Value='MyAddin Word 2007 Addin' />                 <RegistryValue Type='string' Name='Manifest' Value='[INSTALLDIR]MyAddin.vsto|vstolocal' KeyPath='yes'/>                 <RegistryValue Type='integer' Name='LoadBehavior' Value='3'/>               </RegistryKey>           </Component>       </DirectoryRef>        <!-- Modify the install sequence to call our custom action -->       <InstallExecuteSequence>         <Custom Action='AddToInclusionList' After='InstallFinalize'><![CDATA[(&MyAddinComponent = 3) AND NOT (!MyAddinComponent = 3)]]></Custom>         <Custom Action='PropertyAssign_ManifestLocation' Before='AddToInclusionList'><![CDATA[(&MyAddinComponent = 3) AND NOT (!MyAddinComponent = 3)]]></Custom>         <Custom Action='RemoveFromInclusionList' After='InstallFinalize'><![CDATA[(&MyAddinComponent = 2) AND NOT (!MyAddinComponent = 2)]]></Custom>       </InstallExecuteSequence>     </Fragment> </Wix> 

    Hope that this saves some time for someone out there.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to deploy(ClickOnce Deployment) my web application which is developed in visual studio
If I want to deploy an ASP.NET application that hosts RIA Services endpoints for
I have a Java program/thread that I want to deploy into an Application Server
I want to deploy a Website which i have created using Microsoft Visual Studio
I want to deploy a Website which i have created using Microsoft Visual Studio
Say clients have v1.0.0.0 of my VSTO addin installed and I want to deploy
I want to deploy a C++ application that will run in enterprises where users
I want to deploy an application, that is currently deployed in Tomcat, in Glassfish
I have an asp.net 2.0 application that i want to deploy to a server.
I want to deploy the release version of my application done in C#. When

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.