Greetings.
This is not a question, but relates to my (successful!?) experience creating and installing an Excel add-in using VSTO, VS2005 Professional, VSTO 2005 SE for Windows XP and Office 2003 for multiple users. While this may be old news to some people, I haven't come across 'plain English' explanations of how to achieve this anywhere else.
I had heard that VSTO COM add-ins could not be installed for multiple users on XP (I am not sure if this is valid for Vista, but am soon to find out!). The "not a valid Office Add-in" dialog is not a sight I plan to see again, as I finally stumbled on the solution to a successful installation (of sorts) for my COM add-in for all users in Windows XP. While far from elegant, it satisfies the requirements of the application distribution until I can learn more about it and discover the 'right' way to go about creating the installer.
Requirements for Installation of a VSTO Add-in for multiple users on Windows XP:
- In the installer project, ensure that there are no unneccessary Registry Keys. The Keys I used to install are:
- HK_CURRENT_USER
- Software
- Classes
- CLSID (This key is setup by the installer)
- <CLSID Value>
- InprocServer32 (Values set by VS2005)
- ProgID (Values set by VS2005)
- Programmable (Values set by VS2005)
- VersionIndependentProgID (Values set by VS2005)
- MyProject
- CLSID
- (Default) = <CLSID Value>
- Microsoft
- Office
- Excel
- Addins
- MyProject
- CommandLineSafe = 1
- Decsription = "MyProject"
- FriendlyName = "MyProject"
- LoadBehavior = 3
- Manifest = "[TARGETDIR]MyProject.dll.manifest"
- If you have any other registry keys in your installer project, delete them. I found that the existence of any other keys caused my add-in to display the "not a valid Office add-in" dialog.
- User has to be logged in as an administrator on the local machine.
- If the add-in is already installed, uninstall it. You may be offered the choice of repairing the installation. Repairing did not work for me.
- Due to the uninstall not cleaning itself up properly, it does not delete existing registry keys for other users on the same machine.
- Re-installing does not affect functionality for other users on the same machine.
Administration of the Add-in:
- I have had to involve the Network Administrator in deployment on sites where Active Directory is being used (managed networks)
- The Network Administrator has to:
- give temporary administrative privileges to the logged in user to install the add-in
- log the User out after installation and revert security privileges to prior settings
Pros:
- COM Add-in works for all users on the same machine (provided they have run the installer).
Cons:
- Installation for each user is cumbersome for network administration.
- Updates mean that the add-in has to be reinstalled for every user of the add-in.
- "Run As" installations do not work - user has to be logged on with administrative privileges as the required registry keys do not get created for the Current User.