1

I created a simple test program to try and understand how Click-Once deployment works and whether or not I can have the program automatically updated.

It is an excel add-in with a button in the ribbon that outputs some message box. I have the deployment location set to a public location on the network and updates set to check every time the customization runs. Great - I install the add-in, open Excel, it works fine. Now I go into visual studio and update and re-publish the add-in. Now when I open Excel I get an error that says an earlier version of this application is installed and cannot install the new one.

What do I need to do in order to get this to work? I see in the properties I can have a Pre-build event command line... so I am assuming maybe I need some sort of command line function to uninstall the old version before installing the new one? Not really sure how to go about doing this.

Adjit
  • 10,134
  • 12
  • 53
  • 98
  • I think this is a side effect of testing with the same computer you're developing with. I always have to open my published templates (mine is a document-level Word Add-In) twice after a publish - the first time it will do something like what you're describing, the second time it will work as expected. Other users do not have this issue. – Chris Sep 30 '16 at 19:40
  • @Chris I mean could be, because if I clean the solution from VS it will remove the program from the excel coms. But in any event, if I run the .vsto file in the deployment folder it will update the application.But now oddly, I have another add-in which never checks for updates and when I went to run the .vsto I got the previous version installed error. Does that have to do with the never check for updates? – Adjit Sep 30 '16 at 19:50
  • I imagine the error you are talking about is this one: http://stackoverflow.com/questions/1544210/installing-office-customization. I don't know the answer to your question but it may point you down a helpful path. – Chris Sep 30 '16 at 19:58

1 Answers1

0

This error is due to using the same computer in development and test. To test the update behaviour, here are the steps :

  • set the update parameter to "each time the program launch"
  • publish V1.0.1, and move the files to your webserver or other
  • publish v1.0.2, and save the files apart for the moment
  • Clean solution using Visual Studio
  • install v1.0.1 from your server
  • Move v1.0.2 to server (vsto + application files)
  • Run again your solution and see the update process going through :)
Victor
  • 767
  • 4
  • 17