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

# XPackageUninstallUWPInstance

> XPackageUninstallUWPInstance

# XPackageUninstallUWPInstance

如果当前用户已为指定包安装了通用 Windows 平台 (UWP) 实例，则卸载该实例。

<a id="syntaxSection" />

## 语法

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

<a id="parametersSection" />

### 参数

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

要卸载的包的名称。此值必须与 UWP 包的 `AppXManifest` 中 `Identity` 元素的 `Name` 属性值匹配。

<a id="retvalSection" />

### 返回值

类型：HRESULT

如果包已被卸载（或用户未安装该包），则返回 `S_OK`；否则，返回 HRESULT 错误代码。如果平台不支持此 API，则返回 `E_NOTIMPL`。

<a id="remarksSection" />

## 备注

<Note>此函数仅适用于 PC 平台。</Note>

如果当前用户已安装 `packageName` 中指定包的通用 Windows 平台 (UWP) 实例，则此函数会卸载该实例。如果当前用户未安装指定包的 UWP 实例，则不会发生任何操作，函数返回 `S_OK`。

要卸载的包的发布者必须与调用此函数的包的发布者匹配；否则会发生错误。

<a id="requirementsSection" />

## 要求

**头文件：** XPackage.h

**库：** xgameruntime.lib

**支持的平台**：Windows、XBOX One 系列主机和 XBOX Series 主机

<a id="seealsoSection" />

## 另请参阅

[XPackageUninstallChunks](/reference/system/xpackage/functions/xpackageuninstallchunks)\
[XPackage](/reference/system/xpackage/xpackage_members)


## Related topics

- [XPackage](/zh-CN/reference/system/xpackage/xpackage_members.md)
- [面向 GDK 的 Unity C# API 包装器](/zh-CN/build/gdk-and-engines/unity/unity-api-wrappers.md)
- [XPackageUninstallPackage](/zh-CN/reference/system/xpackage/functions/xpackageuninstallpackage.md)
- [XPackageUninstallChunks](/zh-CN/reference/system/xpackage/functions/xpackageuninstallchunks.md)
- [IXtfApplicationClient::Uninstall](/zh-CN/reference/tools/xtf/xtfapplication/classes/IXtfApplicationClient/methods/uninstall-ixtfapplicationclient-xtfapplication-xbox-microsoft-m.md)
