From 79f4269c5fc3bbdf9a4e43147982136f3bdac313 Mon Sep 17 00:00:00 2001 From: Sebastian Hildebrandt Date: Tue, 14 Jan 2020 06:31:19 +0100 Subject: [PATCH] osInfo() uefi fix windows --- CHANGELOG.md | 1 + docs/history.html | 5 +++++ docs/index.html | 4 ++-- lib/osinfo.js | 16 ++++++++++------ 4 files changed, 18 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f297747..fcf3719 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,7 @@ For major (breaking) changes - version 3 and 2 see end of page. | Version | Date | Comment | | -------------- | -------------- | -------- | +| 4.19.1 | 2020-01-14 | `osInfo()` uefi fix windows | | 4.19.0 | 2020-01-12 | `osInfo()` added uefi | | 4.18.3 | 2020-01-10 | `fsSize()` fix excluding loop/snap devices | | 4.18.2 | 2020-01-10 | `memLayout()` fix memsize linux (modules >= 32 GB) | diff --git a/docs/history.html b/docs/history.html index 93306e3..13e2dc8 100644 --- a/docs/history.html +++ b/docs/history.html @@ -83,6 +83,11 @@ + + 4.19.1 + 2020-01-14 + osInfo() uefi fix windows + 4.19.0 2020-01-12 diff --git a/docs/index.html b/docs/index.html index cf0501a..f414e98 100644 --- a/docs/index.html +++ b/docs/index.html @@ -168,7 +168,7 @@
systeminformation
-
Current Version: 4.19.0
+
Current Version: 4.19.1
@@ -206,7 +206,7 @@
Downloads last month
-
235
+
236
Dependends
diff --git a/lib/osinfo.js b/lib/osinfo.js index 85ae086..26ab2b1 100644 --- a/lib/osinfo.js +++ b/lib/osinfo.js @@ -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); - }); + } }); }); }