windows - uefi detection fix

This commit is contained in:
Sebastian Hildebrandt 2020-01-16 14:28:20 +01:00
parent a0f80f670d
commit b57bfe978f

View File

@ -337,14 +337,14 @@ function isUefiWindows() {
return new Promise((resolve) => {
process.nextTick(() => {
try {
exec('type %windir%\\Panther\\setupact.log | findstr "Detected boot environment" ', util.execOptsWin, function (error, stdout) {
exec('findstr /C:"Detected boot environment" "%windir%\\Panther\\setupact.log"', util.execOptsWin, function (error, stdout) {
if (!error) {
const line = stdout.toString().split('\n\r')[0];
resolve(line.toLowerCase().indexOf('uefi') >= 0);
}
resolve(false);
});
} catch(e) {
} catch (e) {
resolve(false);
}
});