How to: Check for ClickOnce Application Updates
This example uses the My.Application.Deployment object to check for available updates to the application. If the application was deployed as a ClickOnce application, the example displays appropriate user interface (UI) text.
For more information on ClickOnce applications and how to deploy them, seeand .
This example uses theto make sure that the application is deployed from a network using ClickOnce. Then it uses the method of the My.Application.Deployment object to check if a ClickOnce update is available for the application.
Sub CheckUpdateAvailability() If My.Application.IsNetworkDeployed() Then If My.Application.Deployment.CheckForUpdate() Then MsgBox("Update is available for download") Else MsgBox("No updates are available for download") End If Else MsgBox("Application is not ClickOnce deployed") End If End Sub
Only applications that are deployed using ClickOnce can be updated using the My.Application.Deployment object. For more information on deploying a ClickOnce application, see.