4
votes

I´ve developed several VSTO add-ins for MS Office 2010. I need a way to register them from a C# program.

How can I do that?

2
This is not what I want to do, because I need to install multiple Add-Ins at once from an Application installer. - Van Coding
Then add it as answer ;) Is it possible to run those installers in background? - Van Coding

2 Answers

3
votes

To this registry key - HKCU\Software\Microsoft\Office\Word\Addins add your own RegistryKey with these values: (use Microsoft.Win32.RegistryKey class) Description (string) FriendlyName (string) Manifest (string) LoadBehavior (DWORD)

Manifest is absolute path to your VSTO addin + "|vstolocal" (for example: C:/myaddin.vsto|vstolocal)

LoadBehavior should be 3 - means: load at startup

FriendlyName and Description will be displayed in Word

But before first run of your addin you should execute your .vsto file (Notice that Visual Studio Tools for Office must be installed)

Process.Start("C:/myaddin.vsto");