ApplicationDeployment.CheckForDetailedUpdate Method
Assembly: System.Deployment (in system.deployment.dll)
'Declaration Public Function CheckForDetailedUpdate As UpdateCheckInfo 'Usage Dim instance As ApplicationDeployment Dim returnValue As UpdateCheckInfo returnValue = instance.CheckForDetailedUpdate
public UpdateCheckInfo CheckForDetailedUpdate ()
public function CheckForDetailedUpdate () : UpdateCheckInfo
Return Value
An UpdateCheckInfo for the available update.| Exception type | Condition |
|---|---|
| The current application is either not configured to support updates, or there is another update check operation already in progress. | |
| The deployment manifest cannot be downloaded. This exception will appear in the Error property of the CheckForUpdateCompleted event. | |
InvalidDeploymentException | The deployment manifest is corrupted. Regenerate the application's manifest before you attempt to deploy this application to users. This exception will appear in the Error property of the CheckForUpdateCompleted event. |
The following code example uses CheckForDetailedUpdate to retrieve the information about the latest update. If an update exists, it installs it automatically only if it is a required update; otherwise, it prompts the user.
Dim WithEvents ADLaunchAppUpdate As ApplicationDeployment Public Sub LaunchAppUpdate() If (ApplicationDeployment.IsNetworkDeployed) Then ADLaunchAppUpdate = ApplicationDeployment.CurrentDeployment End If End Sub Sub ADLaunchAppUpdate_UpdateCompleted(ByVal sender As Object, ByVal e As AsyncCompletedEventArgs) Handles ADLaunchAppUpdate.UpdateCompleted If Not (e.Error Is Nothing) Then MessageBox.Show("Could not install application update. Please try again later, or contact a system administrator.", "Application Update Error") Exit Sub Else If (e.Cancelled) Then MessageBox.Show("The application update has been cancelled.", "Application Update Cancelled") Exit Sub End If End If ' Process successful update. Dim dr As DialogResult = MessageBox.Show("The application has been updated. Restart?", "Restart Application", MessageBoxButtons.OKCancel) If (System.Windows.Forms.DialogResult.OK = dr) Then Application.Restart() End If End Sub
- PermissionSet For full access to the local computer. Associated enumeration: PermissionState
Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.