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

# XPackageInstallChunksAsync

> XPackageInstallChunksAsync

# XPackageInstallChunksAsync

청크 설치를 시작합니다.

## 구문

```cpp theme={null}
HRESULT XPackageInstallChunksAsync(  
         const char* packageIdentifier,  
         uint32_t selectorCount,  
         XPackageChunkSelector* selectors,  
         uint32_t minimumUpdateIntervalMs,  
         bool suppressUserConfirmation,  
         XAsyncBlock* asyncBlock  
)  
```

### 매개 변수

*packageIdentifier*   \_In\_z\_\
형식: char\*

디스크에 설치된 패키지를 고유하게 식별하는 문자열입니다. 패키지 식별자에 대한 자세한 내용은 [다운로드 가능한 콘텐츠(DLC) 관리 및 라이선스](https://learn.microsoft.com/gaming/gdk/docs/store/commerce/fundamentals/xstore-manage-and-license-optional-packages)를 참조하세요.

*selectorCount*   \_In\_\
형식: uint32\_t

*selectors* 매개 변수의 선택자 수입니다.

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

설치할 청크를 지정하는 선택자 배열입니다.

*minimumUpdateIntervalMs*   \_In\_\
형식: uint32\_t

업데이트 간격(밀리초)입니다.

*suppressUserConfirmation*   \_In\_\
형식: bool

설치할 청크가 미리 설정된 크기를 초과하는 경우 확인 프롬프트가 표시됩니다. *suppressUserConfirmation*이 true인 경우 프롬프트가 표시되지 않고 사용자가 수락한 것처럼 설치가 진행됩니다. 이를 통해 게임에서 자체 UI를 표시할 수 있습니다. 게임이 이를 사용하는 경우, 사용자에게 표시될 크기를 가져오려면 [XPackageEstimateDownloadSize](/reference/system/xpackage/functions/xpackageestimatedownloadsize)도 호출해야 합니다. [XPackageEstimateDownloadSize](/reference/system/xpackage/functions/xpackageestimatedownloadsize)는 크기가 프롬프트를 표시할 정도로 큰지를 나타내는 부울도 반환합니다. 다운로드 확인이 필요한 경우, 게임은 자체 UI를 사용하여 표시하거나 **XPackageInstallChunks**가 표시하도록 해야 합니다.

*asyncBlock*   \_Inout\_\
형식: [XAsyncBlock\*](/reference/system/xasync/structs/xasyncblock)

비동기 호출의 상태를 모니터링하기 위한 **XAsyncBlock**입니다.

### 반환 값

형식: HRESULT

HRESULT 성공 또는 오류 코드입니다.

## 설명

[XPackageInstallChunks](/reference/system/xpackage/functions/xpackageinstallchunks)에는 비동기 변형이 있습니다. 청크 설치에는 사용자에게 다운로드 크기를 수락하라는 메시지가 표시될 수 있습니다.

이 예제는 비동기 API를 사용하여 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);
    }
}

void CALLBACK BigMapsAsyncInstallComplete(XAsyncBlock* asyncBlock)
{
    XPackageInstallationMonitorHandle monitor;
    HRESULT hr = XPackageInstallChunksResult(asyncBlock, &monitor);
    delete asyncBlock;

    if (SUCCEEDED(hr))
    {
        XTaskQueueRegistrationToken token;
        if (FAILED(XPackageRegisterInstallationProgressChanged(
            monitor,
            nullptr,
            BigMapsInstallProgress, &token)))
        {
            XPackageCloseInstallationMonitorHandle(monitor);
        }
    }
}

HRESULT InstallBigMapsAsync(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";

    XAsyncBlock* asyncBlock = new (std::nothrow) XAsyncBlock{};
    asyncBlock->callback = BigMapsAsyncInstallComplete;
    asyncBlock->queue = queue;

    hr = XPackageInstallChunksAsync(
        id, 1, &selector, 1000,
        false, asyncBlock);

    if (FAILED(hr))
    {
        delete asyncBlock;
    }

    return hr;
}
```

## 요구 사항

**헤더:** XPackage.h

**라이브러리:** xgameruntime.lib

**지원 플랫폼:** Windows, XBOX One 제품군 콘솔 및 XBOX Series 콘솔

## 개념 문서

* [비동기 프로그래밍 설계 목표 및 개선 사항](/build/core-features/common/async/async-whitepaper)

## 함께 보기

[XPackage](/reference/system/xpackage/xpackage_members)\
[스트리밍 설치 및 Intelligent Delivery](/build/core-features/common/packaging/overviews/streaming_install-intelligent_delivery)\
[XPackageInstallChunks](/reference/system/xpackage/functions/xpackageinstallchunks)


## Related topics

- [XPackageInstallChunksResult](/ko/reference/system/xpackage/functions/xpackageinstallchunksresult.md)
- [XPackage](/ko/reference/system/xpackage/xpackage_members.md)
- [GDK용 Unity C# API 래퍼](/ko/build/gdk-and-engines/unity/unity-api-wrappers.md)
- [XPackageInstallChunks](/ko/reference/system/xpackage/functions/xpackageinstallchunks.md)
- [XPackageChangeChunkInstallOrder](/ko/reference/system/xpackage/functions/xpackagechangechunkinstallorder.md)
