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

# XStoreDownloadAndInstallPackageUpdatesAsync

> 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](/reference/system/xstore/functions/xstorecreatecontext).

*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)](/publishing/xstore-commerce/xstore-dlc).

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

The number of identifiers in `packageIdentifiers`.

*async*   \_Inout\_\
Type: [XAsyncBlock\*](/reference/system/xasync/structs/xasyncblock)

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

### 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.</Note>

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

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](/publishing/xstore-commerce/xstore-checking-updates)

## See also

[XStore](/reference/system/xstore/xstore_members)\
[XStoreDownloadAndInstallPackageUpdatesResult](/reference/system/xstore/functions/xstoredownloadandinstallpackageupdatesresult)


## Related topics

- [XStoreDownloadAndInstallPackageUpdatesResult](/reference/system/xstore/functions/xstoredownloadandinstallpackageupdatesresult.md)
- [XStoreDownloadPackageUpdatesAsync](/reference/system/xstore/functions/xstoredownloadpackageupdatesasync.md)
- [Checking for updates](/publishing/xstore-commerce/xstore-checking-updates.md)
- [XStore](/reference/system/xstore/xstore_members.md)
- [Unity C# API wrappers for the GDK](/build/gdk-and-engines/unity/unity-api-wrappers.md)
