Click or drag to resize
UpdateControllerApplyUpdate Method
Applies the downloaded update represented by CurrentUpdate. If the update is applied, the application will shut down. If EnableAutoChaining is , applies all chained updates in sequence.

Namespace: Kjs.AppLife.Update.Controller
Assembly: Kjs.AppLife.Update.Controller (in Kjs.AppLife.Update.Controller.dll) Version: 5.1.0.9 (5.1.0.9)
Syntax
public bool ApplyUpdate()

Return Value

Type: Boolean
if one or more running instances of the application cancelled the shutdown request; otherwise, this method calls Environment.Exit and does not return.
Exceptions
ExceptionCondition
InvalidOperationException

CurrentUpdate was . To set CurrentUpdate, use CheckForUpdate, CheckForUpdateAsync, or ShowCheckForUpdateDialog.

-or-

The value of IsDownloaded was for CurrentUpdate. This value is set after DownloadUpdate, DownloadUpdateAsync, or ShowDownloadUpdateDialog completes.

-or-

IsBusy was .

-or-

The PublicKeyToken property was set to a public key from one of the Quick Start examples that comes with AppLife Update, and the application being updated is not the matching Quick Start.

ValidationException

The update could not be validated.

-or-

The update was not valid according to its signature obtained from director.xml and the key specified in PublicKeyToken.

Check InnerException for the error that occurred.

UpdateException

The update could not be applied.

Check InnerException for the error that occurred.

InstanceShutdownException

One or more running instances of the application did not respond to the controller's request to shut down (UpdateStarting).

-or-

All instances responded to the request to shut down, but at least one besides the current instance remains open and current instance is not running with administrative privileges.

Remarks

This method applies an update that has already been downloaded. Internally, it calls ValidateUpdate before applying the update. The update must have already been downloaded using DownloadUpdate, DownloadUpdateAsync, or ShowDownloadUpdateDialog.

This method raises the UpdateStarting event on the controllers in all running instances of the application. If any of those controllers set Response to CancelUpdate, this method returns and the update is not applied.

If the update process is started successfully, this method calls Environment.Exit and does not return.

See Also