MBZ
MBZ

Reputation: 27582

Find out that app has been updated

How can I find out if my app (which already running on a system) has been updated since last run (if the user updated it using Windows Store)?

Actually, I'm trying to update (reload, re-fetch, ...) the data of my app when a user installs a new version of it using Windows Store.

My idea is to keep the version of the app in Local Application Data and every time an app start, checks if that's equal to current version. If not, this means an update. But I don't know how can I access the current version of my app running on current system!

Any solution?

Upvotes: 2

Views: 176

Answers (2)

Martin Suchan
Martin Suchan

Reputation: 10620

The perfect solution for this is to use Background Task of type Maintenance, this one is triggered when application is updated.
http://www.microsoft.com/en-us/download/details.aspx?id=27411
Or you can do it manually, just store the current value of app version in app settings and if the version is different after app was started, just run your maintenance code.

Upvotes: 0

Jim O'Neil
Jim O'Neil

Reputation: 23754

If you mean the version as you set up in the package.appxmanifest, then:

Windows.ApplicationModel.Package.Current.Id.Version

see PackageId.Version

Upvotes: 2

Related Questions