Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

PackageManager class

Manages the software available to a user.

Important  You can't use this class in a Windows Store app.
 

Syntax


public sealed class PackageManager

Members

The PackageManager class has these types of members:

Constructors

The PackageManager class has these constructors.

ConstructorDescription
PackageManager Creates and initializes a new instance of the object.

 

Methods

The PackageManager class has these methods. It also inherits methods from the Object class.

MethodDescription
AddPackageAsync(Uri,IIterable(Uri),DeploymentOptions) Adds a package (the main package) and its dependency packages for the current user, using the specified deployment options.
AddPackageAsync(Uri,IIterable(Uri),DeploymentOptions,PackageVolume) Adds a package (the main package) and its dependency packages to the specified volume for the current user, using the specified deployment options.
AddPackageVolumeAsync Creates a new volume. The caller must be a member of the administrators group.
CleanupPackageForUserAsync Cleans up a specified package for a specified user. Used to cleanup packages installed for a user after their user profile is deleted.
ClearPackageStatus Clears the status of a package.
FindPackage Retrieves information about the specified package installed for any user.
FindPackageForUser Retrieves information about a specific package installed for a specific user or for all users.
FindPackages Retrieves information about a specified family of packages installed across all users.
FindPackages(String) Retrieves information about a specified family of packages installed across all users.
FindPackages(String,String) Finds all installed packages with the specified name and publisher.
FindPackagesForUser(String) Finds all packages installed for the specified user.
FindPackagesForUser(String,String) Retrieves information about a specified family of packages installed for a specific user.
FindPackagesForUser(String,String,String) Retrieves information about all packages with the specified package name and publisher name, installed for a specific user.
FindPackagesForUserWithPackageTypes(String,PackageTypes) Finds packages of specific types that are installed for the specified user.
FindPackagesForUserWithPackageTypes(String,String,PackageTypes) Retrieves information about a specified family of packages and of specific types that are installed for the specified user.
FindPackagesForUserWithPackageTypes(String,String,String,PackageTypes) Retrieves information about packages of specific types with the specified package name and publisher name, installed for a specific user.
FindPackagesWithPackageTypes(PackageTypes) Retrieves information about specific package types that are installed across all users.
FindPackagesWithPackageTypes(String,PackageTypes) Retrieves information about a specified family of packages and specific package types that are installed across all users.
FindPackagesWithPackageTypes(String,String,PackageTypes) Finds all installed packages of specific types with the specified name and publisher.
FindPackageVolume Gets the specified volume.
FindPackageVolumes Gets all the known volumes, regardless of their current state.
FindUsers Finds the users who have installed the specified package.
GetDefaultPackageVolume Gets the default package volume, which is the target of deployment operations such as the AddPackageAsync method.
GetPackageVolumesAsync Gets the package volumes on the device.
MovePackageToVolumeAsync Moves the specified package to the specified volume using the specified deployment options.
RegisterPackageAsync(Uri,IIterable(Uri),DeploymentOptions) Registers a package (the main package) and its dependency packages for the current user, using the specified deployment options.
RegisterPackageAsync(Uri,IIterable(Uri),DeploymentOptions,PackageVolume) Registers a package (the main package) and its dependency packages on the specified volume for the current user, using the specified deployment options.
RegisterPackageByFullNameAsync Registers a package (the main package) by its full name and its dependency packages for the current user.
RemovePackageAsync(String) Removes a package for the current user asynchronously and receives progress and status messages on the removal operation.
RemovePackageAsync(String,RemovalOptions) Removes a package for the current user asynchronously and receives progress and status messages on the removal operation.
RemovePackageVolumeAsync Removes the specified volume.
SetDefaultPackageVolume Sets the default package volume, which is the target of deployment operations such as the AddPackageAsync method.
SetPackageState Sets the state of a package, for example, to usable, tampered with, and so on.
SetPackageStatus Sets the status of the specified package.
SetPackageVolumeOfflineAsync Sets the specified volume to an offline state. The caller must be a member of the administrators group.
SetPackageVolumeOnlineAsync Sets the specified volume to an online state. The caller must be a member of the administrators group.
StagePackageAsync(Uri,IIterable(Uri)) Stages a package to the system without registering it.
StagePackageAsync(Uri,IIterable(Uri),DeploymentOptions) Stages a package to the system without registering it.
StagePackageAsync(Uri,IIterable(Uri),DeploymentOptions,PackageVolume) Stages a package to the system without registering it.
StageUserDataAsync(String) Stages a package's roaming data to the system without registering the package. Call this method after staging the package but before registering the package for a particular user.
StageUserDataAsync(String,DeploymentOptions) Stages a package's roaming data to the system without registering the package. Call this method after staging the package but before registering the package for a particular user.
UpdatePackageAsync Updates an installed package or its dependency packages for the current user.

 

Requirements (Windows 10 device family)

Device family

Universal, introduced version 10.0.10240.0

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

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

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

Windows 8 [desktop apps only]

Minimum supported server

Windows Server 2012 [desktop apps only]

Minimum supported phone

None supported

Namespace

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

Metadata

Windows.winmd

Attributes

[MarshalingBehavior(Agile)]
[Threading(Both)]
[Version(0x06020000)]
[WebHostHidden()]

See also

Object
Samples
Add app package sample
Enumerate app packages sample
Enumerate app packages by name and publisher sample
Enumerate app packages by user SID sample
Remove app package sample
Concepts
Packaging apps
Reference
DeploymentResult
PackageUserInformation

 

 

Show: