Node-Webkit Demo of how to use nw-builder and nw-updater, based on example from:
- https://github.com/nwjs/nw-builder/tree/master/example/
- https://github.com/edjafarov/node-webkit-updater/tree/master/app
https://github.com/nwjs/nw-builder
https://github.com/edjafarov/node-webkit-updater
function deleteApp(cb){
console.log("del:" + to);
// In windows platform, can't delete nw parenet running folder 'to' AppPath, just to delete all content inside AppPath
//del(to, {force: true}, cb);
del(to + '\\*', {force: true}, cb);
}
function newAppInstalled(err){
if(err){
console.log(err);
return;
}
// Can't pass null to upd.run, should use [] as parameter
//upd.run(execPath, null);
upd.run(execPath, []);
gui.App.quit();
}
npm install nw-builder -g
cd nwapp
npm install
Install node_modules dependency for demo builder (optional if you don't have all modules for nw-builder yet)
# goto root of demo
npm install
# goto root of demo
nwbuild -v 0.12.3 -p win64 ./nwapp
Make nwapp.zip for including all contents under build\nw-demo\win64\
Copy nwapp.zip to folder nw-demo-web
Copy folder nw-demo-web to web server (eg. Tomcat Webapp)
Run nwapp
build\nw-demo\win64\nw-demo.exe
No update will happen, the running version is latest version compare to latest.json in nw-demo-web
Change latest.json for testing purpose, no actual version upgrade in nwapp.zip :
"version": "0.1.0" -> "version": "0.1.1"
Then try to Run nwapp, nwapp updater should be working now. Enjoy! :-)