[英]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. 我正在尝试为我正在构建的C#应用程序复制Get-AppxPackage和Get-ProvisionedAppxPackage Powershell cmdlet的功能,但不知道如何开始。
I can't use the C# Powershell API because of this problem , so I'd like a native C# solution if possible. 由于这个问题 ,我不能使用C#Powershell API,所以如果可能的话,我想要一个原生的C#解决方案。
You can use the Windows.Management.Deployement.PackageManager to find, remove, install, etc. packages from code rather than from PowerShell. 您可以使用Windows.Management.Deployement.PackageManager从代码而不是PowerShell中查找,删除,安装等软件包。
The Enumerate app packages sample demonstrates how to use this from C# and C++. Enumerate app packages示例演示了如何在C#和C ++中使用它。
为了它的价值,我确实找到了一种直接从WMI获取此信息的方法:有一个名为Win32_InstalledStoreProgram的WMI类,它返回所需的信息
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.