Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make updater a separate app/process. #1

Open
edjafarov opened this issue Jun 15, 2014 · 5 comments
Open

Make updater a separate app/process. #1

edjafarov opened this issue Jun 15, 2014 · 5 comments

Comments

@edjafarov
Copy link
Collaborator

It might make sense to put all logic inside separate process that will work as a service and will download and update the version of the app.
Maybe something like network installer might be a great idea. Updater will be able to download initial version of app and install it.

node_webkit_updater process will be a detached process that will run kind of local server
any node-webkit app will be able to call this server's API
give current manifest, subscribe for updates, give current app folder
if there is node_webkit_updater app will subscribe for existing
otherwise it will spawn new one
if there is a new version of app available node-webkit-updater will download it in tmp folder and ping original app for approve.
original app should approve update and teardown itself
node-webkit-updater will try to copy the app to original folder and run app
(we need to think out what error cases could be)

@adam-lynch
Copy link
Collaborator

We considered a separate updater app but we were worried about the size of our end app if this is bundled with it (because of all the node-webkit boilerplate needed to make an updater app).

@edjafarov
Copy link
Collaborator Author

That makes sense. Need to think about it.

@edjafarov
Copy link
Collaborator Author

nwjs/nw.js#213 when fixed will allow to run js files in webworker.
I guess that would also allow to run updater as background app.
So the app, when running will fork the updater in separate process. The app should be able to hook on updater. Updater will handle everything.

@adam-lynch
Copy link
Collaborator

@edjafarov nwjs/nw.js#213 seems to be fixed. What do you think now?

@matthew-dean
Copy link

@adam-lynch I've used child processes quite a bit for my NW.js app. They work great. I don't think you would need a separate updater app (nor does it seem wise, since it could create a stack of add-on dependency problems, where different apps actually need different versions of node-webkit-updater). You should be able to npm install node-webkit-updater and do a require() as you would normally, and spawn child processes as needed.

I've been thinking about it, though... Child processes are not free (in terms of memory / CPU), meaning you should only spawn one if there's an actual update to download. But... if all that's happening is an http download, is that even blocking the main thread anyway? Or is that handled by a system call that just sends back an event to node when it's done (which would make a child process irrelevant)? I actually don't know the answer to that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants