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

# XPackageInstallChunks

> XPackageInstallChunks

# XPackageInstallChunks

チャンクのインストールを開始します。

## 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\_\
型: char\*

ディスク上のインストール済みパッケージを一意に識別する文字列。パッケージ識別子の詳細については、[ダウンロード可能なコンテンツ (DLC) の管理およびライセンス](https://docs.xbox.com/ja-jp/publishing/xstore-commerce/xstore-dlc.md) を参照してください。

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

*selectors* パラメーター内のセレクターの数。

*selectors*   \_In\_reads\_(selectorCount)\
型: [XPackageChunkSelector\*](https://docs.xbox.com/ja-jp/reference/system/xpackage/structs/xpackagechunkselector.md)

インストールするチャンクを指定するセレクターの配列。

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

更新の間隔 (ミリ秒単位)。

*suppressUserConfirmation*   \_In\_\
型: bool

インストールするチャンクが事前設定されたサイズを超える場合、確認プロンプトが表示されます。*suppressUserConfirmation* が true の場合、プロンプトは表示されず、ユーザーが承諾したかのようにインストールが進行します。これにより、ゲームは独自の UI を表示できます。ゲームがこれを使用する場合、[XPackageEstimateDownloadSize](https://docs.xbox.com/ja-jp/reference/system/xpackage/functions/xpackageestimatedownloadsize.md) を呼び出して、ユーザーに表示されるサイズも取得する必要があります。[XPackageEstimateDownloadSize](https://docs.xbox.com/ja-jp/reference/system/xpackage/functions/xpackageestimatedownloadsize.md) はまた、サイズがプロンプトを表示するのに十分な大きさかどうかを示すブール値を返します。ダウンロード確認が必要な場合、ゲームは独自の UI を使用して表示するか、**XPackageInstallChunks** に表示させる必要があります。

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

作業が実行される非同期キュー。

*installationMonitor*   \_Out\_\
型: XPackageInstallationMonitorHandle\*

戻り時、セレクターに一致するチャンクのインストールを監視するインストール モニターへのハンドルを含みます。

### Return value

型: HRESULT

HRESULT の成功またはエラー コード。\
インストールが拒否された場合はキャンセル エラーを返します。

## Remarks

> [!NOTE]
>
> この関数はタイム センシティブなスレッドで呼び出すのは安全ではありません。詳細については、[タイム センシティブなスレッド](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/console-dev/overviews/threads/time-sensitive-threads) を参照してください。

チャンクのインストールでは、ダウンロード サイズを承諾するようユーザーに促す場合があります。

* この API の同期バージョンを使用すると、ユーザーがダウンロードを承諾または拒否するまでブロックします。ユーザーが拒否した場合、呼び出しはキャンセル エラー E\_ABORT で失敗します。これはインストール状態を監視するために使用できるインストール モニターを返します。モニターは最終的に XPackageCloseInstallationMonitorHandle を呼び出して閉じる必要があります。
* suppressUserConfirmation を true に設定すると、ユーザーにダウンロードを促すカスタム UI を提供できます。

この例では、"BigMaps" タグに対応するチャンクをインストールします:

```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

**ヘッダー:** XPackage.h

**ライブラリ:** xgameruntime.lib

**サポートされているプラットフォーム:** Windows、XBOX One ファミリー本体および XBOX Series 本体

## Conceptual documentation

* [Intelligent Delivery: カスタム タグ指定子](https://docs.xbox.com/ja-jp/build/core-features/common/packaging/intelligentdelivery-custom.md)
* [Intelligent Delivery: 機能とレシピ](https://docs.xbox.com/ja-jp/build/core-features/common/packaging/intelligentdelivery-features-recipes.md)
* [Intelligent Delivery: 言語指定子](https://docs.xbox.com/ja-jp/build/core-features/common/packaging/intelligentdelivery-language.md)
* [Intelligent Delivery: OnDemand コンテンツ](https://docs.xbox.com/ja-jp/build/core-features/common/packaging/intelligentdelivery-ondemand.md)
* [タイム センシティブなスレッド](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/console-dev/overviews/threads/time-sensitive-threads)

## See also

[XPackage](https://docs.xbox.com/ja-jp/reference/system/xpackage/xpackage_members.md)


## Related topics

- [XPackageInstallChunksAsync](https://docs.xbox.com/ja-jp/reference/system/xpackage/functions/xpackageinstallchunksasync.md)
- [XPackageInstallChunksResult](https://docs.xbox.com/ja-jp/reference/system/xpackage/functions/xpackageinstallchunksresult.md)
- [Intelligent Delivery: カスタムタグ指定子](https://docs.xbox.com/ja-jp/build/core-features/common/packaging/intelligentdelivery-custom.md)
- [Intelligent Delivery: Feature と Recipe](https://docs.xbox.com/ja-jp/build/core-features/common/packaging/intelligentdelivery-features-recipes.md)
- [Intelligent Delivery: OnDemand コンテンツ](https://docs.xbox.com/ja-jp/build/core-features/common/packaging/intelligentdelivery-ondemand.md)
