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

# XPackageInstalledCallback

> XPackageInstalledCallback

# XPackageInstalledCallback

A user-defined callback used by the [XPackageRegisterPackageInstalled](/reference/system/xpackage/functions/xpackageregisterpackageinstalled) function.

## Syntax

```cpp theme={null}
void XPackageInstalledCallback(  
         void* context,  
         const XPackageDetails* details  
)  
```

### Parameters

*context*   \_In\_\
Type: void\*

The context passed to the [XPackageRegisterPackageInstalled](/reference/system/xpackage/functions/xpackageregisterpackageinstalled) function.

*details*   \_In\_\
Type: [XPackageDetails\*](/reference/system/xpackage/structs/xpackagedetails)

Contains details about the package installation.

### Return value

Type: void

Returns a pointer to the package installation details.

## Remarks

The `XPackageInstalledCallback` function is used to determine when a new package is completely installed. The following code example prints a message when a new downloadable content (DLC) package is installed.

```cpp theme={null}
void CALLBACK NewPackageAdded(void* /* context */, const XPackageDetails* details)
{
    if (details->kind == XPackageKind::Content)
    {
        printf("Package added: %s\n", details->displayName);
    }
}

HRESULT ListenForNewDlc(XTaskQueueHandle queue, XTaskQueueRegistrationToken* token)
{
    HRESULT hr = XPackageRegisterPackageInstalled(queue, nullptr, NewPackageAdded, token);
    return hr;
}

void StopListeningForDlc(XTaskQueueRegistrationToken token)
{
    XPackageUnregisterPackageInstalled(token, false);
}
```

For information about the packaging technology used with XBOX One titles, see [Overview of Packaging](/build/core-features/common/packaging/overviews/packaging). For information about the steps to create an XVC package, see [Getting started packaging titles for XBOX consoles](/build/core-features/common/packaging/overviews/packaging-getting-started-for-console).

## Requirements

**Header:** XPackage.h

**Library:** xgameruntime.lib

**Supported platforms:** Windows, XBOX One family consoles and XBOX Series consoles

## See also

[How to create and use Downloadable Content Packages (DLC) for PC and XBOX One](/build/core-features/common/packaging/packaging-downloadable-content-dlc)\
[XPackage](/reference/system/xpackage/xpackage_members)


## Related topics

- [XPackageRegisterPackageInstalled](/reference/system/xpackage/functions/xpackageregisterpackageinstalled.md)
- [XPackageDetails](/reference/system/xpackage/structs/xpackagedetails.md)
- [XPackage](/reference/system/xpackage/xpackage_members.md)
- [Troubleshooting XStore development](/publishing/xstore-commerce/xstore-troubleshooting.md)
- [XPackageUnregisterPackageInstalled](/reference/system/xpackage/functions/xpackageunregisterpackageinstalled.md)
