mirror of
https://github.com/balena-io/etcher.git
synced 2025-07-23 11:16:39 +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,6 +74,10 @@ 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') {
|
||||||
|
// NOTE: Temporarily ignore errors when loading winusb-driver-generator,
|
||||||
|
// due to C Runtime issues on Windows;
|
||||||
|
// see https://github.com/resin-io/etcher/issues/1956
|
||||||
|
try {
|
||||||
const winusbDriverGenerator = require('winusb-driver-generator')
|
const winusbDriverGenerator = require('winusb-driver-generator')
|
||||||
for (const device of winusbDriverGenerator.listDriverlessDevices()) {
|
for (const device of winusbDriverGenerator.listDriverlessDevices()) {
|
||||||
devices.push({
|
devices.push({
|
||||||
@ -84,6 +88,9 @@ exports.listDevices = () => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
} catch (error) {
|
||||||
|
// Ignore error
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return Bluebird.resolve(devices)
|
return Bluebird.resolve(devices)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user