![Install Install](/uploads/1/2/5/5/125503083/337188124.png)
The following procedures show some code for performing a programmatic update and also describe how to configure your ClickOnce deployment to enable programmatic update checks. In order to update a ClickOnce application programmatically, you must specify a location for updates. This is sometimes referred to as a deployment provider.
We have a very large, very slow, distributed network. On the network we have a Main central server, as well as a smaller server at each individual site. Since we have slow lines, and our application is quite large (20MB) we cannot have all our client PC's (300+) installing/updating the application from the Main central server, so I create separate ClickOnce Deployments for each site respectively.
This allows the majority of our users to install/update the application over a fast LAN connection from their local server. However, the more sites we add the more cumbersome this gets since I have to publish a separate copy of the application for each and every site, each time making sure that I don't mess up the URL's etc. (This happens quite easily) Is there a way to change the Installation URL & the Update Location URL after publishing the application (preferably programmatically)? If this is possible, I will create a distribution system that uses a single ClickOnce deployment, modifies it for each server, and copies it to the correct location on each server. If this is not possible, I will have to continue publishing separate deployments per site and this will most probably force us in the longer run to re-invent the wheel altogether and stop using ClickOnce. When answering a question please:. Read the question carefully.
Understand that English isn't everyone's first language so be lenient of bad spelling and grammar. If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome. Don't tell someone to read the manual. Chances are they have and don't get it. Provide an answer or move on to the next question.
Let's work to help developers, not make them feel stupid.
Hi, You can create a cmd file and type the uninstall string. Then add a shortcut to this cmd file and put it to user’s program folder. Check this thread: To find the “uninstall string”, you could search it in the registry: You could also create a console application for this.
And put the execute file with the deploy project then create a shortcut or copy this file to the user’s program folder. (The first FAQ) By the way, there is an article tells create uninstall shortcut for clickonce: Hope this helps.
Best regards, Ling Wang This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet. Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question.
This can be beneficial to other community members reading the thread. Hi, You can create a cmd file and type the uninstall string.
Then add a shortcut to this cmd file and put it to user’s program folder. Check this thread: To find the “uninstall string”, you could search it in the registry: You could also create a console application for this. And put the execute file with the deploy project then create a shortcut or copy this file to the user’s program folder. (The first FAQ) By the way, there is an article tells create uninstall shortcut for clickonce: Hope this helps.
Best regards, Ling Wang This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you.
Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet. Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. This article is about handling certificate expiration, and it includes code to uninstall your ClickOnce app. You basically look for the uninstall string in the registry and then execute it.
![Programmatically Programmatically](/uploads/1/2/5/5/125503083/299277733.jpg)
One note - I've simplified this code since I first wrote it. Since we don't ever install multiple ClickOnce apps with the same product name, I don't bother checking for a matching product key token any more, I just check that the DisplayName in the uninstall string in the registry matches the ProductName of my app, and retrieve THAT uninstall string. (You'll see what I mean). Note that this also clicks the OK button for the user. RobinDotNet Microsoft MVP, Client App Dev.