PackageManager.RegisterPackageAsync method

Applies to Windows only

Registers a package (the main package) and its dependency packages for the current user.

Syntax


public IAsyncOperationWithProgress<DeploymentResult, DeploymentProgress> RegisterPackageAsync(
  Uri manifestUri, 
  IEnumerable<Uri> dependencyPackageUris, 
  DeploymentOptions deploymentOptions
)

Parameters

manifestUri

Type: System.Uri [.NET] | Windows::Foundation::Uri [C++]

The path to the package manifest of the main package.

dependencyPackageUris

Type: IIterable<Uri> [C++] | System.Collections.Generic.IEnumerable<Uri> [.NET]

The paths to the dependency packages. If there are no dependency packages or if the dependency packages are already registered, this parameter can be null. When DeploymentOptions is set to DevelopmentMode this parameter should be null.

deploymentOptions

Type: DeploymentOptions

One of the enumeration values.

Return value

Type: IAsyncOperationWithProgress<DeploymentResult, DeploymentProgress>

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.

Remarks

The registration operation can only be run if the package manifest is available on the local computer, not from a network path. In addition, unless you register a package with a DevelopmentMode option, the package payload must have been staged onto disk under %ProgramFiles%\WindowsApps. You can use PackageManager.StagePackageAsync to stage a package onto disk.

This API can't be called by SYSTEM.

Attempting to register a package with a DevelopmentMode option while a package with the same package family name is already installed or registered for any user on the computer using any of the DeploymentOptions values will return an error. Also, a DevelopmentMode package can only be installed for one user on a computer. If the second user tries to register another DevelopmentMode package with the same package family name an error results. If an error is encountered while registering a package in DevelopmentMode, check if you need to uninstall the package or the DevelopmentMode package (with the same package family name) installed for all other users on the computer.

Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

None supported

Namespace

Windows.Management.Deployment
Windows::Management::Deployment [C++]

Metadata

Windows.winmd

See also

PackageManager

 

 

Show:
© 2014 Microsoft