PackageExtensionCatalog.RequestRemovePackageAsync(String) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Attempts to remove the specified extension package from the machine.
public:
virtual IAsyncOperation<bool> ^ RequestRemovePackageAsync(Platform::String ^ packageFullName) = RequestRemovePackageAsync;
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncOperation<bool> RequestRemovePackageAsync(winrt::hstring const& packageFullName);
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperation<bool> RequestRemovePackageAsync(string packageFullName);
function requestRemovePackageAsync(packageFullName)
Public Function RequestRemovePackageAsync (packageFullName As String) As IAsyncOperation(Of Boolean)
Parameters
- packageFullName
-
String
Platform::String
winrt::hstring
The name of the package to remove, which you can get from PackageExtension.Package.Id.FullName.
Returns
Returns true if the request to the user to remove the package was made; otherwise, false.
This function will return false if you try to use a Package name that is not associated with an extension in the PackageExtensionCatalog instance. The return value doesn't reflect whether the package was actually removed or not. If the user accepts the prompt to remove the package, a PackageUninstalling event will be raised.
- Attributes
Remarks
The user is prompted to allow or deny the package removal. You can only remove packages that contain extensions found in the PackageExtensionCatalog instance you make the call from.
The unit of deployment for PackageExtensions is the Package. You cannot remove PackageExtensions; you can only remove Packages. Packages may contain multiple PackageExtensions.
The user may not understand the relationship between PackageExtensions and Packages, or between an PackageExtension and an app on the machine (because an app may be designed to also serve as an extension). The user may accept the request to remove a package thinking that they are only removing an extension but then find that one of their favorite apps is now gone. Only use this method if you are certain that the PackageExtension is the only thing in the package.
Avoid using this method if you do not control the ecosystem of extensions involved. This method is intended for convenience in a closed ecosystem of extensions, such as in an enterprise environment.
Desktop Bridge extension hosts cannot use this method directly. Desktop Bridge extension hosts should use their Universal Windows Platform component to manage package extensions. For more information, see Building an MSIX package from your code.