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

# XPackageInstallChunks

> XPackageInstallChunks

# XPackageInstallChunks

Starts the installation of chunks.

## Syntax

```cpp theme={null}
HRESULT XPackageInstallChunks(  
         const char* packageIdentifier,  
         uint32_t selectorCount,  
         XPackageChunkSelector* selectors,  
         uint32_t minimumUpdateIntervalMs,  
         bool suppressUserConfirmation,  
         XTaskQueueHandle queue,  
         XPackageInstallationMonitorHandle* installationMonitor  
)  
```

### Parameters

*packageIdentifier*   \_In\_z\_\
Type: char\*

A string that uniquely identifies the installed package on the disk. For more information about package identifiers, see [Manage and license downloadable content (DLC)](/publishing/xstore-commerce/xstore-dlc).

*selectorCount*   \_In\_\
Type: uint32\_t

The number of selectors in the *selectors* parameter.

*selectors*   \_In\_reads\_(selectorCount)\
Type: [XPackageChunkSelector\*](/reference/system/xpackage/structs/xpackagechunkselector)

An array of selectors that specify the chunks to be installed.

*minimumUpdateIntervalMs*   \_In\_\
Type: uint32\_t

The interval between updates, in milliseconds.

*suppressUserConfirmation*   \_In\_\
Type: bool

If the chunks to be installed exceed a preset size, then a confirmation prompt will be displayed. If *suppressUserConfirmation* is true, then no prompt will be displayed and the installation will progress as if the user accepted. This lets the game present its own UI. If the game uses this, it should also call [XPackageEstimateDownloadSize](/reference/system/xpackage/functions/xpackageestimatedownloadsize) to get the size that will be presented to the user. [XPackageEstimateDownloadSize](/reference/system/xpackage/functions/xpackageestimatedownloadsize) also returns a Boolean, to indicate whether the size is large enough that a prompt is to be displayed. If a download confirmation is needed, then the game must either show it by using its own UI or let **XPackageInstallChunks** show it.

*queue*   \_In\_opt\_\
Type: XTaskQueueHandle

The asynchronous queue on which work will be performed.

*installationMonitor*   \_Out\_\
Type: XPackageInstallationMonitorHandle\*

On return, contains a handle to an installation monitor that will monitor the installation of the chunks that match the selector.

### Return value

Type: HRESULT

HRESULT success or error code.\
Returns a cancellation error if the install is rejected.

## Remarks

<Note>This function isn't safe to call on a time-sensitive thread. For more information, see [Time-sensitive threads](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/console-dev/overviews/threads/time-sensitive-threads).</Note>

Installation of chunks might involve prompting the user to accept the download size.

* If you use the synchronous version of this API, it will block until the user accepts or declines the download. If the user declines, the call will fail with the cancellation error E\_ABORT. This will return an installation monitor you can use to monitor the installation status. The monitor must eventually be closed, by calling XPackageCloseInstallationMonitorHandle.
* Setting suppressUserConfirmation to true will let you provide a custom UI that will prompt the user for the download.

This example will install the chunks that correspond to the "BigMaps" tag:

```cpp theme={null}
void CALLBACK BigMapsInstallProgress(
    void* /* context */,
    XPackageInstallationMonitorHandle monitor)
{
    XPackageInstallationProgress progress;
    XPackageGetInstallationProgress(monitor, &progress);
    if (progress.completed)
    {
        printf("BigMaps Installed\n");
        XPackageCloseInstallationMonitorHandle(monitor);
    }
}

HRESULT InstallBigMaps(XTaskQueueHandle queue)
{
    char id[XPACKAGE_IDENTIFIER_MAX_LENGTH];
    HRESULT hr = XPackageGetCurrentProcessPackageIdentifier(_countof(id), id);
    if (FAILED(hr)) return hr;

    XPackageChunkSelector selector;
    selector.type = XPackageChunkSelectorType::Tag;
    selector.tag = "BigMaps";

    XPackageInstallationMonitorHandle monitor;
    hr = XPackageInstallChunks(id, 1, &selector, 1000, false, queue, &monitor);

    if (SUCCEEDED(hr))
    {
        XTaskQueueRegistrationToken token;
        hr = XPackageRegisterInstallationProgressChanged(
            monitor,
            nullptr,
            BigMapsInstallProgress,
            &token);

        if (FAILED(hr))
        {
            XPackageCloseInstallationMonitorHandle(monitor);
        }
    }

    return hr;
}
```

## Requirements

**Header:** XPackage.h

**Library:** xgameruntime.lib

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

## Conceptual documentation

* [Intelligent Delivery: custom tag specifiers](/build/core-features/common/packaging/intelligentdelivery-custom)
* [Intelligent Delivery: features and recipes](/build/core-features/common/packaging/intelligentdelivery-features-recipes)
* [Intelligent Delivery: language specifiers](/build/core-features/common/packaging/intelligentdelivery-language)
* [Intelligent Delivery: OnDemand content](/build/core-features/common/packaging/intelligentdelivery-ondemand)
* [Time-sensitive threads](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/console-dev/overviews/threads/time-sensitive-threads)

## See also

[XPackage](/reference/system/xpackage/xpackage_members)


## Related topics

- [XPackageInstallChunksAsync](/reference/system/xpackage/functions/xpackageinstallchunksasync.md)
- [XPackageInstallChunksResult](/reference/system/xpackage/functions/xpackageinstallchunksresult.md)
- [Intelligent Delivery: custom tag specifiers](/build/core-features/common/packaging/intelligentdelivery-custom.md)
- [Intelligent Delivery: features and recipes](/build/core-features/common/packaging/intelligentdelivery-features-recipes.md)
- [Intelligent Delivery: OnDemand content](/build/core-features/common/packaging/intelligentdelivery-ondemand.md)
