Windows 商店应用更新

Windows store app update

windows store(windows 10) 只允许增量更新还是我们可以通过其他方式更新?如果我们在 windows store(windows 10) 我在我的 machine.After 中下载了它,该应用程序有一段时间更新可用,我已经更新了 app.Now,我想验证它是否遵循增量更新或者它用新的一个。我如何验证它?

Is windows store(windows 10) allow only delta update or we can update in some other way?

您可以select始终生成应用程序包如果需要创建应用程序包以实现增量更新。 App bundle 使用不同的清单来包含资源包。因此,使用 app bundle,用户只下载相关文件,而不是所有可能的资源,尤其是当您的应用程序包含特定语言的资产时。

要让用户下载整个包,您可以选择从不生成应用程序包。但请注意,一旦您的应用程序发布为 appxbundle,您就无法返回到非 appxbundle 格式。这次你可以尝试 this article 中的方法来确保你的资源一定会安装在用户的设备上,这是针对 Windows 8.1 但仍然适用于 UWP 应用程序。

并且从版本 1607 开始,我们可以使用 Windows.Services.Store 中的 API 以编程方式检查当前应用程序的包更新,下载并安装更新的包。

Now, I want to verify weather it follow delta update or it replaces the entire application with the new one. How can i verify it?

首先,您的包需要包含特定语言的资产或各种图像比例资产,确保包括您的设备不支持的语言或您的设备未配备的图像比例。您需要在创建包时生成一个应用程序包。下载更新后,您可以检查您的本地包中是否包含不需要的资源包。

除了如 Mattew Wu 提到的从 App Bundle 选择正确的语言、图像大小外,UWP 还自动支持增量更新(或差异更新)。在 MSDN blogs.

中的 post 博客中查看更多信息

打包时自动创建了一个“AppxBlockMap.xml”,即

an XML document that contains a two dimensional list of information about files in the package. The first dimension lays out high level details on the file (e.g. name and size) and the second dimension provides SHA2-256 hash representations of each 64KB slice of that file (aka the “block”).

因此,商店更新会比较两个包中的此文件并仅下载所需的部分。

我认为您无法检查将要下载的 delta 包的大小,但您可以遵循一些方法来确保您的应用支持 delta 更新

  1. Keep files in the package small – doing this will ensure that if a change is needed that would impact the full file, the update would still be small.
  2. Modifications to files should be additive if possible – additive changes will ensure that end-user devices only download those changed blocks.
  3. Modifications to files should be contained to 64KB blocks if possible – if your app does have large files and requires changes to the middle of a file, containing changes to a set of blocks will go a long way

更详细的解释请参考上述博客post。