Udostępnij za pośrednictwem


PackageManager.UpdatePackageAsync Method

Definition

Updates an installed Package or its dependency packages for the current user.

public:
 virtual IAsyncOperationWithProgress<DeploymentResult ^, DeploymentProgress> ^ UpdatePackageAsync(Uri ^ packageUri, IIterable<Uri ^> ^ dependencyPackageUris, DeploymentOptions deploymentOptions) = UpdatePackageAsync;
IAsyncOperationWithProgress<DeploymentResult, DeploymentProgress> UpdatePackageAsync(Uri const& packageUri, IIterable<Uri> const& dependencyPackageUris, DeploymentOptions const& deploymentOptions);
public IAsyncOperationWithProgress<DeploymentResult,DeploymentProgress> UpdatePackageAsync(System.Uri packageUri, IEnumerable<System.Uri> dependencyPackageUris, DeploymentOptions deploymentOptions);
function updatePackageAsync(packageUri, dependencyPackageUris, deploymentOptions)
Public Function UpdatePackageAsync (packageUri As Uri, dependencyPackageUris As IEnumerable(Of Uri), deploymentOptions As DeploymentOptions) As IAsyncOperationWithProgress(Of DeploymentResult, DeploymentProgress)

Parameters

packageUri
Uri Uri

The source URI of the main package.

dependencyPackageUris

IIterable<Uri>

IEnumerable<Uri>

The source URIs of the dependency packages.

deploymentOptions
DeploymentOptions

One of the permitted enumeration values. ForceApplicationShutdown and None are the only valid options for this method and specifying any other deployment option results in an E_INVALIDARG return value.

Returns

The status of the deployment request. The DeploymentResult contains the final returned value of the deployment operation, once it is completed. The DeploymentProgress can be used to obtain the percentage of completion over the entire course of the deployment operation.

Windows requirements

App capabilities
packageManagement

Remarks

An installed package can be updated only if the version of the update package is higher than that of the installed package. If no previous version of the package exists, the operation fails.

Applies to

See also