Shows the size of an available downloadable content update and prompts the user to provide consent for the download or decline.
public:
static IAsyncOperation<RequestUpdatePackageResult^ >^ RequestUpdatePackageAsync(
IDownloadableContentPackage^ package
)
package
Type: IDownloadableContentPackage
The package the request is for.
Type: IAsyncOperation<RequestUpdatePackageResult^ >
using namespace Windows::Xbox::Management::Deployment;
void CheckForPackageUpdates( Deployment::IDownloadableContentPackage^ package )
{
auto ptm = Deployment::PackageTransferManager::Current;
create_task( ptm->CheckForUpdateAsync( package ) )
.then([package, ptm]( CheckForUpdateResult^ updateResult )
{
if( updateResult->IsUpdateMandatory ||
( updateResult->IsUpdateAvailable /* && game in a state where it can apply the update*/ ) )
{
bool updateMandatory = updateResult->IsUpdateMandatory;
// Update is ready to be applied
// Ask the user for permission to install the update through TCUI
create_task( ptm->RequestUpdatePackageAsync( package ) )
.then([this, package, updateMandatory]( RequestUpdatePackageResult^ requestResult )
{
if(SUCCEEDED(requestResult->Result.Value))
{
// User has accepted update, and system can start the download.
// Do cleanup if the package was mounted. The package MUST be unmounted
// before this task returns .
if(package->IsMounted) UnmountDLCPackage(package);
}
else if( updateMandatory /* && userPlayingOnline */ )
{
if(package->IsMounted) UnmountDLCPackage(package);
}
});
}
});
}
Namespace: Windows.Xbox.Management.Deployment
Metadata: windows.winmd