The other day I was asked about the automatic Updates feature of VSTO 3.0 deployment. In this scenario, he used the Publish Wizard in VS 2008 to create a Word document solution and the install manifest. Then a bunch of people used the Word document, and kicked off the installer which then copied things to their ClickOnce cache. Everything worked fine. Then he needed to make changes to the code, recompile, and somehow get the solution to all of his customers. Instead of using the Publish Wizard to create the update in the same server, he chose to use a different server path. The customers were unable to install the updates. He tried editing the custom properties of the document to change the install path to the new server, but it still didn’t work. Then he tried testing with a new, clean computer, and on that computer he was able to install from the new path and use the new Word document. He asked us why were the “old” users unable to get the update?
This question shows up on the Forum occasionally. “Why can I not change the update location of VSTO v3 Add-in or Document once it is installed?” (Or) “Why does VSTO continue to check in the old location even after I change location property on client machines that installed the old version?”
The Path to the deployment manifest is used as part of the Identity for an Add-in. During the First installation of an Add-in or Document, the Full Path is set and stored by the VSTO Runtime for that client machine. Once you have installed an Add-in changing the path in the registration will cause the Add-in to throw an Error. Once you have installed a customized Document, the code-behind will only check the original location and changes to the path stored in the document will be ignored (this is to allow copying a local version of a customized document that you installed from a remote location). In order to change the location that an Add-in or Document checks for updates, you must First uninstall the “old” version on the installed clients and then install from the new location.
Now, if you want to delve deeper, then keep reading this paragraph, or skip to the next one. The low-level explanation is that ClickOnce uses the solution path as part of its identity when storing solutions into the ClickOnce cache. You will get similar behavior in a CO-deployed Windows Application as well _unless_ you use the deploymentProviderURL (DPURL). Setting the DPURL can allow WinForms applications to change where updates are pulled from so that Server A (from which a solution was original installed) can be decommissioned and updates can be retrieved from Server B. VSTO does not support DPURL. Why not, you ask? At the time we were considering it during the development of VS 2008, the amount of development work-months required was more than the time we had remaining (DPURL has implications on migration of data from old solution to new solution, for instance). After much discussion, we decided to have the ClickOnce team throw an exception of a DPURL is set for VSTO solutions. At the start of development for VS 2010, we considered this feature again, but again this feature did not make our list of highest priority deployment features. We are implementing a lot of new deployment features for VS 2010.
In conclusion, the solution Path is used as part of the identity. You can’t change the update path after you’ve installed an Office solution. In a Windows solution, you can change the update path using DPURL. VSTO doesn’t support DPURL because we couldn’t fit that feature in the development schedule. The workaround is to uninstall the solution from the user’s computer when it is stuck pointing to an old path that you can’t update anymore and then reinstall with a new Install Path set in the Publish wizard. We recommend that you set your Install Path to a URL that you predict can stay the same for as long as your users will need updates.
This explanation applies to Word document and template solutions, and to Excel spreadsheet and template solutions.
I hope this blog entry is helpful! Please leave comments to this article if you have feedback.
-Kris Makey, Jeff Young, Christin Boyd, Mary Lee and Saurabh Bhatia contributed to this blog post