UWP 应用升级方法 - 不丢失用户数据 [英] UWP App Upgrade Approach - Without Losing User Data

查看:42
本文介绍了UWP 应用升级方法 - 不丢失用户数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 UWP 应用部署到 Microsoft Store,并且正在使用中.这是一个业余项目,免费提供,虽然我会时不时地更新它,但这样的更新可能很少见.我即将向商店发布一个新版本 - 这将是我第一次这样做.

I have a UWP app deployed to the Microsoft Store, and in use. It's a hobby project, available for free, and although I will update it now and then such updates will probably be infrequent. I'm about to release a new version to the store - it will be the first time I have done this.

该应用程序包含在运行时创建的 SQLite 数据库(因此不是解决方案/源代码的一部分).

The app includes a SQLite database, which is created at runtime (so not part of the solution / source code).

更新:最终的文件夹是:C:\Users\...\AppData\Local\Packages\[Package ID]\LocalState

我想发布一个新版本,而不会让用户丢失数据库中的现有数据.

I'd like to release a new version without having the user lose their existing data in the database.

最好的升级方法是什么?

What's the best upgrade approach?

  1. 使用现有的包/身份/名称,但使用递增版本.
  2. 使用不同的包/身份/名称.
  3. 还有别的吗?

推荐答案

只选择选项 1,应用程序得到更新,而 应用程序数据 - LocalState/RoamingState/TempState 中的文件 文件夹 - 在升级过程中保持不变.

Just chose option 1, the app gets updated, while the app data - the files in LocalState/RoamingState/TempState folders - is untouched during the upgrade.

引自 Windows 应用团队博客:

应用数据在 Windows 应用商店和 Windows Phone 应用商店提供的应用更新中保留.因此,必须准备好应用更新,以加载由该应用的任何先前版本生成的应用数据.

App data is preserved across app updates delivered by the Windows Store and the Windows Phone Store. So app updates must be prepared to load app data that was generated by any previous version of the app.

选项 2 在应用商店中创建一个新应用,与您现有的应用无关.

Option 2 creates a new app in the Store, which has nothing to do with your existing app.

这篇关于UWP 应用升级方法 - 不丢失用户数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆