在 UWP 中获取已安装的应用程序列表

问题描述:

我有一个应用程序需要读取用户移动设备上所有已安装应用程序的名称.但我不能那样做.如何在 Windows 10 移动版上的通用 Windows 平台中获取已安装应用程序的列表?

I have an application that needs to reads name of all installed app on user mobile. but i can't do that. How can i get list of installed applications in Universal Windows Platform on windows 10 mobile?

感谢您的帮助

您需要添加Windows Mobile Extensions for the UWP 并使用以下代码:

You need to add Windows Mobile Extensions for the UWP and use the following code:

if (ApiInformation.IsTypePresent("Windows.Phone.Management.Deployment.InstallationManager"))
{
    var packages = Windows.Phone.Management.Deployment.InstallationManager.FindPackages();
    foreach (var package in packages)
    {
        Debug.WriteLine(package.DisplayName);
    }
}

但此代码需要 ID_CAP_OEM_DEPLOYMENT.据我所知 msdn

But this code requires ID_CAP_OEM_DEPLOYMENT. As I know from msdn

我假设您需要公司证书,并且必须使用该证书签署您的应用程序才能使这些权限发挥作用.

I would assume that you would require a company certificate and would have to sign your Apps with that certificate in order for those permissions to work.