> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# XPackageUninstallUWPInstance

> XPackageUninstallUWPInstance

# XPackageUninstallUWPInstance

如果目前已安裝，則為目前使用者解除安裝指定套件的通用 Windows 平台 (UWP) 執行個體。

## 語法

```cpp theme={null}
HRESULT XPackageUninstallUWPInstance(  
         const char* packageName  
)  
```

### 參數

*packageName*   \_In\_z\_\
類型：char\*

要解除安裝的套件名稱。此值必須與 UWP 套件的 `AppXManifest` 中 `Identity` 元素的 `Name` 屬性值相符。

### 傳回值

類型：HRESULT

如果套件已解除安裝 (或並未為該使用者安裝)，則傳回 `S_OK`；否則傳回 HRESULT 錯誤碼。如果平台不支援此 API，則傳回 `E_NOTIMPL`。

## 備註

> [!NOTE]
>
> 此函式僅適用於 PC 平台。

如果目前已安裝執行個體，此函式會為目前使用者解除安裝 `packageName` 中所指定套件的通用 Windows 平台 (UWP) 執行個體。如果目前使用者目前未安裝指定套件的 UWP 執行個體，則不會執行任何動作，且函式會傳回 `S_OK`。

要解除安裝之套件的發行者，必須與叫用此函式之套件的發行者相符；否則會發生錯誤。

## 需求

**標頭：** XPackage.h

**程式庫：** xgameruntime.lib

**支援的平台**：Windows、XBOX One 系列主機和 XBOX Series 主機

## 另請參閱

[XPackageUninstallChunks](https://docs.xbox.com/zh-TW/reference/system/xpackage/functions/xpackageuninstallchunks.md)\
[XPackage](https://docs.xbox.com/zh-TW/reference/system/xpackage/xpackage_members.md)


## Related topics

- [XPackage (API 內容)](https://docs.xbox.com/zh-TW/reference/system/xpackage/xpackage_members.md)
- [在 Unity 專案中使用 GDK API 的 C# 包裝函式](https://docs.xbox.com/zh-TW/build/gdk-and-engines/unity/unity-api-wrappers.md)
- [Uninstall](https://docs.xbox.com/zh-TW/reference/tools/xtf/xtfapplication/classes/IXtfApplicationClient/methods/uninstall-ixtfapplicationclient-xtfapplication-xbox-microsoft-m.md)
- [XPackageUninstallPackage](https://docs.xbox.com/zh-TW/reference/system/xpackage/functions/xpackageuninstallpackage.md)
- [XPackageUninstallChunks](https://docs.xbox.com/zh-TW/reference/system/xpackage/functions/xpackageuninstallchunks.md)
