This example downloads and installs the update after checking that the application is network-deployed. The Update method does not update the application unless it is out of date. The application has to restart to use the update. For more information, see How to: Download ClickOnce Application Updates.
Sub UpdateApplication()
If My.Application.IsNetworkDeployed Then
My.Application.Deployment.Update()
End If
End Sub
Only applications that are ClickOnce deployed can be updated using the My.Application.Deployment object. For more information on deploying a ClickOnce application, see How to: Publish a ClickOnce Application.