简体   繁体   English

有没有办法检测具有本机C#调用的系统上安装的Windows应用商店应用?

[英]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-AppxPackageGet-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.

相关问题 Windows 8 Store Apps 中 c# CollectionBase 的替代品是什么? - what is the replacement of c# CollectionBase in windows 8 Store Apps? Windows应用商店应用C#-Capslock开/关 - Windows store apps c# - capslock on/off 在C#Windows Store应用中保存图像 - Save image in C# Windows Store apps 在C#windows存储应用程序中使用叙述者 - Using the narrator in C# windows store apps 如何使用与Windows应用商店应用兼容的命名空间将JSON字符串转换为本机C#数组? - How do i convert a JSON string to a native C# array using a namespace compatible with Windows Store Apps? c#中是否有System.Diagnostics.process类的替代项(因为Windows 8商店应用程序不可用)? - are there any alternates for System.Diagnostics.process class in c# (as it is unavailable for windows 8 store apps)? 使用C#如何检测Windows Installer 4.5是否已安装 - Using C# How to detect if Windows Installer 4.5 is Installed 如何检测是否安装了 Powershell Core 以及 C# 中的哪个版本? - How to detect if Powershell Core is installed and what version in C#? 在Windows Store Apps中使用REST服务的最佳方法是什么? - What is the best way to consume REST services in Windows Store Apps? C#System.Windows.Forms.WebBrowser需要安装Flash - C# System.Windows.Forms.WebBrowser Requires Flash to be Installed
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM