osInfo(), cpu() improved hypervisor, virtualization detection (windows)
This commit is contained in:
parent
df9b7aa5ef
commit
1eea10ea54
@ -77,6 +77,7 @@ For major (breaking) changes - **version 4, 3 and 2** - see end of page.
|
|||||||
|
|
||||||
| Version | Date | Comment |
|
| Version | Date | Comment |
|
||||||
| -------------- | -------------- | -------- |
|
| -------------- | -------------- | -------- |
|
||||||
|
| 5.7.4 | 2021-05-27 | `osInfo()`, `cpu()` improved hypervisor, virtualization detection (windows) |
|
||||||
| 5.7.3 | 2021-05-26 | `osInfo()` improved UEFI detection (windows) |
|
| 5.7.3 | 2021-05-26 | `osInfo()` improved UEFI detection (windows) |
|
||||||
| 5.7.2 | 2021-05-24 | `system()` virtual detection improvement |
|
| 5.7.2 | 2021-05-24 | `system()` virtual detection improvement |
|
||||||
| 5.7.1 | 2021-05-20 | `graphics()` Check for qwMemorySize on Windows |
|
| 5.7.1 | 2021-05-20 | `graphics()` Check for qwMemorySize on Windows |
|
||||||
|
|||||||
@ -56,6 +56,11 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<th scope="row">5.7.4</th>
|
||||||
|
<td>2021-05-27</td>
|
||||||
|
<td><span class="code">osInfo(), cpu()</span> improved hypervisor, virtualization detection (windows)</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row">5.7.3</th>
|
<th scope="row">5.7.3</th>
|
||||||
<td>2021-05-26</td>
|
<td>2021-05-26</td>
|
||||||
|
|||||||
@ -170,7 +170,7 @@
|
|||||||
<img class="logo" src="assets/logo.png">
|
<img class="logo" src="assets/logo.png">
|
||||||
<div class="title">systeminformation</div>
|
<div class="title">systeminformation</div>
|
||||||
<div class="subtitle"><span id="typed"></span> </div>
|
<div class="subtitle"><span id="typed"></span> </div>
|
||||||
<div class="version">New Version: <span id="version">5.7.3</span></div>
|
<div class="version">New Version: <span id="version">5.7.4</span></div>
|
||||||
<button class="btn btn-light" onclick="location.href='https://github.com/sebhildebrandt/systeminformation'">View on Github <i class=" fab fa-github"></i></button>
|
<button class="btn btn-light" onclick="location.href='https://github.com/sebhildebrandt/systeminformation'">View on Github <i class=" fab fa-github"></i></button>
|
||||||
</div>
|
</div>
|
||||||
<div class="down">
|
<div class="down">
|
||||||
|
|||||||
23
lib/cpu.js
23
lib/cpu.js
@ -550,14 +550,14 @@ function getCpu() {
|
|||||||
cpuFlags().then(flags => {
|
cpuFlags().then(flags => {
|
||||||
result.flags = flags;
|
result.flags = flags;
|
||||||
result.virtualization = flags.indexOf('vmx') > -1 || flags.indexOf('svm') > -1;
|
result.virtualization = flags.indexOf('vmx') > -1 || flags.indexOf('svm') > -1;
|
||||||
if (_windows) {
|
// if (_windows) {
|
||||||
try {
|
// try {
|
||||||
const systeminfo = execSync('systeminfo', util.execOptsWin).toString();
|
// const systeminfo = execSync('systeminfo', util.execOptsWin).toString();
|
||||||
result.virtualization = result.virtualization || (systeminfo.indexOf('Virtualization Enabled In Firmware: Yes') !== -1) || (systeminfo.indexOf('Virtualisierung in Firmware aktiviert: Ja') !== -1) || (systeminfo.indexOf('Virtualisation activée dans le microprogramme : Qiu') !== -1);
|
// result.virtualization = result.virtualization || (systeminfo.indexOf('Virtualization Enabled In Firmware: Yes') !== -1) || (systeminfo.indexOf('Virtualisierung in Firmware aktiviert: Ja') !== -1) || (systeminfo.indexOf('Virtualisation activée dans le microprogramme : Qiu') !== -1);
|
||||||
} catch (e) {
|
// } catch (e) {
|
||||||
util.noop();
|
// util.noop();
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
if (_darwin) {
|
if (_darwin) {
|
||||||
exec('sysctl machdep.cpu hw.cpufrequency_max hw.cpufrequency_min hw.packages hw.physicalcpu_max hw.ncpu hw.tbfrequency hw.cpufamily hw.cpusubfamily', function (error, stdout) {
|
exec('sysctl machdep.cpu hw.cpufrequency_max hw.cpufrequency_min hw.packages hw.physicalcpu_max hw.ncpu hw.tbfrequency hw.cpufamily hw.cpusubfamily', function (error, stdout) {
|
||||||
let lines = stdout.toString().split('\n');
|
let lines = stdout.toString().split('\n');
|
||||||
@ -753,6 +753,7 @@ function getCpu() {
|
|||||||
const workload = [];
|
const workload = [];
|
||||||
workload.push(util.wmic('cpu get /value'));
|
workload.push(util.wmic('cpu get /value'));
|
||||||
workload.push(util.wmic('path Win32_CacheMemory get CacheType,InstalledSize,Purpose'));
|
workload.push(util.wmic('path Win32_CacheMemory get CacheType,InstalledSize,Purpose'));
|
||||||
|
workload.push(util.powerShell('Get-ComputerInfo -property "HyperV*"'));
|
||||||
|
|
||||||
Promise.all(
|
Promise.all(
|
||||||
workload
|
workload
|
||||||
@ -831,6 +832,10 @@ function getCpu() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
lines = data[2].split('\r\n');
|
||||||
|
result.virtualization = (util.getValue(lines, 'HyperVRequirementVirtualizationFirmwareEnabled').toLowerCase() === 'true');
|
||||||
|
result.virtualization = (util.getValue(lines, 'HyperVisorPresent').toLowerCase() === 'true');
|
||||||
|
|
||||||
resolve(result);
|
resolve(result);
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
@ -1608,5 +1613,3 @@ function fullLoad(callback) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
exports.fullLoad = fullLoad;
|
exports.fullLoad = fullLoad;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -18,7 +18,7 @@ const fs = require('fs');
|
|||||||
const util = require('./util');
|
const util = require('./util');
|
||||||
const exec = require('child_process').exec;
|
const exec = require('child_process').exec;
|
||||||
const execSync = require('child_process').execSync;
|
const execSync = require('child_process').execSync;
|
||||||
const execPromise = util.promisify(require('child_process').exec);
|
// const execPromise = util.promisify(require('child_process').exec);
|
||||||
|
|
||||||
let _platform = process.platform;
|
let _platform = process.platform;
|
||||||
|
|
||||||
@ -323,7 +323,8 @@ function osInfo(callback) {
|
|||||||
try {
|
try {
|
||||||
const workload = [];
|
const workload = [];
|
||||||
workload.push(util.wmic('os get /value'));
|
workload.push(util.wmic('os get /value'));
|
||||||
workload.push(execPromise('systeminfo', util.execOptsWin));
|
// workload.push(execPromise('systeminfo', util.execOptsWin));
|
||||||
|
workload.push(util.powerShell('Get-ComputerInfo -property "HyperV*"'));
|
||||||
workload.push(util.powerShell('Add-Type -AssemblyName System.Windows.Forms; [System.Windows.Forms.SystemInformation]::TerminalServerSession'));
|
workload.push(util.powerShell('Add-Type -AssemblyName System.Windows.Forms; [System.Windows.Forms.SystemInformation]::TerminalServerSession'));
|
||||||
util.promiseAll(
|
util.promiseAll(
|
||||||
workload
|
workload
|
||||||
@ -334,8 +335,10 @@ function osInfo(callback) {
|
|||||||
result.build = util.getValue(lines, 'BuildNumber', '=').trim();
|
result.build = util.getValue(lines, 'BuildNumber', '=').trim();
|
||||||
result.servicepack = util.getValue(lines, 'ServicePackMajorVersion', '=').trim() + '.' + util.getValue(lines, 'ServicePackMinorVersion', '=').trim();
|
result.servicepack = util.getValue(lines, 'ServicePackMajorVersion', '=').trim() + '.' + util.getValue(lines, 'ServicePackMinorVersion', '=').trim();
|
||||||
result.codepage = util.getCodepage();
|
result.codepage = util.getCodepage();
|
||||||
const systeminfo = data.results[1] ? data.results[1].toString() : '';
|
// const systeminfo = data.results[1] ? data.results[1].toString() : '';
|
||||||
result.hypervisor = (systeminfo.indexOf('hypervisor has been detected') !== -1) || (systeminfo.indexOf('Es wurde ein Hypervisor erkannt') !== -1) || (systeminfo.indexOf('Un hyperviseur a ') !== -1);
|
// result.hypervisor = (systeminfo.indexOf('hypervisor has been detected') !== -1) || (systeminfo.indexOf('Es wurde ein Hypervisor erkannt') !== -1) || (systeminfo.indexOf('Un hyperviseur a ') !== -1);
|
||||||
|
const hyperv = data.results[1] ? data.results[1].toString().split('\r\n') : [];
|
||||||
|
result.hypervisor = (util.getValue(hyperv, 'HyperVisorPresent').toLowerCase() === 'true');
|
||||||
const term = data.results[2] ? data.results[2].toString() : '';
|
const term = data.results[2] ? data.results[2].toString() : '';
|
||||||
result.remoteSession = (term.toString().toLowerCase().indexOf('true') >= 0);
|
result.remoteSession = (term.toString().toLowerCase().indexOf('true') >= 0);
|
||||||
isUefiWindows().then(uefi => {
|
isUefiWindows().then(uefi => {
|
||||||
@ -384,7 +387,7 @@ function isUefiWindows() {
|
|||||||
exec('findstr /C:"Detected boot environment" "%windir%\\Panther\\setupact.log"', util.execOptsWin, function (error, stdout) {
|
exec('findstr /C:"Detected boot environment" "%windir%\\Panther\\setupact.log"', util.execOptsWin, function (error, stdout) {
|
||||||
if (!error) {
|
if (!error) {
|
||||||
const line = stdout.toString().split('\n\r')[0];
|
const line = stdout.toString().split('\n\r')[0];
|
||||||
resolve(line.toLowerCase().indexOf('uefi') >= 0 || line.toLowerCase().indexOf(' efi') >= 0);
|
resolve(line.toLowerCase().indexOf('efi') >= 0);
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
exec('echo %firmware_type%', util.execOptsWin, function (error, stdout) {
|
exec('echo %firmware_type%', util.execOptsWin, function (error, stdout) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user