Excel User Group
Microsoft Excel blogs, forums, files. Read, ask questions, provide answers.

VSTO Add-in Installation - Multiple Users

Latest post Fri, Aug 22 2008 3:36 AM by Nick Hodge. 1 replies.
  • Fri, Aug 22 2008 1:41 AM

    • Mattheq
    • Top 25 Contributor
    • Joined on Wed, Apr 23 2008
    • Perth, Australia
    • Posts 15
    • Points 219

    VSTO Add-in Installation - Multiple Users

    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.

    Regards, Matthew

    Filed under: ,
    • Post Points: 21
  • Fri, Aug 22 2008 3:36 AM In reply to

    • Nick Hodge
    • Top 10 Contributor
    • Joined on Sun, Dec 23 2007
    • Southampton
    • Posts 297
    • Points 4,959
    • MVP

    Re: VSTO Add-in Installation - Multiple Users

    Matthew

    Thanks for stopping by with that. To give it as much visibility as possible I will post a link on my blog to.

    Useful stuff Yes

    Thanks

    Regards
    Nick Hodge
    Microsoft MVP, Excel
    Southampton, UK

    Filed under: , ,
    • Post Points: 5
Page 1 of 1 (2 items) | RSS
Copyright Excel User Group and the relevant contributors, 2008. All Trade Marks acknowledged. This site is a peer-to-peer site and NOT affiliated in any way to Microsoft Corp. All rights reserved.