40

Name: From: file:///D:/Samples/TestUpdatedVersion/bin/Debug/TestUpdatedVersion.vsto

The customization cannot be installed because another version is currently installed and cannot be upgraded from this location. To install this version of the customization, first use Add or Remove Programs to uninstall this program: TestUpdatedVersion. Then install the new customization from the following location: file:///D:/Samples/TestUpdatedVersion/bin/Debug/TestUpdatedVersion.vsto

************** Exception Text ************** Microsoft.VisualStudio.Tools.Applications.Deployment.AddInAlreadyInstalledException: The customization cannot be installed because another version is currently installed and cannot be upgraded from this location. To install this version of the customization, first use Add or Remove Programs to uninstall this program: TestUpdatedVersion. Then install the new customization from the following location: file:///D:/Samples/TestUpdatedVersion/bin/Debug/TestUpdatedVersion.vsto at Microsoft.VisualStudio.Tools.Applications.Deployment.ClickOnceAddInDeploymentManager.VerifySolutionCodebaseIsUnchanged(Uri uri, String subscriptionId, Boolean previouslyInstalled) at Microsoft.VisualStudio.Tools.Applications.Deployment.ClickOnceAddInDeploymentManager.InstallAddIn()

skaffman
  • 398,947
  • 96
  • 818
  • 769
user187229
  • 401
  • 1
  • 4
  • 4
  • 1
    Have documented the step by step process that i followed to fix it after searching heavily from internet over here http://censore.blogspot.in/2015/12/fixing-deploymentaddinalreadyinstallede.html – biplav Dec 14 '15 at 20:43

10 Answers10

66

You can try to delete a registry key located at:

HKEY_CURRENT_USER\Software\Microsoft\VSTA\Solutions\{GUID}

The value of {GUID} will be different on your environment.

Check to ensure that you're deleting the right key. Confirm by checking the DWORD "Url" value at the key.

Restart Excel and you should be good to go.

Charles Chen
  • 1,395
  • 13
  • 22
  • 1
    I've tried all sort and haven't seen this solution anywhere else but it worked perfectly. Thanks. – djskinner Feb 27 '13 at 09:36
  • Literally a copy paste from: https://answers.microsoft.com/en-us/windows/forum/windows_xp-windows_programs/the-customization-cannot-be-installed-because/43538a96-1dbc-406f-9432-bd470ba57709 . – Brandon Barney Aug 04 '17 at 19:32
  • 2
    @BrandonBarney that's because they were both posted by me. I thought this was useful enough that once I solved the issue I posted the answer everywhere I came across the problem. The original issue was solved by using ProcMon to trace the registry reads for the plugin. Check out my site: http://www.charliedigital.com. – Charles Chen Aug 06 '17 at 13:38
  • @CharlesChen My bad, I completely missed that you were the author on the other one too. Well deserved then :). – Brandon Barney Aug 06 '17 at 21:17
  • 1
    amazing. we looked everywhere for this to solve an install problem. voila. in our case, was because a vsto add-in clickonce install was being blocked by webroot virus protection partway through the install. spent forever debugging and this was the ultimate answer. thanks so much! – gotmike Oct 10 '17 at 20:05
16

This error should only occur on your development machines.

From Microsoft's Troubleshooting guide for office deployments (http://msdn.microsoft.com/en-us/library/bb608594.aspx):

When you build an Office solution, the built version is automatically registered. If you have previously published and installed the same solution to your development computer, Visual Studio Tools for Office runtime detects that the installation path for the published version and the built version are different after the next build, rebuild, or publish. The error message says "the customization cannot be installed because another version is currently installed and cannot be upgraded from this location." Because rebuilding the solution updates the registry keys, it is necessary to uninstall the first version before publishing, debugging, or running the second version.

To prevent the message from appearing, create another user account on your development computer to test your deployment. Alternatively, you can uninstall the version from the list of installed programs on the computer before you next publish, debug, or rebuild the solution.

Aaron
  • 1,454
  • 3
  • 22
  • 29
  • i get it on test machines when I am deploying multiple versions in a short period of time. I uninstall before each install, but yet i get this occassionally. – greg Nov 21 '17 at 20:41
  • With the "bin\debug" in the error message, I figured VS was doing something like this. Makes it harder to debug my addin's on demand ClickOnce upgrade. – Chris Bordeman Jan 20 '19 at 11:31
9

try this link , you have a command to run in this page,just run it the problem will be fixed. command:

rundll32 dfshim CleanOnlineAppCache

See this link: How do I completely uninstall a ClickOnce application from my computer?

Community
  • 1
  • 1
bharath
  • 91
  • 1
  • 1
  • 1
    also `mage -cc` will accomplish this. easier to remember. It may only be available in the [Visual Studio Command Prompt](http://msdn.microsoft.com/en-us/library/ms229859(v=vs.110).aspx) though – OtotheA Oct 15 '14 at 23:24
  • "rundll32 dfshim CleanOnlineAppCache" works without installing Mage. Much better for app engineers. And you don't have to remember where it's installed. – Chris Bordeman Jan 20 '19 at 11:36
6

We have a number of products using VSTO on Office 2007, Office 2010 and Office 2013 on various Windows versions. The Deployment.AddInAlreadyInstalledException occurs often during deployments. The problem seems to occur especially on PCs with many install/deinstall cycles (such as of IT personnel itself). Often leaving me with gray or no hairs, since a re-install is not always easily possible and the source is unclear.

As there is not a silver bullet to fix any source of the problem (other than reinstalling Windows), I have gathered experiences in a blog post on steps to resolve AddInAlreadyInstalledException

Maybe this helps other users of VSTO and Microsoft Visual Studio.

Guido Leenders
  • 4,232
  • 1
  • 23
  • 43
  • This worked for me. Just took a minute or two to use the Windows Add/Remove software feature. https://documentation.invantive.com/notes/webhelp/invantive-notes-deployment-addinalreadyinstalledexception.html – user8597 Jan 31 '20 at 19:29
3

This error can show up if you are trying to install/update a VSTO AddIn on the same machine where you've developed it, and it's caused by Visual Studio.

Whenever you build your AddIn in Visual Studio, it updates the registry key used by the AddIn thus breaking any install that you've done.

HKEY_CURRENT_USER\Software\Microsoft\Office\<Application>\Addins\<YourAddIn>\Manifest

The solution is to add a post-build event that would restore/set the registry key to the correct value. For example, if your AddIn is configured to be installed/updated from <YourPublishLocation>, the post-build event should be similar to:

REG ADD "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\<Application>\Addins <YourAddIn>"
/v "Manifest" /d "<YourPublishLocation>" /f
Eduard
  • 31
  • 1
  • 2
1

Try uninstalling the previously installed VSTO application OR from the visual studio menu > Build | Clean Solution.

Michael Regan
  • 1,568
  • 16
  • 17
  • 1
    We should not uninstall the previous version of VSTO, application should take care about this, because samething is working with windows application. After Visual Studio Menu>Build|Clean solution, same error is I am getting. – user187229 Oct 13 '09 at 06:02
1

On development machine, on which I had built the VSTO Project in Visual Studio with the same Product Version / identity, I needed to execute Clean command by selecting the Project in Solution Explorer. In fact, this helped clear the registry entry, referred to above.

That allowed me to re-install the product with same application identity

0

I was testing deployment after making the addin setup and facing the same problem when trying to install.

Issue: When you do a publish or debug the addin, VS would create/update the registry with this addin info under

HKEY_CURRENT_USER\Software\Microsoft\Office\Excel\Addins\<you addin name>\Manifest

this has the reference to the VSTO file that would be compared for doing upgrade. In your case, after you do publish, it would be pointing to

file:///D:/Samples/TestUpdatedVersion/bin/Debug/TestUpdatedVersion.vsto

Change this to your published vsto path. Now try to install, should work fine. You can test your auto upgrade options the same way, i.e. make a build+publish and change this path, then close all excels and open one.

maicalal
  • 101
  • 1
  • 8
0

I had the same problem when deploying a new version of our VSTO word addin. After fiddling for 2 hours I found out that the Installation folder URL that you set in the properties of the solution (where it upgrades from) is case sensitive and stupidly needs to be the same case as the initial installation URL.

woggles
  • 7,444
  • 12
  • 70
  • 130
0

What helped me in this issue was uninstalling the plugin from Control-M which I installed from my Published folder. And Clean the solution.

Himel
  • 1
  • 1