system() improved virtual detection (windows)
This commit is contained in:
parent
783bc3d43b
commit
2402a309a2
@ -80,6 +80,8 @@ For major (breaking) changes - **version 4, 3 and 2** - see end of page.
|
||||
|
||||
| Version | Date | Comment |
|
||||
| -------------- | -------------- | -------- |
|
||||
| 5.10.3 | 2022-01-17 | `system()` improved virtual detection (windows) |
|
||||
| 5.10.2 | 2022-01-17 | `uuid()` fix results (windows) |
|
||||
| 5.10.1 | 2022-01-17 | `cpu()` fix manufacturer |
|
||||
| 5.10.0 | 2022-01-09 | basic `Android` support |
|
||||
| 5.9.18 | 2022-01-08 | `wifiConections()` fix empty issue (mac OS) |
|
||||
|
||||
@ -57,6 +57,11 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row">5.10.3</th>
|
||||
<td>2022-01-17</td>
|
||||
<td><span class="code">system()</span> improved virtual detection (windows)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">5.10.2</th>
|
||||
<td>2022-01-17</td>
|
||||
|
||||
@ -170,7 +170,7 @@
|
||||
<img class="logo" src="assets/logo.png">
|
||||
<div class="title">systeminformation</div>
|
||||
<div class="subtitle"><span id="typed"></span> </div>
|
||||
<div class="version">New Version: <span id="version">5.10.2</span></div>
|
||||
<div class="version">New Version: <span id="version">5.10.3</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>
|
||||
</div>
|
||||
<div class="down">
|
||||
|
||||
@ -353,33 +353,21 @@ function system(callback) {
|
||||
result.serial = util.getValue(lines, 'identifyingnumber', ':');
|
||||
result.uuid = util.getValue(lines, 'uuid', ':').toLowerCase();
|
||||
// detect virtual (1)
|
||||
if (result.model.toLowerCase() === 'virtualbox' || result.model.toLowerCase() === 'kvm' || result.model.toLowerCase() === 'virtual machine' || result.model.toLowerCase() === 'bochs' || result.model.toLowerCase().startsWith('vmware')) {
|
||||
const model = result.model.toLowerCase();
|
||||
if (model === 'virtualbox' || model === 'kvm' || model === 'virtual machine' || model === 'bochs' || model.startsWith('vmware') || model.startsWith('qemu')) {
|
||||
result.virtual = true;
|
||||
switch (result.model.toLowerCase()) {
|
||||
case 'virtualbox':
|
||||
result.virtualHost = 'VirtualBox';
|
||||
break;
|
||||
case 'vmware':
|
||||
result.virtualHost = 'VMware';
|
||||
break;
|
||||
case 'kvm':
|
||||
result.virtualHost = 'KVM';
|
||||
break;
|
||||
case 'bochs':
|
||||
result.virtualHost = 'bochs';
|
||||
break;
|
||||
}
|
||||
if (model.startsWith('virtualbox')) { result.virtualHost = 'VirtualBox'; }
|
||||
if (model.startsWith('vmware')) { result.virtualHost = 'VMware'; }
|
||||
if (model.startsWith('kvm')) { result.virtualHost = 'KVM'; }
|
||||
if (model.startsWith('bochs')) { result.virtualHost = 'bochs'; }
|
||||
if (model.startsWith('qemu')) { result.virtualHost = 'KVM'; }
|
||||
}
|
||||
if (result.manufacturer.toLowerCase().startsWith('vmware') || result.manufacturer.toLowerCase() === 'xen') {
|
||||
const manufacturer = result.manufacturer.toLowerCase();
|
||||
if (manufacturer.startsWith('vmware') || manufacturer.startsWith('qemu') || manufacturer === 'xen') {
|
||||
result.virtual = true;
|
||||
switch (result.manufacturer.toLowerCase()) {
|
||||
case 'vmware':
|
||||
result.virtualHost = 'VMware';
|
||||
break;
|
||||
case 'xen':
|
||||
result.virtualHost = 'Xen';
|
||||
break;
|
||||
}
|
||||
if (manufacturer.startsWith('vmware')) { result.virtualHost = 'VMware'; }
|
||||
if (manufacturer.startsWith('xen')) { result.virtualHost = 'Xen'; }
|
||||
if (manufacturer.startsWith('qemu')) { result.virtualHost = 'KVM'; }
|
||||
}
|
||||
util.powerShell('Get-WmiObject MS_Systeminformation -Namespace "root/wmi" | fl *').then((stdout, error) => {
|
||||
if (!error) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user