From 7e09e2bf87a0670a9ee76483b37f8e0f7050997c Mon Sep 17 00:00:00 2001 From: Josh Stewart Date: Sun, 30 Aug 2020 21:49:37 +1000 Subject: [PATCH] Correctly handle OS identification --- UI/main.js | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/UI/main.js b/UI/main.js index 536c4f8..8865c3d 100644 --- a/UI/main.js +++ b/UI/main.js @@ -70,9 +70,23 @@ ipcMain.on('uploadFW', (e, args) => { var burnStarted = false; var burnPercent = 0; - if(process.platform == "win32") { platform = "avrdude-windows"; } - else if(process.platform == "darwin") { platform = "avrdude-darwin-x86"; } - else if(process.platform == "linux") { platform = "avrdude-linux_i686"; } + //All Windows builds use the 32-bit binary + if(process.platform == "win32") + { + platform = "avrdude-windows"; + } + //All Mac builds use the 64-bit binary + else if(process.platform == "darwin") + { + platform = "avrdude-darwin-x86_64"; + } + else if(process.platform == "linux") + { + if(process.arch == "x32") { platform = "avrdude-linux_i686"; } + else if(process.arch == "x64") { platform = "avrdude-linux_x86_64"; } + else if(process.arch == "arm") { platform = "avrdude-armhf"; } + else if(process.arch == "arm64") { platform = "avrdude-aarch64"; } + } var executableName = __dirname + "/bin/" + platform + "/avrdude"; executableName = executableName.replace('app.asar',''); //This is important for allowing the binary to be found once the app is packaed into an asar