Reputation: 5283
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.
Upvotes: 3
Views: 1875
Reputation: 11877
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()
and CheckForDetailedUpdate()
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()
and CheckForDetailedUpdate()
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()
and CheckForDetailedUpdate()
from persisting this information to disk. This can be done by using the parametered overload (CheckForUpdate(bool persistUpdateCheckResult)
or CheckForDetailedUpdate(bool persistUpdateCheckResult)
) with the parameter set to false
(that is, CheckForUpdate(false)
or CheckForDetailedUpdate(false)
).
Upvotes: 7
Reputation: 1
CheckForUpdate
or CheckForDetailedUpdate
methods should be called with parameter false
.
The intellisense
documentation for these methods is confusing.
Upvotes: 0