Finding Installed Metro Applications on a Machine

I am trying to write a C # code snippet to find all installed Metro apps on a machine. I stumbled upon the following message Get a list of Metro apps and run them on Windows 8 using PowerShell , which explains getting this from the registry. Is this the only reliable way to get a list? Does anyone know any other ways? thanks in advance

+5
source share
4 answers

I would like to comment ... Is this an option?

IEnumerable<Windows.ApplicationModel.Package> packages = (IEnumerable<Windows.ApplicationModel.Package>)packageManager.FindPackagesForUser(""); 

http://msdn.microsoft.com/en-us/library/windows/apps/windows.management.deployment.packagemanager.aspx

+4
source

Thanks everyone! In order for the PackageManager code to work, I had to do the following

1) Add the following to .csproj.

  <PropertyGroup> <TargetPlatformVersion>8.0</TargetPlatformVersion> </PropertyGroup> <Reference Include="System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/> 

2) Add a link to C: \ Program Files (x86) \ Windows Kits \ 8.0 \ Libraries \ CommonConfiguration \ Neutral \ Windows.winmd

After doing the above, I was able to list all the metro packages.

+7
source

You cannot iterate over all packages installed on a PC in the WinRT application. This is possible in desktop and console applications. See these MSDN streams for details.

How to get a list of all Metro apps in a Metro app?

How do I get a list of Metro apps in a Metro app?

To execute the same code here.

+1
source

If someone is wondering how to get the packageManager variable in the accepted answer, you need to do the following:

 Windows.Management.Deployment.PackageManager packageManager = new Windows.Management.Deployment.PackageManager(); 

I think this refers to the comment, but I do not have enough reputation, sorry.

0
source

Source: https://habr.com/ru/post/1496483/


All Articles