Does local storage get deleted when a user updates my app?

删除回忆录丶 提交于 2019-12-19 08:11:08

问题


I have a windows 8 app (Digital Nightstand) in the windows 8 appstore. The app stores user preferences in XML files on the user's machine, also known as local storage. What I want to know is that if I release an update for my app and the users take the update, will the existing stored settings be wiped out?


回答1:


The answer is no!

Don't worry when user updates an app, the local and roaming folders/settings won't get wiped out.




回答2:


The data does not get deleted. But if you release an update and If you have changed the version of the data storage, then you need to have a mechanism to copy the data from version 0 to version 1.

You can optionally version the application data for your app. This would enable you to create a future version of your app that changes the format of its application data without causing compatibility problems with the previous version of your app. The app checks the version of the application data in the data store, and if the version is less than the version the app expects, the app should update the application data to the new format and update the version. For more info, see the Application.Version property and the ApplicationData.SetVersionAsync method.

Application data sample http://code.msdn.microsoft.com/windowsapps/ApplicationData-sample-fb043eb2 includes code for version which should be helpful for you.

Versioning: Application data can utilize versioning of app data to upgrade from one data structure to another. The version number is different from the application version and can be set at will. Although not enforced, it is highly recommended to only use increasing version numbers, since an undesired situation, including data loss, could occur when transitioning to a lower data version number that represents newer data. Please note that application data only roams between apps with the same version number. For example, devices on version 2 will transition data between each other and devices on version 3 will do the same, but there is no automatic transition between version 2 and version 3 devices. This is the responsibility of the app at the time of version number update. Installing a new application that has previously been utilizing various version numbers on other devices will start out with the highest version number application data available




回答3:


No the data persists after update. I know it happens when you change your manifest file in visual studio but not when app is updated through market.



来源:https://stackoverflow.com/questions/13339334/does-local-storage-get-deleted-when-a-user-updates-my-app

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