From 321792a632d6d493caaf9a93f168b8fdfe5be2cc Mon Sep 17 00:00:00 2001 From: Sebastian Hildebrandt Date: Wed, 26 May 2021 14:43:52 +0200 Subject: [PATCH] osInfo() improved UEFI detection (windows) --- CHANGELOG.md | 1 + docs/history.html | 5 +++++ docs/index.html | 2 +- lib/osinfo.js | 6 +++--- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 67c91bd..3eeec1e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -77,6 +77,7 @@ For major (breaking) changes - **version 4, 3 and 2** - see end of page. | Version | Date | Comment | | -------------- | -------------- | -------- | +| 5.7.3 | 2021-05-26 | `osInfo()` improved UEFI detection (windows) | | 5.7.2 | 2021-05-24 | `system()` virtual detection improvement | | 5.7.1 | 2021-05-20 | `graphics()` Check for qwMemorySize on Windows | | 5.7.0 | 2021-05-20 | `diskLayout()` added smartdata for win (if istalled) | diff --git a/docs/history.html b/docs/history.html index 1c10a63..52910df 100644 --- a/docs/history.html +++ b/docs/history.html @@ -56,6 +56,11 @@ + + 5.7.3 + 2021-05-26 + osInfo() improved UEFI detection (windows) + 5.7.2 2021-05-24 diff --git a/docs/index.html b/docs/index.html index 302d7ea..b7aea19 100644 --- a/docs/index.html +++ b/docs/index.html @@ -170,7 +170,7 @@
systeminformation
 
-
New Version: 5.7.2
+
New Version: 5.7.3
diff --git a/lib/osinfo.js b/lib/osinfo.js index 5e06acd..47ee62f 100644 --- a/lib/osinfo.js +++ b/lib/osinfo.js @@ -384,13 +384,13 @@ function isUefiWindows() { 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(line.toLowerCase().indexOf('uefi') >= 0 || line.toLowerCase().indexOf(' efi') >= 0); return; } else { - exec('$env:firmware_type', util.execOptsWin, function (error, stdout) { + exec('echo %firmware_type%', util.execOptsWin, function (error, stdout) { if (!error) { const line = stdout.toString() || ''; - resolve(line.toLowerCase().indexOf('uefi') >= 0); + resolve(line.toLowerCase().indexOf('efi') >= 0); } resolve(false); });