mirror of
https://github.com/balena-io/etcher.git
synced 2025-04-24 15:27:17 +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.
|
||||
if (process.platform === 'win32') {
|
||||
const winusbDriverGenerator = require('winusb-driver-generator')
|
||||
for (const device of winusbDriverGenerator.listDriverlessDevices()) {
|
||||
devices.push({
|
||||
accessible: false,
|
||||
deviceDescriptor: {
|
||||
idVendor: device.vid,
|
||||
idProduct: device.pid
|
||||
}
|
||||
})
|
||||
// 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')
|
||||
for (const device of winusbDriverGenerator.listDriverlessDevices()) {
|
||||
devices.push({
|
||||
accessible: false,
|
||||
deviceDescriptor: {
|
||||
idVendor: device.vid,
|
||||
idProduct: device.pid
|
||||
}
|
||||
})
|
||||
}
|
||||
} catch (error) {
|
||||
// Ignore error
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user