From 4626a6849203c319dc8690599ec4142dbc945f1a Mon Sep 17 00:00:00 2001 From: zx Date: Mon, 14 Dec 2015 09:24:45 +0800 Subject: [PATCH] fix basic example, which will fill on Windows --- examples/basic.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/basic.js b/examples/basic.js index 8611ff9..e26381c 100644 --- a/examples/basic.js +++ b/examples/basic.js @@ -12,6 +12,7 @@ var gui = require('nw.gui'); var pkg = require('../package.json'); // Insert your app's manifest here var updater = require('node-webkit-updater'); +var path = require('path') var upd = new updater(pkg); var copyPath, execPath; @@ -44,9 +45,9 @@ else { // if no arguments were passed to the app // ------------- Step 3 ------------- upd.unpack(filename, function(error, newAppPath) { if (!error) { - + var newAppDir = path.dirname(newAppPath); // ------------- Step 4 ------------- - upd.runInstaller(newAppPath, [upd.getAppPath(), upd.getAppExec()],{}); + upd.runInstaller(newAppPath, [upd.getAppPath(), upd.getAppExec()], {cwd: newAppDir} ); gui.App.quit(); } }, manifest);