(somehwat related to this and this)
tl;dr: Are there some kind of update hooks for desktop-bridge converted apps distributed via the Windows Store? How can I trigger an app update from a converted app?
I use the Windows Store to distribute my electron-powered application. I wonder if there's any way to tell whether the app was updated recently or not?
There's two and a half issues I have:
1) I store settings in AppData\Roaming
which seems to be virtualized for store apps. Sadly, it seems like the whole directory was cleared when I pulled the app update from the store and thus all the user settings were lost. Is there any way to keep the AppData on app updates?
2) How can I trigger an app update from within the converted app? For what I understood the store won't auto-update apps (not even if it's marked as mandatory). Having to fire up VS and writing an exe that uses some store API to update the app seems like overkill. Is there any easier solution?
2½) How do I know if my app was updated? I thought about storing the app version in the settings and comapring that with the running version on app start. But due to my issue 1) that's not working.
Thanks in advance.
Feel free to post more answers. The accepted answer, albeit being correct and pointing the right direction, still feels cumbersome. In an ideal world there would be a drop-in solution that you'd just npm i
. So be encouraged to find/build simpler solutions. (Many thanks to the John Stephan Wick whatsoever!)
To get notified when an update has been deployed for your UWP or DesktopBridge app, you can implement an UpdateTask: docs / sample code
You can also check at runtime what is the version of your package: https://learn.microsoft.com/en-us/uwp/api/windows.applicationmodel.packageversion
Your app will get updates automatically, but we won't update it while the user is running your app. If the app process keeps running, we will eventually force update it, but only when the screen is locked. You can also check from your code if an update is available and take action accordingly: https://blogs.msdn.microsoft.com/appinstaller/2016/11/11/developer-controlled-app-updates/
Your appdata should persist across app updates. If that's not what you are seeing, please post a separate dedicated question about this with repro details and we will follow up.
Thanks!