diff --git a/build/actions/os.js b/build/actions/os.js index e8ed6559..b5cbc76b 100644 --- a/build/actions/os.js +++ b/build/actions/os.js @@ -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); } diff --git a/lib/actions/os.coffee b/lib/actions/os.coffee index 820311af..6d4aafc4 100644 --- a/lib/actions/os.coffee +++ b/lib/actions/os.coffee @@ -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)