Dynamic Chunk Reordering

When installation of a title begins, the installation system will acquire and copy chunks, collections of files that should be installed as a group, according to the default order defined by the developer. After the chunks that are required for the title to run have been installed, the title can provide a custom order for installation of the remaining chunks, which will be processed by the installation system before it returns to the default order of installation.

Thus, titles can control the acquisition order of content in response to a number of different situations or input from the user. This dynamic reordering can minimize the time that users spend waiting for content to be installed, as well as offer them choices about what they want to have available first.

After changing the installation order, if there are chunks required for play or use of the title to continue, your title can monitor the status of installation by using one of the methods described in Streaming Installation: Status.

To change the order in which chunks are installed

  1. Retrieve the current PackageTransferManager using the Current property.
    auto ptm = Windows::Xbox::Management::Deployment::PackageTransferManager::Current;  
    
  2. Determine the chunk or set of chunks required for the target content or end-user experience. Consider storing this information as part of your title’s content index, so a mapping from a particular level or set of assets to chunkId can be done at runtime.
    IVector<uint32> ^requiredChunkIds = ref new Vector<uint32>;
    requiredChunkIds->Append(1);
    requiredChunkIds->Append(2);
    requiredChunkIds->Append(3);
    requiredChunkIds->Append(4);  
    
  3. Verify the chunks have not already been installed using AreChunksInstalled.
    bool installed = ptm->AreChunksInstalled(requiredChunkIds);  
    
  4. Call UpdateInstallOrder with the list of chunks that should take priority.
    if (!installed) ptm->UpdateInstallOrder(requiredChunkIds, Windows::Xbox::Management::Deployment::UpdateInstallOrderBehavior::InterruptCurrentTransfer);