Click or drag to resize
UpdateControllerApplyUpdate Method (ApplyUpdateOptions, IDictionary)
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(
	ApplyUpdateOptions options,
	IDictionary initialSharedProperties
)

Parameters

options
Type: Kjs.AppLife.Update.ControllerApplyUpdateOptions
A combination of ApplyUpdateOptions values that specifies the behavior of the update process.
initialSharedProperties
Type: System.CollectionsIDictionary
A set of initial values for the shared properties used in the update, or to leave all shared properties uninitialized.

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. To prevent exiting, use the NoShutdown flag.
Exceptions
ExceptionCondition
InvalidEnumArgumentExceptionoptions represents a combination of flags not defined in the ApplyUpdateOptions enumeration.
ArgumentExceptionoptions contains both the NoUpdateWindow and AutoClose values.
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.

If initialSharedProperties is specified, the dictionary and all keys and values in it must be serializable types referenced in the update. For example, using a Hashtable for the dictionary and strings for the keys and values will work, but using a value that is an instance of a custom type in the current application will only work if the assembly containing that type is part of the update and included as a reference (either as a custom action assembly or as a dynamic action reference).

To access values in initialSharedProperties from Set Shared Property actions or in Action Conditions, their keys must be strings.

See Also