Configuring MSBuild to Auto Update ClickOnce Installations
When we push an update to our ClickOnce application users would get a notification that the application has an update and are forced to have to click OK to accept the update. We don’t want this dialog box to show because it allows the user to Skip the update and it forces them to have to click OK to receive the update.
So I needed to figure out a way to force the update on our users, in order to do this I needed to set 3 properties when calling msbuild during our continuous integration process.
- MinimumRequiredVersion - Tells ClickOnce that when it updates this application it should update to this version (however this does not force ClickOnce to perform the update). As you can see we set this to the same version number that the ApplicationVersion is set to so that the MinimumRequiredVersion is always the latest version.
- UpdateMode=Foreground - Tells ClickOnce to update the application before it is opened.
- UpdateRequired=True - Tells ClickOnce to automatically perform the update.
When all 3 properties were set, the next time the user goes to open the application (via the shortcut in their start menu), ClickOnce will check for updates and automatically install the update while showing the progress indicator to the user. This forces the user to receive the updates and gives them visual notification that they are getting the updates.





