Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Node-Webkit launcher+updater

I'm creating a HTML5 game that will be released with Node-Webkit, and I'd like to make a launcher that checks for updates and download them. By now, players have to download the new app, and it's not really user-friendly.

Do the updater is not a problem. I know how to check the version on external site, download the files and update the app. My problem is I can't launch the game after. Is there a way to launch an exe from a NW app ?

I tried to launch updater and game in the same app, but in two windows. The problem remains the same, I can't re-launch the app after.

Have a clue ?

like image 489
Shivaan Keldon Avatar asked Sep 12 '26 10:09

Shivaan Keldon


2 Answers

You can create a simple .bat file which will wait a few seconds and relaunch the app. You execute that .bat from you node-webkit app just after the update is completed and before app.Quit(). The wait in .bat file is needed for the current application to close.

It does obviously look somewhat like a hack, but until proper app.Restart() is implemented, I guess this can satisfy your needs.

You can track the progress about app.Restart() and see a simple implementation of that .bat file here in the issue tracker for node-webkit https://github.com/rogerwang/node-webkit/issues/149#issuecomment-28094352.

like image 73
MnZrK Avatar answered Sep 15 '26 11:09

MnZrK


You can try to make it based on node-webkit-updater.

like image 39
Vitaly Sivkov Avatar answered Sep 15 '26 13:09

Vitaly Sivkov



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!