First cut at having Windows driver install button

This commit is contained in:
Josh Stewart 2019-07-09 16:15:31 +10:00
parent 6f793b9301
commit a5f9909ad9
3 changed files with 22 additions and 1 deletions

View File

@ -76,8 +76,9 @@
<p>Available Ports:
<select name="ports" class="select" id="portsSelect" size="10" width="20"></select>
<ul class="actions">
<li><input type='button' value="Install Serial Drivers" onclick="installDrivers();" /></li>
<li><input type='button' value="Refresh" onclick="refreshSerialPorts();" /></li>
<li><input type='button' value="Install" id="btnInstall" onclick="uploadFW();" /></li>
<li><input type='button' value="Upload" id="btnInstall" onclick="uploadFW();" /></li>
</ul>
</p>
</div>

12
main.js
View File

@ -91,6 +91,18 @@ ipcMain.on('download', (e, args) => {
});
ipcMain.on('installWinDrivers', (e, args) => {
var infName = __dirname + "/bin/drivers-win/arduino.inf";
infName = infName.replace('app.asar','');
console.log("INF File " + infName);
//syssetup,SetupInfObjectInstallAction DefaultInstall 128 .\<file>.inf
var execArgs = ['syssetup,SetupInfObjectInstallAction', 'DefaultInstall 128', infName];
const child = execFile("rundll32", execArgs);
});
ipcMain.on('uploadFW', (e, args) => {
if(avrdudeIsRunning == true) { return; }

View File

@ -166,6 +166,14 @@ function downloadIni()
}
//Installing the Windows drivers
function installDrivers()
{
ipcRenderer.send("installWinDrivers", {
});
}
function downloadTune()
{