0

I have the ProductId for an app:

https://apps.microsoft.com/store/detail/msn-weather/9WZDNCRFJ3Q2

Where the ProductId is 9WZDNCRFJ3Q2. This is used by AppInstallManager to programmatically install from Store.

I would like to know if an app is already installed, based on its ProductId alone. Is it possible to find a package on a device given only the ProductId?

TomSelleck
  • 6,706
  • 22
  • 82
  • 151

1 Answers1

1

Is it possible to find a package on a device given only the ProductId?

No, you can't find the app via the ProduceID. There is no API could do that.

If you could get the packageFullName of the target app, there is another option for you to find if an app is installed on the device. The PackageManager Class contains 4 different methods which could find specific packages installed on the device.

These methods require the packageFullName as the parameter. And you need to call these APIs in a desktop application because these methods require administrative privileges.

Roy Li - MSFT
  • 8,043
  • 1
  • 7
  • 13
  • It's not super ideal as I've only depended on the ProductId until now and requiring an additional parameter is a non-trivial change... Can the PackageFullName be retrieved via a Store API call? – TomSelleck Jun 20 '22 at 10:38
  • @TomSelleck Are you trying to get the PackageFullName for other apps that are not developed by you? If it is, the answer is no. – Roy Li - MSFT Jun 21 '22 at 03:09