I am trying to install a word add-in for all users on a machine using the below command.
msiexec.exe /i "path-to-msi.msi" ALLUSERS=1 /qn
The add-in is available in WORD for the user who logged in to install the add-in. But when a different user logged in, the add-in is not available.
When the add-in is installed, the registry entries are created in HKEY_LOCAL-MACHINE and also the HKEY_CURRENT_USER for the user that installed the add-in.
Since WORD seems to reading the registry only from HKEY_CURRENT_USER and the other users does not have the registry entries created in HKEY_CURRENT_USER, the add-in does not display in WORD.
Why is WORD ignoring HKEY_LOCAL-MACHINE ? Alternatively, how can the msi create the registry entries in HKEY_CURRENT_USER for all the users ?
Microsoft Office locates Add-ins by using registry keys. The keys in the HKEY_CURRENT_USER hive are used to register the add-in for each individual user. The keys under the HKEY_LOCAL_MACHINE hive are used to register the add-in for all users of the machine. For more information about registry keys, see Registry entries for VSTO Add-ins.
Since WORD seems to reading the registry only from HKEY_CURRENT_USER and the other users does not have the registry entries created in HKEY_CURRENT_USER, the add-in does not display in WORD.
You are on the wrong avenue. All Office applications read the windows registry keys form the HKLM hive. You need to make sure that your COM add-in windows registry keys were added to the correct place.
If the installer is targeting all users on 64-bit Windows, it is recommended that it includes two registry entries, one under the HKEY_LOCAL_MACHINE\Software\Microsoft
and one under the HKEY_LOCAL_MACHINE\Software\WOW6432Node\Microsoft
hive. This is because it's possible for users to use either 32-bit or 64-bit versions of Office on the computer.
If the Installer is targeting the current user, it doesn't need to install to the WOW6432Node
because the HKEY_CURRENT_USER\Software
path is shared. For more information, see 32-bit and 64-bit Application Data in the Registry.
You can add the required windows registry keys by using the built-in editor in VS, see To configure the registry. Also you may consider creating a custom action where all the required keys can be added.