如何获取所有已安装应用程序的列表并在 UWP WinRT 8.1 中运行它们 [英] how to get list of all installed apps and run them in UWP WinRT 8.1

查看:31
本文介绍了如何获取所有已安装应用程序的列表并在 UWP WinRT 8.1 中运行它们的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我实际上正在为我的一个客户创建一个 UWP 8.1 应用程序.我遇到了一些小问题.在我的应用程序的某个时刻,我必须获取设备中已安装应用程序的所有名称,然后将其视为列表.当用户单击其中任何一个时,我必须启动该特定应用程序.我已经尝试在应用程序清单中添加受限功能,但添加时它显示一条蓝线,此外,我可以通过某种方式使用文件夹选择器访问 AppData/Packages,但不知道该怎么做.该应用程序适用于 WinRT Surface 3,它不会存储或只有一个用户的任何内容.因此,如果有人知道任何解决方案,请告诉我.

I'm actually creating an UWP 8.1 app for one of my client.And I've got some little issue with it.At some point of my app I've to get all the names of installed app in the device and view it as a list.When the user will click on any of them, I've to launch that certain app. I've already tried to add restricted capabilities in the app manifest but it shows a blue line when I add, Morever I can get access to the AppData/Packages by using folderpicker somehow but don't know what to do. The app is for WinRT surface 3 and it isn't going to store or anything it has only one user. So if anyone know any sort of solution please let me know.

推荐答案

PackageManager 类具有枚举所有已安装应用程序的方法.

The PackageManager class has the methods to enumerate all installed apps.

但是,在 8.1 中,PackageManager 只能用于桌面应用程序(例如 WPF、Winforms、Win32).无法在该版本操作系统上的应用商店应用中使用它.

However, in 8.1 the PackageManager can only be used in desktop apps (e.g. WPF, Winforms, Win32). It cannot be used from a Store app on that version of the operating system.

在 Windows 10 上,您可以使用 Store/UWP 应用以及经典桌面应用中的类.

On Windows 10 you can use the class from both Store/UWP apps as well as classic desktop apps.

这篇关于如何获取所有已安装应用程序的列表并在 UWP WinRT 8.1 中运行它们的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆