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 ?
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.
You can try to make it based on node-webkit-updater.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With