How to deploy and debug Office 2010 - 2000
add-in / plug-in in VB.NET, C#, C++ - tips
Add-in Express™ |
| RegisterForAllUsers = True | RegisterForAllUsers = Flase |
| [ProgramFilesFolder][Manufacturer]\[ProductName] | [AppDataFolder][Manufacturer]\[ProductName] |
All other Office extensions can be installed for the current user only.
Updating on the fly
It isn't possible to update an Office extension on the fly. That's because Office loads the extension and to unload it and free its resources, you have to close the host application(s) of the extension.
User Account Control (UAC) on Vista, Windows 7 and Windows Server 2008
The User Account Control (UAC) should be turned on Vista; it should be set to the default level on windows 2008 Server and Windows 7. This is necessary when you install a COM add-in for all users on the PC, that is, when the RegisterForAllUsers property of the add-in module is true. Note that when UAC is off, a per-user add-in (RegisterForAllUsers = false) installed by an administrator will not work. This is restriction of systems with UAC.
Deploying Word add-ins
If your add-in delivers custom or customizes built-in command bars in any Word version, it isn't recommended setting the RegisterForAllUsers property of the add-in module to True. Since Word saves custom command bars and controls to normal.dot, every user has its own copy of command bars saved to their normal.dot. And when the administrator uninstalls the add-in, the command bars will be removed for the administrator only. See also Word add-ins, command bars, and normal.dot and How command bars and their controls are created and removed?
InstallAllUsers property of the setup project
The InstallAllUsers property sets the default state of the "Install {setup project title} for yourself, or for anyone who uses this computer" group of option buttons (they are "Everyone" and "Just me") in the installer. This group, however, is hidden by the executable mentioned in the PostBuildEvent property of the setup project generated by Add-in Express. This is done because to install your Office extension for all users on the machine you need to use the RegisterForAllUsers property of the corresponding module (add-in module, RTD module, etc.). To find that property, open the module's designer, click its surface and see the Properties window. See also Deploying Word add-ins.
Deploying add-ins - shadow copy
The Add-in Express Loader uses the ShadowCopy-related properties and methods of the AppDomain class. When you run your Add-in Express based add-in, the host application loads the Add-in Express Loader DLL referenced in the registry. The Add-in Express Loader DLL does the following:
- It finds your add-in DLLs in the DLL Cache. If there are no add-in DLLs in the cache it copies all .NET DLLs to the cache (including dependencies). The cache folder is located in c:\Documents and Settings\<user name>\Local Settings\Application Data\assembly\dl<number>. If all add-in DLLs (including dependencies) already exist in the cache, it compares their versions. If the versions are not the same, it copies new DLLs to the cache.
- It loads the add-in DLLs from the cache.
You can see how the add-in versioning influences the add-in loading. This approach (it is built into .NET, as you see) allows you to replace add-in DLLs when the add-in is loaded. The disadvantage is numerous files located in the cache. As far as we know, Microsoft doesn't provide a solution for this problem. You may think you can remove these files in an add-in's uninstall custom action. But you remove the files from the current profile only.
Deploying - "Everyone" option in a COM Add-in MSI package
The Everyone option of the MSI installer doesn't have any effect on the Add-in Express based COM add-ins and RTD servers. See also InstallAllUsers property of the setup project.
Deploying Office extensions
Make sure that Windows and Office have all updates installed: Microsoft closes their slips and blunders with service packs and other updates. Keep an eye on Visual Studio updates, too.
If you deploy a per-user Office extension such as a per-user COM add-in or RTD server having RegisterForAllUsers= False in their modules as well as an Excel UDF or smart tag) and no pre-requisites requiring administrative permissions are used, a standard user can install the Office extension by running the .MSI file. If you deploy a per-machine Office extension (a COM add-in or RTD server having RegisterForAllUsers= True in their modules) or if prerequisites requiring administrative permissions are used, an administrator must run the bootstrapper (setup.exe).
Note that if a standard user runs setup.exe on Vista, Windows 7 or Windows 2008 Server with UAC turned on, the elevation dialog may pop up and this may end with installing the add-in to the admin profile. In such a case, the add-in will not be available for the standard user. But on the other hand, this installs pre-requisites and makes possible installing the Office extension for the standard user by running the .MSI file.
ClickOnce application cache
The cache location is visible in the COM Add-ins dialog. It may have the following look:
C:\Documents and Settings\user\Local
Settings\Apps\2.0\NCPNO3QK.0KJ\ONNRMXC3.ALM\add-..d-
in_5c073faf40955414_0001.0000_2a2d23ab74b720da
Currently, we don't know if there is a decent way to clear the cache. Read more about deploying Office add-ins with Add-in Express ClickOnce solution.
ClickOnce deployment
Make sure that your IIS is allowed to process .application files. For instance, on one of our PCs, we had to edit the urlscan.ini file created by UrlScan. The only change was adding the .application extension to the AllowExtensions list. The full file name is C:\WINDOWS\system32\inetsrv\urlscan\urlscan.ini.
Customizing dialogs when updating the add-in via ClickOnce
ClickOnce doesn't provide any opportunity to customize or hide dialogs and messages shown while the user updates your add-in.
Note. If you didn't find the answer to your questions on this page, please see the HOWTOs section:
- VB .NET how to for Outlook, Excel, PowerPoint
- C# how to for Outlook, Excel, Word
- C++ how to for Outlook, Excel




