How to get installed package's full name (C++)?

New Contributor

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

5 Replies

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

@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

@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

Hi @Sharla_Akers 

 

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)?