Megosztás a következőn keresztül:


Package Class

Definition

Provides information about a package.

public ref class Package sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class Package final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class Package
Public NotInheritable Class Package
Inheritance
Object Platform::Object IInspectable Package
Attributes

Windows requirements

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

Remarks

Important

Although the Package class is supported in an unpackaged process (that is, a process belonging to an app that lacks package identity), some members of this class are supported only in a packaged process (that is, a process belonging to an app that has package identity). For those members, the Remarks section of their topics contain more info. And for more info about packaging, see Package a desktop or UWP app in Visual Studio.

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<String>)
1703 15063 StageContentGroupsAsync(IEnumerable<String>,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.

SourceUriSchemeName

Contains the scheme part of the URI that was used to install the package.

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.

FindRelatedPackages(FindRelatedPackagesOptions)

The FindRelatedPackages method provides the dependencies and then dependents for a given package as a Package list. The list can be filtered by the type of dependency using the options parameter.

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(IIterable<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.

StageContentGroupsAsync(IIterable<String>)

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

VerifyContentIntegrityAsync()

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

Applies to

See also