osInfo() uefi fix windows

This commit is contained in:
Sebastian Hildebrandt
2020-01-14 06:31:19 +01:00
parent 40267a458d
commit 79f4269c5f
4 changed files with 18 additions and 8 deletions
+10 -6
View File
@@ -336,13 +336,17 @@ function isUefiLinux() {
function isUefiWindows() {
return new Promise((resolve) => {
process.nextTick(() => {
exec('%windir%\\Panther\\setupact.log | findstr "Detected boot environment" ', util.execOptsWin, function (error, stdout) {
if (!error) {
const line = stdout.toString().split('\n\r')[0];
resolve(line.toLowerCase().indexOf('uefi') >= 0);
}
try {
exec('type %windir%\\Panther\\setupact.log | findstr "Detected boot environment" ', 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) {
resolve(false);
});
}
});
});
}