Rahul Soni
Rahul Soni

Reputation: 21

Why nwjs updater is not wokking on macOS?

Basically, I tried to package an app using nwjs and also installed nwjs updater as mentioned in documentations.

For window it creates an .exe file and after installation if there is any update the nwjs updater checks for it and inform the user to download the latest version. It's working fine on window.

But For macOS It creates a zip which contains our app as application.app, secondly we need to make a package installer. i used packages a free tool to package my application. i just need to use the created application.app into packages tool and it create a package installer.

this time the problem is the nwupdater does'nt work and closes the app immediately.

Hope anyone has a solution for the same or an alternate for whole.

I just want my application which is written in html, css and javascript to be used as a native app on macOS with installer and updater.

Upvotes: 1

Views: 224

Answers (1)

Jaredcheeda
Jaredcheeda

Reputation: 2022

This is a great question. It's been a while since I looked into this. But I don't know of any automated build tools that are still well maintained. Most of the community just writes their own custom build scripts for their applications. The one that was most used is now archived and slowly getting out of sync with the needs of the community (phoenix). With automated updates, there are several approaches and tools you could try, but none of them ever took off and became the most used solution. It turns out auto-updating is fairly app-specific so you will have to look at the solutions available.

If I were to create my own auto-updater my approach would be:

  1. Use something like nw-splasher to launch a splash screen with a progress bar.
  2. Check require('path').join(nw.App.dataPath, 'releases') to see what the latest release is that is already downloaded.
  3. Hit an API to see what the latest version of the app is. If the API can't be reached, use the latest local version.
  4. If there is a newer version, then just download/unzip the files for my app code, (not the NW.js files, as they are much bigger, and already running).

With this approach I could even add a drop down of all the downloaded versions in the app, so people could switch to older versions if desired (not wanting to force users to the latest if it deprecates a feature they like, I use a lot of older software for this reason, and some "auto-updating" ones prevent me from getting the version I'd prefer).

This approach is certainly not the most efficient, and has some drawbacks. Like not really updating the NW.js files themselves which may be desirable.

I would recommend reading through this long thread of other's ideas on the subject, many link to tools they've created.

If you are going to write your own build script, here is a tutorial that may help:

Though I think OSX has changed a few of the specifics since that was written, but the approach is basically the same.

Upvotes: 2

Related Questions