tags:

views:

49

answers:

1

Currently in an application I'm building I have it check for updates, and it gives the user the option to install or not to install the updates. I want it to just automatically install the updates no matter what. How can I make this change?

+2  A: 

Automatic Updates

Choosing a ClickOnce Update Strategy (Making Updates Required)

One options is to set up automatic updates to your software and mark them as required by setting the minimum required version in your deployment manifest. You can set this in the properties dialog in Visual Studio, or through configuration with the following tag: <deployment install="true" minimumRequiredVersion="1.0.0.0">. The minimum required version checks the version of your assembly, and if it is not at least what you specify here it will force an update.

Programmatic Updates

How to: Add On-Demand Programmatic Update

Another option that will allow you more control of when and how often the update occurs is to do the updates programmatically. You can use the ClickOnce API to check for any updates on the deployment server and install them once your application has been run. You can have far more control over what updates should be installed, how they are installed, and how you notify the user of the updates. If your application is generally a long running instance, you could also set up timers to run in the background every so often to do the updates as well.

Here is an example implementation that polls on an interval: Example.

You can also combine the above two update methods.

JD Courtoy
I believe setting the minimum required version will give the user the option to upgrade, or close the app.
Nate Bross
Is there an way to automatically set the minimum required version to the most current version, or do you have to manually change this value each time you publish a new version?
Soo
I've appended the answer with another option for you to look at. You could create build tasks that automatically update the minimum required version within the ClickOnce deployment manifest for you as part of your build / deployment process as well.
JD Courtoy
Nate -- it does not give the user any chance to say yes or no, it just installs the update.
RobinDotNet
Soo -- no, but that is a feature request I have turned in to the ClickOnce product team.
RobinDotNet