C# VSTO Outlook 2007: Strange difference between HKLM and HKCU
I developed a VSTO Outlook 2007 Addin.
When I register the .dll into the GAC and create the registry key in
HKEY_CURRENT_USER\Softwar开发者_Go百科e\Microsoft\Office\Outlook\Addins\<myAddin>
LoadBehavior 3
etc,
everything works great, the plugin works really perfect.
But when I want to share my Addin with All Users, I create the registry key here:
HKEY_LOCAL_MACHINE\Software\Microsoft\Office\Outlook\Addins\<myAddin>
(not in HKCU)
and run Outlook 2007, the Plugin not loaded and the LoadBehavior is set from 3 to 0. (by Outlook)
I try to set the HKLM and HKCU keys to same value but it will not work. The addin works ONLY when the HKLM key is not set and the plugin is registered only in HKCU.
Where is the problem? :-) Thx.
Office 2007 doesn't support HKLM registration of add-ins by design. In order to make Office 2007 support HKLM, you need to apply the following patch:
http://support.microsoft.com/kb/976811/en-us
To deploy a VSTO addin for Office 2007 for all users, you have two options:
- have the users install the patch code4life writes about, and
- use Office's internal HKLM->HKU replication mechanism.
Caveats:
- you may not redistribute the patch, and I doubt whether you may include it in your bootstrapper;
- AFAIK the replication mechanism is not officially supported.
精彩评论