StoreContext.RequestDownloadAndInstallStorePackagesAsync StoreContext.RequestDownloadAndInstallStorePackagesAsync StoreContext.RequestDownloadAndInstallStorePackagesAsync StoreContext.RequestDownloadAndInstallStorePackagesAsync StoreContext.RequestDownloadAndInstallStorePackagesAsync Method

Definition

Overloads

RequestDownloadAndInstallStorePackagesAsync(IIterable<String>) RequestDownloadAndInstallStorePackagesAsync(IIterable<String>) RequestDownloadAndInstallStorePackagesAsync(IIterable<String>) RequestDownloadAndInstallStorePackagesAsync(IIterable<String>) RequestDownloadAndInstallStorePackagesAsync(IIterable<String>)

Attempts to download and install the specified downloadable content (DLC) packages for the current app from the Microsoft Store. This method also displays a UI dialog that requests permission for the operation.

Important

This method must be called on the UI thread.

RequestDownloadAndInstallStorePackagesAsync(IIterable<String>, StorePackageInstallOptions) RequestDownloadAndInstallStorePackagesAsync(IIterable<String>, StorePackageInstallOptions) RequestDownloadAndInstallStorePackagesAsync(IIterable<String>, StorePackageInstallOptions) RequestDownloadAndInstallStorePackagesAsync(IIterable<String>, StorePackageInstallOptions) RequestDownloadAndInstallStorePackagesAsync(IIterable<String>, StorePackageInstallOptions)

Attempts to download and install the specified downloadable content (DLC) packages for the current app from the Microsoft Store, with the specified install options. This method also displays a UI dialog that requests permission for the operation.

Important

This method must be called on the UI thread.

RequestDownloadAndInstallStorePackagesAsync(IIterable<String>) RequestDownloadAndInstallStorePackagesAsync(IIterable<String>) RequestDownloadAndInstallStorePackagesAsync(IIterable<String>) RequestDownloadAndInstallStorePackagesAsync(IIterable<String>) RequestDownloadAndInstallStorePackagesAsync(IIterable<String>)

Attempts to download and install the specified downloadable content (DLC) packages for the current app from the Microsoft Store. This method also displays a UI dialog that requests permission for the operation.

Important

This method must be called on the UI thread.

public : IAsyncOperationWithProgress<StorePackageUpdateResult, StorePackageUpdateStatus> RequestDownloadAndInstallStorePackagesAsync(IIterable<Platform::String> storeIds)
IAsyncOperationWithProgress<StorePackageUpdateResult, StorePackageUpdateStatus> RequestDownloadAndInstallStorePackagesAsync(IIterable<winrt::hstring> storeIds) const;
public IAsyncOperationWithProgress<StorePackageUpdateResult, StorePackageUpdateStatus> RequestDownloadAndInstallStorePackagesAsync(IEnumerable<String> storeIds)
Public Function RequestDownloadAndInstallStorePackagesAsync(storeIds As IEnumerable(Of String)) As IAsyncOperationWithProgress(Of StorePackageUpdateResultStorePackageUpdateStatus)
Windows.Services.Store.StoreContext.requestDownloadAndInstallStorePackagesAsync(storeIds).done( /* Your success and error handlers */ );

Parameters

storeIds
IEnumerable<String> IEnumerable<String> IEnumerable<String>

The Store IDs of the DLC add-on packages to install.

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.

Exceptions

COMException COMException COMException

If the ErrorCode property of the exception has the value 0x80070578 (ERROR_INVALID_WINDOW_HANDLE), this indicates that the method was not called on the UI thread. If you are calling this method in a desktop application that uses the Desktop Bridge, this can also indicate that you did not configure the StoreContext object to specify which application window is the owner window for modal dialogs shown by this method. For more information, see this article.

Remarks

Use this method to download and install new DLC packages for the current app. When you call this method, the OS displays a dialog that tells the user that an app package is available to download and install, and asks the user's permission to proceed with the operation. If the user does not grant permission, the OverallState property of the StorePackageUpdateResult return value has the value Canceled. To silently install an app package without displaying a notification dialog, use DownloadAndInstallStorePackagesAsync (this method requires access to a restricted capability).

The Store ID for a DLC 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.

Note

Downloadable content (DLC) packages are not available to all developer accounts.

See Also

RequestDownloadAndInstallStorePackagesAsync(IIterable<String>, StorePackageInstallOptions) RequestDownloadAndInstallStorePackagesAsync(IIterable<String>, StorePackageInstallOptions) RequestDownloadAndInstallStorePackagesAsync(IIterable<String>, StorePackageInstallOptions) RequestDownloadAndInstallStorePackagesAsync(IIterable<String>, StorePackageInstallOptions) RequestDownloadAndInstallStorePackagesAsync(IIterable<String>, StorePackageInstallOptions)

Attempts to download and install the specified downloadable content (DLC) packages for the current app from the Microsoft Store, with the specified install options. This method also displays a UI dialog that requests permission for the operation.

Important

This method must be called on the UI thread.

public : IAsyncOperationWithProgress<StorePackageUpdateResult, StorePackageUpdateStatus> RequestDownloadAndInstallStorePackagesAsync(IIterable<Platform::String> storeIds, StorePackageInstallOptions storePackageInstallOptions)
IAsyncOperationWithProgress<StorePackageUpdateResult, StorePackageUpdateStatus> RequestDownloadAndInstallStorePackagesAsync(IIterable<winrt::hstring> storeIds, StorePackageInstallOptions storePackageInstallOptions) const;
public IAsyncOperationWithProgress<StorePackageUpdateResult, StorePackageUpdateStatus> RequestDownloadAndInstallStorePackagesAsync(IEnumerable<String> storeIds, StorePackageInstallOptions storePackageInstallOptions)
Public Function RequestDownloadAndInstallStorePackagesAsync(storeIds As IEnumerable(Of String), storePackageInstallOptions As StorePackageInstallOptions) As IAsyncOperationWithProgress(Of StorePackageUpdateResultStorePackageUpdateStatus)
Windows.Services.Store.StoreContext.requestDownloadAndInstallStorePackagesAsync(storeIds, storePackageInstallOptions).done( /* Your success and error handlers */ );

Parameters

storeIds
IEnumerable<String> IEnumerable<String> IEnumerable<String>

The Store IDs of the DLC add-on packages to install.

storePackageInstallOptions
StorePackageInstallOptions StorePackageInstallOptions StorePackageInstallOptions

An object that specifies the install options for the operation.

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.

Additional features and requirements

Device family
Windows 10, version 1803 (introduced v10.0.17134.0)
API contract
Windows.Services.Store.StoreContract (introduced v3)

Exceptions

COMException COMException COMException

If the ErrorCode property of the exception has the value 0x80070578 (ERROR_INVALID_WINDOW_HANDLE), this indicates that the method was not called on the UI thread. If you are calling this method in a desktop application that uses the Desktop Bridge, this can also indicate that you did not configure the StoreContext object to specify which application window is the owner window for modal dialogs shown by this method. For more information, see this article.

Remarks

Use this method to download and install new DLC packages for the current app. This overload provides the option to specify whether or not the OS can force the app to restart after installing the DLC packages by setting the AllowForcedAppRestart property of the storePackageInstallOptions parameter.

When you call this method, the OS displays a dialog that tells the user that an app package is available to download and install, and asks the user's permission to proceed with the operation. If the user does not grant permission, the OverallState property of the StorePackageUpdateResult return value has the value Canceled. To silently install an app package without displaying a notification dialog, use DownloadAndInstallStorePackagesAsync (this method requires access to a restricted capability).

The Store ID for a DLC 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.

Note

DLC packages are not available to all developer accounts.

See Also