We have developed a product that is a standard VSTO addin (Word 2010 and Word 2013, x86 only). By default when it is installed, it is installed for all users (ie. the addin registry entries are inserted into HKLM - HKEY_LOCAL_MACHINE\SOFTWARE\[Wow6432Node]\Microsoft\Office\Word\Addins
).
When the value for the LoadBehavior
reg key is set to 0x3
(i.e. "Load at Startup"), the addin works perfectly fine, however when we set the value for LoadBehavior
to 0x10
(i.e. "Load on demand"), the addin does not work as we would expect:
Due to UAC (and that Word does not run elevated), the value of LoadBehavior
in HKLM is not changed from 0x10
to 0x9
but instead is overridden by creating a LoadBehavior
key (with value 0x9
) in the HKCU hive.
Unfortunately, we have found that this HKCU overridden value is not taken into account unless the Manifest key is present in the HKCU hive along with LoadBehavior
). More info on this related thread: https://social.msdn.microsoft.com/Forums/vstudio/en-US/3776734b-333e-423b-9c08-7c7a441c3e94/load-behavior-and-word-addin?forum=vsto
The 'obvious' remedy for this issue is to write the Manifest
into HKCU for each user (as well as in HKLM) at install time OR when each user run the addin the first time. There are however some serious drawbacks with this approach:
- Uninstalling the addin requires removing every user HKCU values to prevent users experiencing loading issues (this is not recommended and poses other issues/complications such as the need to use Active Setup - Remove registry keys under HKCU on a per machine installation).
- Users which have these values in their (roaming) HKCU hive, experience issues when they login to a machine in the same domain which does not have our addin installed.
Is it a bug that the manifest is not obtained from HKLM where the LoadBehavior
is set appropriately in HKCU? I think this issue would be resolved if the LoadBehavior
in HKLM could be overridden in HKCU without the need for the Manifest
value to be overridden as well.
Anyone knows of a way to overcome this issue?
LoadOnDemand
is not because we have a slow add-in, but it is because we have lots and lots of add-ins that are all business critical. These compete for resources and often "conflict" and error if loaded at the same time. Alas we have to live in a world where we cannot change other's add-ins, and when you have as many as most of our clients do, you cannot ask them all to improve their load. – Apocrypha