mirror of
https://github.com/balena-io/etcher.git
synced 2025-07-23 19:26:33 +00:00
fix(usb): Ignore errors if winusb doesn't load (#1970)
Due to some Windows systems missing certain C runtime libraries (Visual C/C++ 2012 / 2015 Redistributables), we ignore errors when loading this module until we can ensure distribution of those along with it. Change-Type: patch Changelog-Entry: Fix "The specified module could not be found" on Windows Fixes #1956
This commit is contained in:
parent
8d863638cc
commit
45c72f0c28
@ -74,15 +74,22 @@ exports.listDevices = () => {
|
|||||||
|
|
||||||
// Include driverless devices into the list of USB devices.
|
// Include driverless devices into the list of USB devices.
|
||||||
if (process.platform === 'win32') {
|
if (process.platform === 'win32') {
|
||||||
const winusbDriverGenerator = require('winusb-driver-generator')
|
// NOTE: Temporarily ignore errors when loading winusb-driver-generator,
|
||||||
for (const device of winusbDriverGenerator.listDriverlessDevices()) {
|
// due to C Runtime issues on Windows;
|
||||||
devices.push({
|
// see https://github.com/resin-io/etcher/issues/1956
|
||||||
accessible: false,
|
try {
|
||||||
deviceDescriptor: {
|
const winusbDriverGenerator = require('winusb-driver-generator')
|
||||||
idVendor: device.vid,
|
for (const device of winusbDriverGenerator.listDriverlessDevices()) {
|
||||||
idProduct: device.pid
|
devices.push({
|
||||||
}
|
accessible: false,
|
||||||
})
|
deviceDescriptor: {
|
||||||
|
idVendor: device.vid,
|
||||||
|
idProduct: device.pid
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
// Ignore error
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user