8bitcartridge
8bitcartridge

Reputation: 1721

Is there a way to detect what Windows Store apps are installed on a system with native C# calls?

I'm trying to replicate the functionality of the Get-AppxPackage and Get-ProvisionedAppxPackage Powershell cmdlets for a C# application I'm building, but have no idea how to even get started.

I can't use the C# Powershell API because of this problem, so I'd like a native C# solution if possible.

Upvotes: 3

Views: 3375

Answers (2)

8bitcartridge
8bitcartridge

Reputation: 1721

For what it's worth, I did find a way to get this information directly from WMI: There's a WMI class called Win32_InstalledStoreProgram that returns the desired information

Upvotes: 2

Rob Caplan - MSFT
Rob Caplan - MSFT

Reputation: 21899

You can use the Windows.Management.Deployement.PackageManager to find, remove, install, etc. packages from code rather than from PowerShell.

The Enumerate app packages sample demonstrates how to use this from C# and C++.

Upvotes: 4

Related Questions