Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to register VSTO add-in from a Wix# MSI installer

I have built several Office add-ins (Excel, Word, PowerPoint and Outlook). I have also written a single Wix#-based MSI installer to install these add-ins. I have managed to do everything correctly but now I am puzzled how to register the add-ins.

One can do this interactively by double-clicking an accompanying VSTO file in Windows Explorer and it gets registered. Digging using RegEdit reveals that rundll32.exe "C:\Program Files\Common Files\Microsoft Shared\VSTO\vstoee.dll",InstallVstoSolution %1 is invoked.

One other method I found is to use utility VSTOInstaller.exe found in %CommonProgramFiles%\Microsoft Shared supplying it the correct command line.

Has anybody any experience in using Wix or Wix# and VSTO add-ins? Should I write a custom action to perform this or is there something Wix specific that needs to be done?

like image 469
wpfwannabe Avatar asked Aug 02 '10 12:08

wpfwannabe


People also ask

How do I create a VSTO add-in?

To create a new Excel VSTO Add-in project in Visual StudioUnder the expanded Office/SharePoint node, select the Office Add-ins node. In the list of project templates, select Excel 2010 Add-in or Excel 2013 Add-in. In the Name box, type FirstExcelAddIn. Click OK.

Can I use C# in WiX?

Wix# allows building complete MSI setups from a deployment specification expressed with C# syntax. The typical Wix# source file for building MSI contains plain-vanilla C# code, which uses a C# class structure to define (mimic) WiX entities.

Where are VSTO add-ins installed?

The required VSTO Add-in registry entries are located under the following registry keys where Root is HKEY_CURRENT_USER or HKEY_LOCAL_MACHINE depending if the installation is for the current user or all users.


1 Answers

It depends on which versions of Office you are targetting. I looked into calling the VSTOInstaller but I found it only registered for the current user. Below is a blog article that I wrote with additional links other blogs that helped me figure this all out. Basically I was able to reverse engineer what a vsto config file was doing and do it almost all in pure MSI/WiX with some custom actions to register certificates and generate random numbers for Office 2010.

VSTO Lessons Learned http://blog.deploymentengineering.com/2008/04/vsto-lessons-learned.html

Edit: That article was a couple years old and Office 2007 now "technically" supports HKLM AddIn registration as does Office 2010. Also the VSTOR runtimes have changed and there are some new bitness issues you might have to content with. An updated article is available:

Office 2010 Bitness Pain

like image 114
Christopher Painter Avatar answered Oct 27 '22 16:10

Christopher Painter