views:

195

answers:

1

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?

+1  A: 

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

Christopher Painter
Sorry for not mentioning this but I am targeting Office 2007 and 2010. As for interpreting VSTO files, I'd rather not to if I can. The rundll32 method seems quite nice but I am unsure how to plug it into Wix apart from using a custom action.
wpfwannabe
I updated my answer with a more recent article. You don't need to call VSTOInstaller. Just write out to the registry something like file://[INSTALLLOCATION]MyAddIn.vsto|vstolocal. If you install to ProgramFiles you don't have to back it up with a certificate.
Christopher Painter