UWP App Upgrade Approach - Without Losing User Data

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-08 08:57:06

问题


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.

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

Update: the folder this ends up in is: 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. Use existing Package/Identity/Name, but with an incremented version.
  2. Use a different Package/Identity/Name.
  3. Something else?

回答1:


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

Quoted from Windows Apps Team blog:

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.

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



来源:https://stackoverflow.com/questions/52304093/uwp-app-upgrade-approach-without-losing-user-data

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!