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

# XPackage

> XPackage

# XPackage

XPackage API 的參考資料。

## 函式

| 函式 | 描述 |
| - | - |
| [XPackageChangeChunkInstallOrder](/zh-TW/reference/system/xpackage/functions/xpackagechangechunkinstallorder) | 設定要優先安裝的選取區塊。 |
| [XPackageChunkAvailabilityCallback](/zh-TW/reference/system/xpackage/functions/xpackagechunkavailabilitycallback) | [XPackageEnumerateChunkAvailability](/zh-TW/reference/system/xpackage/functions/xpackageenumeratechunkavailability) 所使用的使用者定義回呼。 |
| [XPackageCloseInstallationMonitorHandle](/zh-TW/reference/system/xpackage/functions/xpackagecloseinstallationmonitorhandle) | 關閉指定的安裝監視器。 |
| [XPackageCloseMountHandle](/zh-TW/reference/system/xpackage/functions/xpackageclosemounthandle) | 關閉指定的掛接控制代碼。 |
| [XPackageCreateInstallationMonitor](/zh-TW/reference/system/xpackage/functions/xpackagecreateinstallationmonitor) | 建立安裝狀態的監視器。 |
| [XPackageEnumerateChunkAvailability](/zh-TW/reference/system/xpackage/functions/xpackageenumeratechunkavailability) | 檢查安裝套件，並列舉符合指定選取器之所有區塊的可用性。 |
| [XPackageEnumerateFeatures](/zh-TW/reference/system/xpackage/functions/xpackageenumeratefeatures) | 列舉套件配置檔案中定義的功能。 |
| [XPackageEnumeratePackages](/zh-TW/reference/system/xpackage/functions/xpackageenumeratepackages) | 尋找與呼叫處理序相關的已安裝或安裝中套件。 |
| [XPackageEnumerationCallback](/zh-TW/reference/system/xpackage/functions/xpackageenumerationcallback) | [XPackageEnumeratePackages](/zh-TW/reference/system/xpackage/functions/xpackageenumeratepackages) 所使用的回呼。 |
| [XPackageEstimateDownloadSize](/zh-TW/reference/system/xpackage/functions/xpackageestimatedownloadsize) | 計算符合指定安裝選取器之區塊的下載大小。 |
| [XPackageFeatureEnumerationCallback](/zh-TW/reference/system/xpackage/functions/xpackagefeatureenumerationcallback) | XPackageEnumerateFeatures 用來列舉每個功能的回呼。 |
| [XPackageFindChunkAvailability](/zh-TW/reference/system/xpackage/functions/xpackagefindchunkavailability) | 傳回符合指定選取器之區塊集合的最低可用性。 |
| [XPackageGetCurrentProcessPackageIdentifier](/zh-TW/reference/system/xpackage/functions/xpackagegetcurrentprocesspackageidentifier) | 傳回識別此處理序之安裝的安裝身分識別字串。 |
| [XPackageGetInstallationProgress](/zh-TW/reference/system/xpackage/functions/xpackagegetinstallationprogress) | 傳回安裝的目前進度。 |
| [XPackageGetMountPath](/zh-TW/reference/system/xpackage/functions/xpackagegetmountpath) | 取得已掛接安裝的路徑。 |
| [XPackageGetPackageKind](/zh-TW/reference/system/xpackage/functions/xpackagegetpackagekind) | 傳回套件的 [XPackageKind](/zh-TW/reference/system/xpackage/enums/xpackagekind)。 |
| [XPackageGetMountPathSize](/zh-TW/reference/system/xpackage/functions/xpackagegetmountpathsize) | 取得陣列容納 [XPackageGetMountPath](/zh-TW/reference/system/xpackage/functions/xpackagegetmountpath) 所傳回之掛接路徑所需的大小。 |
| [XPackageGetUserLocale](/zh-TW/reference/system/xpackage/functions/xpackagegetuserlocale) | 取得目前的使用者地區設定。 |
| [XPackageGetWriteStats](/zh-TW/reference/system/xpackage/functions/xpackagegetwritestats) | 取得輸出寫入統計資料 (writeStats)。 |
| [XPackageInstallationProgressCallback](/zh-TW/reference/system/xpackage/functions/xpackageinstallationprogresscallback) | [XPackageRegisterInstallationProgressChanged](/zh-TW/reference/system/xpackage/functions/xpackageregisterinstallationprogresschanged) 所使用的回呼。 |
| [XPackageInstallChunks](/zh-TW/reference/system/xpackage/functions/xpackageinstallchunks) | 開始安裝區塊。 |
| [XPackageInstallChunksAsync](/zh-TW/reference/system/xpackage/functions/xpackageinstallchunksasync) | 開始安裝區塊。 |
| [XPackageInstallChunksResult](/zh-TW/reference/system/xpackage/functions/xpackageinstallchunksresult) | 擷取呼叫 [XPackageInstallChunksAsync](/zh-TW/reference/system/xpackage/functions/xpackageinstallchunksasync) 的結果。 |
| [XPackageInstalledCallback](/zh-TW/reference/system/xpackage/functions/xpackageinstalledcallback) | XPackageRegisterPackageInstalled 函式所使用的使用者定義回呼。 |
| [XPackageIsPackagedProcess](/zh-TW/reference/system/xpackage/functions/xpackageispackagedprocess) | 傳回布林值，指出目前的處理序是否具有安裝身分識別。 |
| [XPackageMount](/zh-TW/reference/system/xpackage/functions/xpackagemount) | 此函式現已淘汰。請改用 XPackageMountWithUiAsync。 |
| [XPackageMountWithUiAsync](/zh-TW/reference/system/xpackage/functions/xpackagemountwithuiasync) | 以非同步方式掛接指定內容的安裝，並傳回其掛接控制代碼。 |
| [XPackageMountWithUiResult](/zh-TW/reference/system/xpackage/functions/xpackagemountwithuiresult) | 取得呼叫 XPackageMountWithUIAsync 的結果。 |
| [XPackageRegisterInstallationProgressChanged](/zh-TW/reference/system/xpackage/functions/xpackageregisterinstallationprogresschanged) | 登錄在安裝進度變更時要呼叫的回呼。 |
| [XPackageRegisterPackageInstalled](/zh-TW/reference/system/xpackage/functions/xpackageregisterpackageinstalled) | 登錄在安裝完成時要呼叫的回呼。 |
| [XPackageUninstallPackage](/zh-TW/reference/system/xpackage/functions/xpackageuninstallpackage) | 解除安裝指定的套件。 |
| [XPackageUninstallChunks](/zh-TW/reference/system/xpackage/functions/xpackageuninstallchunks) | 解除安裝符合指定選取器的區塊。 |
| [XPackageUninstallUWPInstance](/zh-TW/reference/system/xpackage/functions/xpackageuninstalluwpinstance) | 如果目前使用者已安裝特定套件的通用 Windows 平台 (UWP) 執行個體，則將其解除安裝。 |
| [XPackageUnregisterInstallationProgressChanged](/zh-TW/reference/system/xpackage/functions/xpackageunregisterinstallationprogresschanged) | 取消登錄先前登錄的安裝進度變更回呼。 |
| [XPackageUnregisterPackageInstalled](/zh-TW/reference/system/xpackage/functions/xpackageunregisterpackageinstalled) | 取消登錄先前登錄的安裝完成回呼。 |
| [XPackageUpdateInstallationMonitor](/zh-TW/reference/system/xpackage/functions/xpackageupdateinstallationmonitor) | 重新整理從 [XPackageGetInstallationProgress](/zh-TW/reference/system/xpackage/functions/xpackagegetinstallationprogress) 傳回的進度。 |

## 結構

| 結構 | 描述 |
| - | - |
| [XPackageChunkSelector](/zh-TW/reference/system/xpackage/structs/xpackagechunkselector) | 定義選取一組區塊的準則。 |
| [XPackageDetails](/zh-TW/reference/system/xpackage/structs/xpackagedetails) | 包含安裝的詳細資料。 |
| [XPackageFeature](/zh-TW/reference/system/xpackage/structs/xpackagefeature) | 描述功能。 |
| [XPackageInstallationProgress](/zh-TW/reference/system/xpackage/structs/xpackageinstallationprogress) | 包含安裝進度的相關資訊。 |
| [XPackageWriteStats](/zh-TW/reference/system/xpackage/structs/xpackagewritestats) | 包含輸出寫入統計資料 (writeStats)。 |

## 列舉

| 列舉 | 描述 |
| - | - |
| [XPackageChunkAvailability](/zh-TW/reference/system/xpackage/enums/xpackagechunkavailability) | 指出安裝區塊的可用性。 |
| [XPackageChunkSelectorType](/zh-TW/reference/system/xpackage/enums/xpackagechunkselectortype) | 指出選取器類型。 |
| [XPackageEnumerationScope](/zh-TW/reference/system/xpackage/enums/xpackageenumerationscope) | 指出列舉安裝套件時要傳回的套件範圍。 |
| [XPackageKind](/zh-TW/reference/system/xpackage/enums/xpackagekind) | 指出安裝套件的類型。 |

## 錯誤碼

XPackage API 可能會傳回下列錯誤碼。如需完整清單，請參閱[錯誤碼](/zh-TW/reference/errorcodes)。

| 代碼 | 值 | 描述 |
| - | - | - |
| E\_GAMEPACKAGE\_APP\_NOT\_PACKAGED | 0x89245200 | 遊戲未封裝在容器中。 |
| E\_GAMEPACKAGE\_NO\_INSTALLED\_LANGUAGES | 0x89245201 | 遊戲使用 Intelligent Delivery 選擇性地安裝語言，但未安裝任何語言。 |
| E\_GAMEPACKAGE\_NO\_STORE\_ID | 0x89245202 | 必須在應用程式的遊戲設定中設定 StoreId 屬性。 |
| E\_GAMEPACKAGE\_INVALID\_SELECTOR | 0x89245203 | 提供的區塊選取器無法解析為套件中的區塊。 |
| E\_GAMEPACKAGE\_DOWNLOAD\_REQUIRED | 0x89245204 | 必須下載一或多個必要區塊，才能在此裝置上掛接套件。 |
| E\_GAMEPACKAGE\_NO\_TAG\_CHANGE | 0x89245205 | 請使用功能 (而非標籤) 變更此套件中已安裝的區塊。 |
| E\_GAMEPACKAGE\_DLC\_NOT\_SUPPORTED | 0x89245206 | 遊戲不支援此 DLC 套件。請確定遊戲設定中的 DLC 相容性正確無誤。 |
| E\_GAMEPACKAGE\_DUPLICATE\_ID\_VALUES | 0x89245207 | 套件包含多個對應至相同 'ID' 屬性的可執行檔。請檢查 'Executable' 元素中是否有重複的 'ID' 屬性。 |
| E\_GAMEPACKAGE\_NO\_PACKAGE\_IDENTIFIER | 0x89245208 | 無法解析套件的識別碼。套件可能未安裝。 |

## 概念文件

* [XStore 檢查更新](/zh-TW/publishing/xstore-commerce/xstore-checking-updates)
* [XStore 授與內容的存取權](/zh-TW/publishing/xstore-commerce/xstore-granting-access)
* [XStore 管理選用套件及授權](/zh-TW/publishing/xstore-commerce/xstore-dlc)

## 另請參閱

[系統 API 參考](/zh-TW/reference/system/gc-reference-system-toc)\
[XStore API 參考](/zh-TW/reference/system/xstore/xstore_members)


## Related topics

- [XPackage](/reference/system/xpackage/xpackage_members.md)
- [XPackageEnumeratePackages](/reference/system/xpackage/functions/xpackageenumeratepackages.md)
- [XPackageUninstallPackage](/reference/system/xpackage/functions/xpackageuninstallpackage.md)
