How to confirm the UWP package is game app from the package object

charles yu 1 Reputation point
2021-11-30T09:17:33.18+00:00

var packages = manager.FindPackagesForUser(user.Value)
.Where(x => !x.IsFramework && !x.IsResourcePackage && x.SignatureKind == PackageSignatureKind.Store)
.Where(x => x.InstalledLocation != null);

I can get the all local UWP packages object, but i can't know which package is game type.

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,413 questions
Universal Windows Platform (UWP)
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Nico Zhu (Shanghai Wicresoft Co,.Ltd.) 12,856 Reputation points
    2021-12-01T06:15:11.26+00:00

    Hello,
    Welcome to Microsoft Q&A!

    I have to say, you can't detect which package is game type with PackageManager api, and Package class does not contain such product kind property.

    For your scenario, the better way is use app's StoreProduct to identify game app. Because StoreProduct has ProductKind property, if the value is Game, you could regard it as game app. For more info please refer to Get product info for apps and add-ons.

    Thank you.


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.