We have a WPF application deployed using ClickOnce which checks for and performs updates programmatically on application startup. This generally behaves perfectly except for the case where the user chooses “No” to our “Do you wish to update?” prompt. In this case, the next time the user launches the application (consistently) the ClickOnce framework’s “Update Available” dialog launches with the option to update or skip. This doesn’t cause a technical problem but will be confusing to the user to potentially see two completely differently styled dialogs. (If the user chooses Skip to the ClickOnce dialog then the application then launches and renders our own “Update Available” dialog). Any ideas why the ClickOnce framework dialog is showing in this case? Thanks.
We have a WPF application deployed using ClickOnce which checks for and performs updates
Share
In the Updates dialog (which is in the Publish tab), do you have the boxes unchecked for checking for updates?
[EDIT 6/18/2010] Here’s some more information that I think will fix your problem.
The
CheckForUpdate()andCheckForDetailedUpdate()methods persist the results of the update check to disk. The next time the application runs, the ClickOnce mechanism sees that an update is available and prompts the user with the unwanted window.Apparently the update is a two step process:
Unchecking “The application should check for updates” option seems to only cause ClickOnce to skip Step 1. Step 2 still occurs.
The
CheckForUpdate()andCheckForDetailedUpdate()methods have the same effect as Step 1 – the data is persisted to disk, so the next time the application is run, Step 2 sees the update and displays the update window.The trick is prevent
CheckForUpdate()andCheckForDetailedUpdate()from persisting this information to disk. This can be done by using the parametered overload (CheckForUpdate(bool persistUpdateCheckResult)orCheckForDetailedUpdate(bool persistUpdateCheckResult)) with the parameter set tofalse(that is,CheckForUpdate(false)orCheckForDetailedUpdate(false)).