> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# XStoreDownloadAndInstallPackageUpdatesAsync

> XStoreDownloadAndInstallPackageUpdatesAsync

Downloads and installs updates for the specified store packages.

## Syntax

```cpp theme={null}
HRESULT XStoreDownloadAndInstallPackageUpdatesAsync(  
         const XStoreContextHandle storeContextHandle,  
         const char** packageIdentifiers,  
         size_t packageIdentifiersCount,  
         XAsyncBlock* async  
)  
```

### Parameters

*storeContextHandle*   \_In\_\
Type: XStoreContextHandle

The store context handle for the user returned by [XStoreCreateContext](https://docs.xbox.com/reference/system/xstore/functions/xstorecreatecontext.md).

*packageIdentifiers*   \_In\_z\_count\_(packageIdentifiersCount)\
Type: char\*\*

List of package identifier strings.
A package identifier uniquely identifies a package from the Microsoft Store. For more information about package identifiers, see [Manage and license downloadable content (DLC)](https://docs.xbox.com/publishing/xstore-commerce/xstore-dlc.md).

*packageIdentifiersCount*   \_In\_\
Type: size\_t

The number of identifiers in `packageIdentifiers`.

*async*   \_Inout\_\
Type: [XAsyncBlock\*](https://docs.xbox.com/reference/system/xasync/structs/xasyncblock.md)

An [XAsyncBlock](https://docs.xbox.com/reference/system/xasync/structs/xasyncblock.md) defining the asynchronous work being done. The [XAsyncBlock](https://docs.xbox.com/reference/system/xasync/structs/xasyncblock.md) can be used to poll for the call's status and retrieve call results. For more information, see [XAsyncBlock](https://docs.xbox.com/reference/system/xasync/structs/xasyncblock.md).

### Return value

Type: [HRESULT](https://learn.microsoft.com/openspecs/windows_protocols/ms-erref/0642cb2f-2075-4469-918c-4441e69c548a)

HRESULT success or error code.

## Remarks

This function downloads and installs updates for the specified store packages.

> [!NOTE]
>
> When you call this function and it finds updates for the game, the game terminates immediately to allow the install to occur.

To retrieve the results of the download and install update, call [XStoreDownloadAndInstallPackageUpdatesResult](https://docs.xbox.com/reference/system/xstore/functions/xstoredownloadandinstallpackageupdatesresult.md) after calling this function.
For a usage example, see [XStoreQueryGameAndDlcPackageUpdatesAsync](https://docs.xbox.com/reference/system/xstore/functions/xstorequerygameanddlcpackageupdatesasync.md).

When you call this API from a running game, the downloads are high priority and go at the beginning of the queue in the order specified in the `storeIds` parameter.

## Requirements

**Header:** XStore.h (included in XGameRuntime.h)

**Library:** xgameruntime.lib

**Supported platforms:** Windows, XBOX One family consoles, and XBOX Series consoles

## Conceptual documentation

* [Checking for updates](https://docs.xbox.com/publishing/xstore-commerce/xstore-checking-updates.md)

## See also

[XStore](https://docs.xbox.com/reference/system/xstore/xstore_members.md)\
[XStoreDownloadAndInstallPackageUpdatesResult](https://docs.xbox.com/reference/system/xstore/functions/xstoredownloadandinstallpackageupdatesresult.md)


## Related topics

- [XStoreDownloadAndInstallPackageUpdatesResult](https://docs.xbox.com/reference/system/xstore/functions/xstoredownloadandinstallpackageupdatesresult.md)
- [XStoreDownloadPackageUpdatesAsync](https://docs.xbox.com/reference/system/xstore/functions/xstoredownloadpackageupdatesasync.md)
- [Checking for updates](https://docs.xbox.com/publishing/xstore-commerce/xstore-checking-updates.md)
- [XStore (API contents)](https://docs.xbox.com/reference/system/xstore/xstore_members.md)
- [Using C# wrappers for GDK APIs in your Unity project](https://docs.xbox.com/build/gdk-and-engines/unity/unity-api-wrappers.md)
