Word 2007 uninstall add-in for all users does not work RRS feed

  • Question

  • I have a Word 2007 add-in that installs for all users by creating registry entries in HKLM the installation works fine but unistalling does not work at all. It seems that the delete statement is ignored and the corresponding registry entries for the current users is not deleted as they should. It is Windows 7 32-bit enterprise edition that is is runned on.

    Installation registry entries:

    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\12.0\User Settings\SkanskaAddin]

    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\12.0\User Settings\SkanskaAddIn\Create\Software\Microsoft\Office\Word\Addins\SkanskaAddIn]
    "Description"="Skanska word Add-In"
    "FriendlyName"="Skanska Add-In"

    Uninstall regitry entries:

    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\12.0\User Settings\SkanskaAddin]

    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\12.0\User Settings\SkanskaAddin\DELETE]

    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\12.0\User Settings\SkanskaAddin\DELETE\Software]

    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\12.0\User Settings\SkanskaAddin\DELETE\Software\Microsoft]

    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\12.0\User Settings\SkanskaAddin\DELETE\Software\Microsoft\Office]

    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\12.0\User Settings\SkanskaAddin\DELETE\Software\Microsoft\Office\Word]

    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\12.0\User Settings\SkanskaAddin\DELETE\Software\Microsoft\Office\Word\Addins]

    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\12.0\User Settings\SkanskaAddin\DELETE\Software\Microsoft\Office\Word\Addins\SkanskaAddin]


    anyone having any idea why this is not working?


    /Urban Andersson


    Tuesday, August 9, 2011 3:20 PM


All replies

  • It's been awhile since I did this so my recall may not be 100%

    First thought is the Count number. That stays in the system so there needs to a mechanism that increments it on successive installs and uninstalls. Didn't see it in what you provided and maybe you already have that covered.

    Second thought is the Load Behavior setting. You uninstall the add-in via the control panel and that's when the Delete key is added to the Local Machine hive but the transfer to the Current User hive does not occur until the start of their next session and since the LoadBehavior on the add-in at the start of the next session is still "3" the add-in loads. Thus in addition to the Delete key I believe you need to also add a LoadBehavior value change to "2" for the add-in.  The LoadBehavior change impacts the first start of the host app after the uninstall and the Delete key removes the entries at the close of that 1st sesson or the start of the 2nd. I can't fully recall that delete moment right now.

    Kind Regards, Rich ...

    Wednesday, August 10, 2011 2:46 AM
  • I have already handle the count so it increments on install and uninstall. I added the loadbehavior set to 2 to the HKLM node(se below). Is that correct? However it did not make any difference. I still receive an error when starting word for the first time after uninstall. After first run the loadbehaivor is set to 2 by word because of that the load of the add-in fails(as it is uninstalled). Even though I start word after the loadbehaivor is set to 2 it is still there to be enabled thus the delete statements is ignored.


    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\12.0\User Settings\SkanskaAddin]




    Wednesday, August 10, 2011 8:02 AM
  • Hi Urban,


    Thanks for your post.


    Here is a workthrough which demonstrate how to deploy a VSTO add-in for all user by using Windows Installer:

    In this document, you will see that the author set the value of Manifest key to "[TARGETDIR]AddinName.vsto|vstolocal"

    And here is the explain for this setting:

    There are a few interesting notes on how the Visual Studio Tools for Office runtime locates the add-in. Visual
    Studio Tools for Office runtime searches for the deployment manifest indicated by the Manifest value. The
    [TARGETDIR] part is a macro that the Windows Installer expands to the actual folder where the add-in is
    installed. This macro expands to include the trailing \ character, so the filename of the deployment manifest is
    appended as ExcelAddIn.vsto without the \ character. Finally there is the use of the vstolocal postfix. This tells
    the Visual Studio Tools for Office runtime that the add-in should load from the location indicated by the
    Manifest value, and not loaded into the ClickOnce cache. Removing this postfix will cause the runtime to copy
    the customization into the ClickOnce cache.


    I have tested the workthrough and uninstall add-in in Control Panel, which works fine on my side. You can have a try it.


    I look forward to hearing of you.

    Best Regards, Calvin Gao [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, August 10, 2011 9:33 AM
  • Hi Calvin,


    This solution is for Office 2010 and to my understanding it is not applicable on 2007 unless you have a specific hotfix.



    Friday, August 12, 2011 2:39 PM
  • Hi Urban,

    Sorry for the late response.

    Yes, we need a hotfix to enable deploying VSTO application for all users.

    You can download this hotfix from:

    And here is the description for the known issue resolved in the hotfix:

    After install the hotfix, you can configure the Windows Installer part for all users according to these three blogs:

    I hope this helps.

    Best Regards, Calvin Gao [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, August 25, 2011 6:35 AM