ApplicationDeployment.UpdateCompleted Event

 

Occurs when ClickOnce has finished upgrading the application as the result of a call to UpdateAsync.

Namespace:   System.Deployment.Application
Assembly:  System.Deployment (in System.Deployment.dll)

member UpdateCompleted : IEvent<AsyncCompletedEventHandler,
    AsyncCompletedEventArgs>

The UpdateCompleted event is called on the main application thread. You may call your application's Windows Forms controls directly within this callback without triggering an exception.

Check the Error property of the AsyncCompletedEventArgs supplied to this callback. If this property is null, the installation was successful; if it is not null, the installation did not succeed, and you can find more information about this installation failure through the Error property. Once the update has been downloaded, you will need to call the Restart method on the Application to use the newer version of the application.

If the installation of the update was canceled by a call to UpdateAsyncCancel, the Cancelled property of the AsyncCompletedEventArgs class will be true.

To use this event handler, your application must import both the System.Deployment.Application and System.ComponentModel namespaces.

The following code example determines at application load time whether a new update is available; if a required update is available, it installs the update asynchronously. The example requires that you deploy a Windows Forms application that includes a StatusStrip control, and that this control contain a ToolStripStatusLabel control named downloadStatus.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 2.0
Return to top
Show: