Search code examples
nw.js

How to distribute an update for an nw.js app


With the forthcoming demise of Chrome Web Store Apps, I have successfully transitioned my app to nw.js I was amazed at how easy it was and how it ran first time. About the only tricky thing I encountered was how to get my app icon showing on mac.

However I am somewhat worried about app updates. Does anyone know what happens to persistent data (indexed-DB etc) when a user updates a nw.js app with a new version that I publish to my web site for download?

Also if anyone can help me with how to achieve automatic updates. I mean the full works here. What code is needed to check for an update, what code do I need to write to deliver the update, what code is needed to install the update. Chrome did all of this for me and I know absolutely nothing about server side coding.


Solution

  • For mac there is a mac store support: http://docs.nwjs.io/en/latest/For%20Users/Advanced/Support%20for%20Mac%20App%20Store/

    IndexedDb, localstorage, etc. will persists until the app name will not change.

    For automatic updates:
    There is an ongoing pull request going on for auto updater. https://github.com/nwjs/nw.js/pull/5722
    Till then, the easiest way for auto update Your application code is to host your app code on the web and open the web page with nw.js. If You want to autoupdate the nw.js itself then you will have to provide an installer for that and tell the user to download and run the installer if there is a new update.