Updated 'uninstallAgent' to try to uninstall secondary agent too.

This commit is contained in:
Bryan Roe 2019-09-16 13:08:29 -07:00
parent f14a3dc163
commit 8c44ed60c7

View File

@ -1861,6 +1861,13 @@ function createMeshCore(agent)
} }
else else
{ {
try
{
diagnosticAgent_uninstall();
}
catch(x)
{
}
var js = "require('service-manager').manager.getService('" + agentName + "').stop(); require('service-manager').manager.uninstallService('" + agentName + "'); process.exit();"; var js = "require('service-manager').manager.getService('" + agentName + "').stop(); require('service-manager').manager.uninstallService('" + agentName + "'); process.exit();";
this.child = require('child_process').execFile(process.execPath, [process.platform == 'win32' ? (process.execPath.split('\\').pop()) : (process.execPath.split('/').pop()), '-b64exec', Buffer.from(js).toString('base64')], { type: 4, detached: true }); this.child = require('child_process').execFile(process.execPath, [process.platform == 'win32' ? (process.execPath.split('\\').pop()) : (process.execPath.split('/').pop()), '-b64exec', Buffer.from(js).toString('base64')], { type: 4, detached: true });
} }