Skip to content

Commit da2b4a5

Browse files
dsheikorogerwang
authored andcommitted
adding PR - for nw-autoupdater
1 parent 2072b9e commit da2b4a5

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

docs/For Users/Advanced/Autoupdates.md

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
NWJS tend to support the update solution made by community, not a built-in one. Below is the list of existing soutions, which worth checking.
77
- [node-webkit-updater](https://github.com/edjafarov/node-webkit-updater) (by [@edjafarov](https://github.com/edjafarov))
88
- [nwjs-autoupdater](https://github.com/oaleynik/nwjs-autoupdater) (by [@oaleynik](https://github.com/oaleynik))
9+
- [nw-autoupdater](https://github.com/dsheiko/nw-autoupdater) (by [@dsheiko](https://github.com/dsheiko))
910

1011
## node-webkit-updater
1112

@@ -22,7 +23,7 @@ You should build this logic by yourself though ([basic example](https://github.c
2223

2324
## nwjs-autoupdater
2425

25-
The tiny golang application (when built it is just ~2MB), which can be bundled with NWJS application and then used to unpack updates.
26+
The tiny golang application (when built it is just ~2MB), which can be bundled with NWJS application and then used to unpack updates.
2627
To update target application updater needs to know two things - where zip archive with the new version is located and where is the app's executable to restart application after update. These can be passed to updater via command line arguments `--bundle` and `--inst-dir`, where `--bundle` is the path to the zip archive with the new app version and `--inst-dir` is the path to app's executable.
2728

2829
There are multiple advantages over `node-webkit-updater`:
@@ -31,4 +32,19 @@ There are multiple advantages over `node-webkit-updater`:
3132
- Doesn't require elevated privilegies (unless application itself has been installed in the folder which require elevated privilegies).
3233
- Updater's executalbe has way smaller size as it doesn't require bundling the whole new NWJS application with the main application.
3334

34-
The logic to check for updates needs to be built on your own too. The [example](https://github.com/oaleynik/nwjs-autoupdater/blob/master/examples/index.js) shows the way how to use javascript module as an entry point for NWJS application and check for updates in background.
35+
The logic to check for updates needs to be built on your own too. The [example](https://github.com/oaleynik/nwjs-autoupdater/blob/master/examples/index.js) shows the way how to use javascript module as an entry point for NWJS application and check for updates in background.
36+
37+
## nw-autoupdater
38+
39+
The NPM module provides API similar to one of `node-webkit-updater`, but extended, adapted for NW.js with Node 7.x and based on clean async/await syntax. Namely it allows to:
40+
- Read the manifest from the remote release server
41+
- Check if the version in the remote manifest greater than one of the local manifest
42+
- Download the latest available version matching the host platform (according to the `packages` map of the remote manifest)
43+
- Subscribe for download progress events
44+
- Unpack it in a temporary directory (zip or tar.gz)
45+
- Subscribe for install progress events
46+
- Close the app and launch it (as a detached process) from the downloaded release (from temporary directory)
47+
- Backup actual version and replace it with the new one
48+
- Restart the updated app from its original location
49+
50+
The package includes examples of release server and client.

0 commit comments

Comments
 (0)