XPackageIsPackagedProcess
Returns a Boolean that indicates whether the current process has an installation identity.
Syntax
bool XPackageIsPackagedProcess(
)
Parameters
None.
Return value
Type: bool
If the process has an installation identity, it returns true. Otherwise, it returns false.
Remarks
You can determine whether a game is fully installed. The following code example works for packaged MSICVC games and for loose deployments. The return value bool *isInstalled
is set to true if the game is fully installed.
HRESULT IsPackageCompletelyInstalled(bool *isInstalled)
{
if (XPackageIsPackagedProcess())
{
char id[XPACKAGE_IDENTIFIER_MAX_LENGTH];
HRESULT hr = XPackageGetCurrentProcessPackageIdentifier(_countof(id), id);
if (FAILED(hr)) return hr;
XPackageInstallationMonitorHandle monitor;
hr = XPackageCreateInstallationMonitor(id, 0, nullptr, 0, nullptr, &monitor);
if (FAILED(hr)) return hr;
XPackageInstallationProgress progress;
XPackageGetInstallationProgress(monitor, &progress);
*isInstalled = (progress.completed);
XPackageCloseInstallationMonitorHandle(monitor);
}
else
{
*isInstalled = true;
}
return S_OK;
}
Requirements
Header: XPackage.h
Library: xgameruntime.lib
Supported platforms: Windows, Xbox One family consoles and Xbox Series consoles
See also
Overview of Packaging
Streaming Installation and Intelligent Delivery
XPackage