Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Finding out installed Metro applications on a machine

I am trying to write a piece of code in C# to find all installed Metro Applications on a machine. I came across the following post Get a list of metro apps and launch them in Windows 8 using PowerShell which explains obtaining this from the system registry. Is this the only reliable way to obtain the list? Does anyone know of any other ways? Thanks in advance

like image 634
Yam Avatar asked Aug 12 '13 03:08

Yam


3 Answers

Thanks everyone! 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 reference to C:\Program Files (x86)\Windows Kits\8.0\References\CommonConfiguration\Neutral\Windows.winmd

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

like image 86
Yam Avatar answered Nov 10 '22 01:11

Yam


I wish I could 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

like image 28
n00b Avatar answered Nov 10 '22 03:11

n00b


You can't iterate through all packages installed in PC in WinRT app. It's possible in desktop and console app. See these MSDN threads for more info.

How to get all Metro apps list in Metro App?

How do I get all Metro style apps list in my Metro App?

To perform the same here's code.

like image 31
Farhan Ghumra Avatar answered Nov 10 '22 03:11

Farhan Ghumra