StoreContext.RequestDownloadAndInstallStorePackagesAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
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) |
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>)
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:
virtual IAsyncOperationWithProgress<StorePackageUpdateResult ^, StorePackageUpdateStatus> ^ RequestDownloadAndInstallStorePackagesAsync(IIterable<Platform::String ^> ^ storeIds) = RequestDownloadAndInstallStorePackagesAsync;
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncOperationWithProgress<StorePackageUpdateResult, StorePackageUpdateStatus> RequestDownloadAndInstallStorePackagesAsync(IIterable<winrt::hstring> const& storeIds);
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperationWithProgress<StorePackageUpdateResult,StorePackageUpdateStatus> RequestDownloadAndInstallStorePackagesAsync(IEnumerable<string> storeIds);
function requestDownloadAndInstallStorePackagesAsync(storeIds)
Public Function RequestDownloadAndInstallStorePackagesAsync (storeIds As IEnumerable(Of String)) As IAsyncOperationWithProgress(Of StorePackageUpdateResult, StorePackageUpdateStatus)
Parameters
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.
- Attributes
Exceptions
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 <xref href="Windows.Services.Store.StoreContext?text=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
Applies to
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:
virtual IAsyncOperationWithProgress<StorePackageUpdateResult ^, StorePackageUpdateStatus> ^ RequestDownloadAndInstallStorePackagesAsync(IIterable<Platform::String ^> ^ storeIds, StorePackageInstallOptions ^ storePackageInstallOptions) = RequestDownloadAndInstallStorePackagesAsync;
/// [Windows.Foundation.Metadata.Overload("RequestDownloadAndInstallStorePackagesWithInstallOptionsAsync")]
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncOperationWithProgress<StorePackageUpdateResult, StorePackageUpdateStatus> RequestDownloadAndInstallStorePackagesAsync(IIterable<winrt::hstring> const& storeIds, StorePackageInstallOptions const& storePackageInstallOptions);
[Windows.Foundation.Metadata.Overload("RequestDownloadAndInstallStorePackagesWithInstallOptionsAsync")]
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperationWithProgress<StorePackageUpdateResult,StorePackageUpdateStatus> RequestDownloadAndInstallStorePackagesAsync(IEnumerable<string> storeIds, StorePackageInstallOptions storePackageInstallOptions);
function requestDownloadAndInstallStorePackagesAsync(storeIds, storePackageInstallOptions)
Public Function RequestDownloadAndInstallStorePackagesAsync (storeIds As IEnumerable(Of String), storePackageInstallOptions As StorePackageInstallOptions) As IAsyncOperationWithProgress(Of StorePackageUpdateResult, StorePackageUpdateStatus)
Parameters
The Store IDs of the DLC add-on packages to install.
- 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.
- Attributes
Exceptions
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 <xref href="Windows.Services.Store.StoreContext?text=StoreContext" /> object to specify which application window is the owner window for modal dialogs shown by this method. For more information, see this article.
Windows requirements
Device family |
Windows 10, version 1803 (introduced in 10.0.17134.0)
|
API contract |
Windows.Services.Store.StoreContract (introduced in v3.0)
|
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.