StoreContext.DownloadAndInstallStorePackagesAsync Method

Definition

Downloads and installs the specified downloadable content (DLC) packages for the current app from the Microsoft Store without displaying a notification UI dialog to the user.

public:
 virtual IAsyncOperationWithProgress<StorePackageUpdateResult ^, StorePackageUpdateStatus> ^ DownloadAndInstallStorePackagesAsync(IIterable<Platform::String ^> ^ storeIds) = DownloadAndInstallStorePackagesAsync;
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncOperationWithProgress<StorePackageUpdateResult, StorePackageUpdateStatus> DownloadAndInstallStorePackagesAsync(IIterable<winrt::hstring> const& storeIds);
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperationWithProgress<StorePackageUpdateResult,StorePackageUpdateStatus> DownloadAndInstallStorePackagesAsync(IEnumerable<string> storeIds);
function downloadAndInstallStorePackagesAsync(storeIds)
Public Function DownloadAndInstallStorePackagesAsync (storeIds As IEnumerable(Of String)) As IAsyncOperationWithProgress(Of StorePackageUpdateResult, StorePackageUpdateStatus)

Parameters

storeIds

IIterable<String>

IEnumerable<String>

IIterable<Platform::String>

IIterable<winrt::hstring>

The Store IDs of the add-ons that correspond to the DLC packages to install for the current app.

Returns

An object that the caller can observe to track progress and completion for the operation. On successful completion, the result is a StorePackageUpdateResult object that provides info about the package updates.

Attributes

Windows requirements

Device family
Windows 10, version 1803 (introduced in 10.0.17134.0)
API contract
Windows.Services.Store.StoreContract (introduced in v3.0)
App capabilities
storePackageManagement

Remarks

Use this method to download and install new DLC packages for the current app. When you call this method, the OS silently downloads and installs the packages without displaying a notification dialog. This method requires the restricted storePackageManagement capability to perform this operation. If you don't have access to this restricted capability, you can use the RequestDownloadAndInstallStorePackagesAsync methods instead (these methods display a notification dialog that requests the user's permission to install the package).

Note

DLC packages are not available to all developer accounts.

Note

The restricted storePackageManagement capability is only available to desktop applications and games that use the Desktop Bridge and to Xbox games that use XVC packages and are developed as part of a managed partner program, such as the ID@Xbox program. These applications and games have this capability by default.

The Store ID for an add-on is available in Partner Center, and it also is returned by the StoreId property of the StoreProduct that represents the DLC add-on. For more information, see Store IDs.

This operation will not block. The IAsyncOperationWithProgress object returned by this method will complete after the packages are downloaded and installed.

The method that you assign to handle Progress notifications is called one time for each step in the download and installation process for each package in this request. The Progress handler receives a StorePackageUpdateStatus argument that provides info about the package that raised the progress notification.

Applies to

See also