Package Class

Definition

Provides information about a package.

public ref class Package sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.DualApiPartition(version=100794368)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Static(Windows.ApplicationModel.IPackageStatics, 65536, Windows.Foundation.UniversalApiContract)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class Package sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.DualApiPartition(version=100794368)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.Static(Windows.ApplicationModel.IPackageStatics, 65536, "Windows.Foundation.UniversalApiContract")]
class Package sealed
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.DualApiPartition(version=100794368)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Static(typeof(Windows.ApplicationModel.IPackageStatics), 65536, typeof(Windows.Foundation.UniversalApiContract))]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class Package
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.DualApiPartition(version=100794368)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.Static(typeof(Windows.ApplicationModel.IPackageStatics), 65536, "Windows.Foundation.UniversalApiContract")]
public sealed class Package
Public NotInheritable Class Package
Inheritance
Package
Attributes

Windows 10 requirements

Device family
Windows 10 (introduced in 10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v1.0)

Remarks

Although Package is supported in desktop apps, some members of this class are supported only in UWP app. The remarks section will indicate whether a member has any restrictions on its behavior.

Version history

Windows version SDK version Value added
1607 14393 IsOptional
1607 14393 SignatureKind
1607 14393 VerifyContentIntegrityAsync
1703 15063 GetContentGroupAsync
1703 15063 GetContentGroupsAsync
1703 15063 SetInUseAsync
1703 15063 StageContentGroupsAsync(IEnumerable)
1703 15063 StageContentGroupsAsync(IEnumerable,Boolean)
1809 17763 CheckUpdateAvailabilityAsync
1809 17763 GetAppInstallerInfo
1903 18362 EffectiveLocation
1903 18362 MutableLocation
2004 19041 EffectiveExternalLocation
2004 19041 EffectiveExternalPath
2004 19041 EffectivePath
2004 19041 GetAppListEntries
2004 19041 GetLogoAsRandomAccessStreamReference
2004 19041 InstalledPath
2004 19041 IsStub
2004 19041 MachineExternalLocation
2004 19041 MachineExternalPath
2004 19041 MutablePath
2004 19041 UserExternalLocation
2004 19041 UserExternalPath

Properties

Current

Gets the package for the current app.

Dependencies

Gets the packages on which the current package depends.

Description

Gets the description of the package.

DisplayName

Gets the display name of the package.

EffectiveExternalLocation

Gets the location of the machine-wide or per-user external folder specified in the package manifest for the current package, depending on how the app is installed.

EffectiveExternalPath

Gets the location of the machine-wide or per-user external folder specified in the package manifest for the current package, depending on how the app is installed.

EffectiveLocation

Gets either the location of the installed folder or the mutable folder for the installed package, depending on whether the app is declared to be mutable in its package manifest.

EffectivePath

Gets either the path of the installed folder or the mutable folder for the installed package, depending on whether the app is declared to be mutable in its package manifest.

Id

Gets the package identity of the current package.

InstallDate

Windows Phone only. Gets the date the application package was installed on the user's phone.

InstalledDate

Gets the date on which the application package was installed or last updated.

InstalledLocation

Gets the current package's path in the original install folder for the current package.

InstalledPath

Gets the current package's path in the original install folder for the current package.

IsBundle

Indicates whether the package is a bundle package.

IsDevelopmentMode

Indicates whether the package is installed in development mode.

IsFramework

Indicates whether other packages can declare a dependency on this package.

IsOptional

Indicates whether the package is optional.

IsResourcePackage

Indicates whether the package is a resource package.

IsStub

Gets a value that indicates whether the application in the current package is a stub application.

Logo

Gets the logo of the package.

MachineExternalLocation

Gets the location of the machine-wide external folder specified in the package manifest for the current package.

MachineExternalPath

Gets the location of the machine-wide external folder specified in the package manifest for the current package.

MutableLocation

Gets the current package's path in the mutable folder for the installed package, if the app is declared to be mutable in its package manifest.

MutablePath

Gets the current package's path in the mutable folder for the installed package, if the app is declared to be mutable in its package manifest.

PublisherDisplayName

Gets the publisher display name of the package.

SignatureKind

How the app package is signed.

Status

Get the current status of the package for the user.

UserExternalLocation

Gets the location of the per-user external folder specified in the package manifest for the current package.

UserExternalPath

Gets the path of the per-user external folder specified in the package manifest for the current package.

Methods

CheckUpdateAvailabilityAsync()

The CheckUpdateAvailabilityAsync method allows developers to check for updates to the main app package listed in the .appinstaller file. It allows the developer to determine if the updates are required due to .appinstaller policy. This method currently only works for applications installed via .appinstaller files.

GetAppInstallerInfo()

Returns the .appinstaller XML file location. Use this method when you need to retrieve the .appinstaller XML file location for your app. For example, this is useful if your app needs to share a URI to its associated .appinstaller file. You can optionally add arguments to the URI.

GetAppListEntries()

Enumerates the packaged apps on the device and returns the list synchronously. Only apps included in the current package are returned.

GetAppListEntriesAsync()

Enumerates the packaged apps on the device and returns the list asynchronously. Only apps included in the current package are returned.

GetContentGroupAsync(String)

Provides information about the package content group such as its state, name, whether it is required, and so on.

GetContentGroupsAsync()

Provides information about all of the package content groups in the app and their state, name, whether they are required, and so on.

GetLogoAsRandomAccessStreamReference(Size)

Gets the application logo of the package as a random access stream.

GetThumbnailToken()

Windows Phone only. Returns a token that can be used to retrieve the thumbnail image associated with this application package.

Launch(String)

Windows Phone only. Launches the specified application.

SetInUseAsync(Boolean)

Sets whether the package is in use or not.

StageContentGroupsAsync(IEnumerable<String>)

Put the packages in the specified content groups into the staging queue.

StageContentGroupsAsync(IEnumerable<String>, Boolean)

Put the packages in the specified content groups into the staging queue; optionally placing the content groups at the head of the queue.

VerifyContentIntegrityAsync()

Ensures that the package has not been modified or tampered with before being loaded.

Applies to

See also