question

Madhu-8808 avatar image
1 Vote"
Madhu-8808 asked ·

UWP Windows 10 app update

Hi,

Is there a way to know when the UWP app get updated and user access the app for the first time after the update.
If I need to copy certain files or to do some other action after a update for the first time user access the app, what is the best way to do that?

Also after an update it'll not affect any of the existing data in these. Is that correct?
- ApplicationData.LocalSettings
- Sqlite data
- Files in the Localstate folder

Thanks
Madhu



windows-uwp
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

NicoZhu-MSFT avatar image
2 Votes"
NicoZhu-MSFT answered ·

Is there a way to know when the UWP app get updated and user access the app for the first time after the update.

We provide Update Task background task that invokes a background task after the app is updated on the device. This document details how to register the background task to run when the app is updated.

In general, we store the current app's version number into the LocalSettings . Every time we start the application, we check the version of the application and compare it with LocalSettings . You can get package version with the PackageVersion api.


· 3 · Share
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@NicoZhu-MSFT thank you. At start of the application means you check that in the app.xaml.cs?

Also can you please confirm my last statement related to data storage is correct.

0 Votes 0 · ·

Update not affect any data in LocalStorage. And you can create a LocalSettings to check if app is first time open after update (parameter is current app version)

2 Votes 2 · ·

as macintoshpro said update will not affect the localstorage data.

1 Vote 1 · ·