> ## 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](/zh-TW/reference/system/xpackage/functions/xpackageuninstallchunks)\
[XPackage](/zh-TW/reference/system/xpackage/xpackage_members)


## Related topics

- [XPackageUninstallUWPInstance](/ko/reference/system/xpackage/functions/xpackageuninstalluwpinstance.md)
- [XPackage](/reference/system/xpackage/xpackage_members.md)
- [XPackageUninstallPackage](/reference/system/xpackage/functions/xpackageuninstallpackage.md)
- [XPackageUninstallChunks](/reference/system/xpackage/functions/xpackageuninstallchunks.md)
