From c0fcf75f58077334adfd7e6c6bde0ce270962eb0 Mon Sep 17 00:00:00 2001 From: Bryan Roe Date: Mon, 5 Aug 2019 11:12:00 -0700 Subject: [PATCH] Fixed bug, where stderr was not subscribed, causing the stream to pause if stderr is written to, which will happen on Win Server when fetching AV state. If stream is paused, the waitExit() line will hang --- modules/win-info.js | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/win-info.js b/modules/win-info.js index fae48ad..7181b91 100644 --- a/modules/win-info.js +++ b/modules/win-info.js @@ -44,6 +44,7 @@ function av() { var child = require('child_process').execFile(process.env['windir'] + '\\System32\\wbem\\wmic.exe', ['wmic', '/Namespace:\\\\root\\SecurityCenter2', 'Path', 'AntiVirusProduct', 'get', '/FORMAT:CSV']); child.stdout.str = ''; child.stdout.on('data', function (c) { this.str += c.toString(); }); + child.stderr.str = ''; child.stderr.on('data', function (c) { this.str += c.toString(); }) child.waitExit(); var lines = child.stdout.str.trim().split('\r\n');