Make use of process.argv[0] instead of hardcoding "node" to windosu

This commit is contained in:
Juan Cruz Viotti 2015-03-03 11:32:56 -04:00
parent 6a83a537c7
commit b2444feae9
2 changed files with 2 additions and 2 deletions

View File

@ -123,7 +123,7 @@
if (os.platform() === 'win32' && (error != null) && (error.code === 'EPERM' || error.code === 'EACCES')) {
windosu = require('windosu');
resinWritePath = "\"" + (path.join(__dirname, '..', '..', 'bin', 'resin-write')) + "\"";
return windosu.exec("node " + resinWritePath + " \"" + params.image + "\" \"" + params.device + "\"");
return windosu.exec("\"" + process.argv[0] + "\" " + resinWritePath + " \"" + params.image + "\" \"" + params.device + "\"");
} else {
return done(error);
}

View File

@ -157,6 +157,6 @@ exports.install =
# Need to escape every path to avoid errors
resinWritePath = "\"#{path.join(__dirname, '..', '..', 'bin', 'resin-write')}\""
windosu.exec("node #{resinWritePath} \"#{params.image}\" \"#{params.device}\"")
windosu.exec("\"#{process.argv[0]}\" #{resinWritePath} \"#{params.image}\" \"#{params.device}\"")
else
return done(error)