简体   繁体   English

查找给定 ProductId 的包

[英]Find a Package for a given ProductId

I have the ProductId for an app:我有一个应用程序的ProductId

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

Where the ProductId is 9WZDNCRFJ3Q2.其中 ProductId 是 9WZDNCRFJ3Q2。 This is used by AppInstallManager to programmatically install from Store. AppInstallManager使用它以编程方式从商店安装。

I would like to know if an app is already installed, based on its ProductId alone.我想知道一个应用程序是否已经安装,仅基于它的 ProductId。 Is it possible to find a package on a device given only the ProductId?是否可以在仅给定 ProductId 的设备上找到包?

Is it possible to find a package on a device given only the ProductId?是否可以在仅给定 ProductId 的设备上找到包?

No, you can't find the app via the ProduceID.不,您无法通过 ProduceID 找到该应用程序。 There is no API could do that.没有 API 可以做到这一点。

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.如果您可以获取目标应用程序的packageFullName ,那么您可以通过另一个选项来查找设备上是否安装了应用程序。 The PackageManager Class contains 4 different methods which could find specific packages installed on the device. PackageManager 类包含 4 种不同的方法,可以找到设备上安装的特定包。

These methods require the packageFullName as the parameter.这些方法需要packageFullName作为参数。 And you need to call these APIs in a desktop application because these methods require administrative privileges.您需要在桌面应用程序中调用这些 API,因为这些方法需要管理权限。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM