| 4.7.1 |
2019-05-29 |
diff --git a/docs/index.html b/docs/index.html
index eb1323a..87f91b6 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -170,7 +170,7 @@
systeminformation
- Current Version: 4.7.1
+ Current Version: 4.7.2
diff --git a/lib/battery.js b/lib/battery.js
index 408c742..e274c35 100644
--- a/lib/battery.js
+++ b/lib/battery.js
@@ -163,7 +163,7 @@ module.exports = function (callback) {
}
if (_windows) {
try {
- util.wmic('Path Win32_Battery Get BatteryStatus, DesignCapacity, EstimatedChargeRemaining /value').then((stdout, error) => {
+ util.wmic('Path Win32_Battery Get BatteryStatus, DesignCapacity, EstimatedChargeRemaining /value').then((stdout) => {
if (stdout) {
let lines = stdout.split('\r\n');
let status = util.getValue(lines, 'BatteryStatus', '=').trim();
diff --git a/lib/osinfo.js b/lib/osinfo.js
index f6b3864..8692e6f 100644
--- a/lib/osinfo.js
+++ b/lib/osinfo.js
@@ -283,7 +283,7 @@ function osInfo(callback) {
result.logofile = getLogoFile();
result.release = result.kernel;
try {
- util.wmic('os get /value').then((stdout, error) => {
+ util.wmic('os get /value').then((stdout) => {
let lines = stdout.toString().split('\r\n');
result.distro = util.getValue(lines, 'Caption', '=').trim();
result.serial = util.getValue(lines, 'SerialNumber', '=').trim();
@@ -338,11 +338,12 @@ function versions(callback) {
pip: '',
pip3: '',
java: '',
- gcc: ''
+ gcc: '',
+ virtualbox: ''
};
let functionProcessed = (function () {
- let totalFunctions = 23;
+ let totalFunctions = 24;
return function () {
if (--totalFunctions === 0) {
if (callback) {
@@ -517,7 +518,7 @@ function versions(callback) {
});
} else {
if (_windows) {
- util.wmic('service get /value').then((stdout, error) => {
+ util.wmic('service get /value').then((stdout) => {
let serviceSections = stdout.split(/\n\s*\n/);
for (let i = 0; i < serviceSections.length; i++) {
if (serviceSections[i].trim() !== '') {
@@ -585,14 +586,18 @@ function versions(callback) {
}
functionProcessed();
});
- exec('java -version 2>&1', function (error, stdout) {
- if (!error) {
- const java = stdout.toString().split('\n')[0] || '';
- const parts = java.split('"');
- result.java = parts.length === 3 ? parts[1].trim() : '';
- }
+ if (_darwin) {
functionProcessed();
- });
+ } else {
+ exec('java -version 2>&1', function (error, stdout) {
+ if (!error) {
+ const java = stdout.toString().split('\n')[0] || '';
+ const parts = java.split('"');
+ result.java = parts.length === 3 ? parts[1].trim() : '';
+ }
+ functionProcessed();
+ });
+ }
exec('gcc -dumpversion', function (error, stdout) {
if (!error) {
result.gcc = stdout.toString().split('\n')[0].trim() || '';
@@ -612,6 +617,14 @@ function versions(callback) {
});
}
});
+ exec('vboxmanage -v 2>&1', function (error, stdout) {
+ if (!error) {
+ const vbox = stdout.toString().split('\n')[0] || '';
+ const parts = vbox.split('r');
+ result.virtualbox = parts[0];
+ }
+ functionProcessed();
+ });
} catch (e) {
if (callback) { callback(result); }
resolve(result);
diff --git a/lib/system.js b/lib/system.js
index a625ab1..f8c47d1 100644
--- a/lib/system.js
+++ b/lib/system.js
@@ -294,7 +294,6 @@ function bios(callback) {
resolve(result);
}
if (_windows) {
- // TODO: check BIOS windows
try {
util.wmic('bios get /value').then((stdout, error) => {
if (!error) {
diff --git a/lib/util.js b/lib/util.js
index f098d87..3c9a86f 100644
--- a/lib/util.js
+++ b/lib/util.js
@@ -245,21 +245,13 @@ function wmic(command, options) {
process.nextTick(() => {
try {
exec(getWmic() + ' ' + command, options, function (error, stdout) {
- resolve(stdout, error)
- // resolve({
- // stdout,
- // error
- // });
+ resolve(stdout, error);
}).stdin.end();
} catch (e) {
- resolve('', e)
- // resolve({
- // stdout: '',
- // error: e
- // });
+ resolve('', e);
}
- })
- })
+ });
+ });
}
function powerShell(cmd) {