From 8bb756c9d622a29172d4bc59cdb85a02a6e2d613 Mon Sep 17 00:00:00 2001 From: sebba Date: Wed, 10 Jun 2015 13:47:46 +0200 Subject: [PATCH] driver module : bug fixing --- modules/Menu/main.js | 2 +- node/driver.js | 36 ++++++++++++++---------------------- 2 files changed, 15 insertions(+), 23 deletions(-) diff --git a/modules/Menu/main.js b/modules/Menu/main.js index dd5b15fa..daca747a 100644 --- a/modules/Menu/main.js +++ b/modules/Menu/main.js @@ -246,7 +246,7 @@ define(function (require, exports, module) { CommandManager.register(Strings.ARDUINO.MENU.HELP.ITEM_ABOUT, ARDUINO_MENU_HELP_ABOUT, helpMenu_showAboutDialog); if(brackets.platform === 'win') - CommandManager.register(Strings.ARDUINO.MENU.HELP.ITEM_WIN_DRIVER, ARDUINO_MENU_HELP_DRIVER, helpMenu_driver); + CommandManager.register(Strings.ARDUINO.MENU.HELP.ITEM_DRIVER, ARDUINO_MENU_HELP_DRIVER, helpMenu_driver); HelpMenu.addMenuDivider(); if(brackets.platform === 'win') diff --git a/node/driver.js b/node/driver.js index b4d22c75..1358a572 100755 --- a/node/driver.js +++ b/node/driver.js @@ -42,38 +42,30 @@ function install(driverPath){console.log("A "+driverPath); async.series([ - function(callback){console.log("B1"); + function(callback){ + console.log("C1 "); + // atmel windows drivers + var fileexe = path.join(driverPath , 'driver-atmel-bundle-7.0.712.exe'); console.log("CC " + fileexe); + var atmelInstallation = exec( "\""+ fileexe + "\"" , + function (error, stdout, stderr) { + callback(null, 'arduino'); + }); + }, + function(callback){ + console.log("B1"); // arduino and linino windows drivers - var fileexe = isWin64() ? path.join(driverPath , 'dpinst-amd64.exe') : path.join(driverPath + 'dpinst-x86.exe'); console.log("B2 " + fileexe); + var fileexe = isWin64() ? path.join(driverPath , 'dpinst-amd64.exe') : path.join(driverPath, 'dpinst-x86.exe'); + console.log("B2 " + fileexe); var driverInstallation = exec("\""+fileexe+"\"", function (error, stdout, stderr) { console.log("B2.1"); - if (error !== null){ - console.error('B3: ' + error); - callback(error); - } - else{ - console.log("B3 " + stdout); callback(null, 'arduino'); - } - }); - }, - function(callback){console.log("C1 "); - // atmel windows drivers - var fileexe = path.join(driverPath + 'driver-atmel-bundle-7.0.712.exe'); console.log("CC " + fileexe); - var atmelInstallation = exec( "\""+ fileexe + "\"" , - function (error, stdout, stderr) { - if (error !== null) - //console.log('exec error: ' + error); - callback(error); - else - callback(null, 'arduino'); }); } ], // optional callback function(err, results){ - if(!err){console.log("ERR "+err); + if(err){console.log("ERR "+err); console.error(err); } else{