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.
views:
274answers:
1In 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. Step 1 - Check the deployment location for updates and persist the information about what it finds to the local ClickOnce update cache. Step 2 - Check the local ClickOnce update cache and prompt the user with the update window if there an update is indicated. 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 (CheckForDetailedUpdate(persistUpdateCheckResult)) and set the parameter to false (CheckForUpdate(false) or CheckForDetailedUpdate(false)).