May 17 2019 01:54 AM
Hi
I am trying to uninstall a MSIX package through C++ program, and know of the RemovePackageAsync method. However, for that method to work, you require the package's full name (i.e. MSIXSample_x64_...).
Is there a way to get the installed package's full name so that I can use it as a parameter for RemovePackageAsync(), or is there a better way to uninstall the package?
Thanks!
Dickson
May 21 2019 10:24 AM
Hi @dicksonchan,
You can use PowerShell cmdlets to get the package's full name: https://docs.microsoft.com/en-us/powershell/module/appx/get-appxpackage?view=win10-ps
You can also use a PowerShell cmdlet to remove the MSIX package as well: https://docs.microsoft.com/en-us/powershell/module/appx/remove-appxpackage?view=win10-ps
Best,
Sharla
May 28 2019 02:27 PM
@dicksonchan If you are using the PacakgeManager.RemovePackage you can also use the FindPackage option as well: https://docs.microsoft.com/en-us/uwp/api/windows.management.deployment.packagemanager.findpackage
May 28 2019 07:59 PM
@John Vintzel If I use FindPackage(), I would require the package's full name for the method to work, which is what I am still having trouble looking for
May 28 2019 08:01 PM
Hi @ShakersMSFT
I know of the PowerShell commands. But is there a way to retrieve the package full name as a string so that I can automate these commands (Get-AppxPackage to get the name and Remove-AppxPackage immediately)?
May 28 2019 08:34 PM
@dicksonchan Sorry, it should be FindPackages.
https://docs.microsoft.com/en-us/uwp/api/windows.management.deployment.packagemanager.findpackages
John.