1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2025-12-22 03:03:18 +00:00

Updated agent installer on windows to show firewall enumeration progress, and to utilize the asynchronous api, so the installer doesn't appear non-responsive if it takes a long time. Also added a timeout, so installation will continue if it takes too long

This commit is contained in:
Bryan Roe
2022-04-24 23:22:14 -07:00
parent bae07c6be7
commit a0cd3e3587
3 changed files with 55 additions and 13 deletions

View File

@@ -503,19 +503,21 @@ function serviceExists(loc, params)
process.stdout.write(' [FOUND: ' + loc + ']\n');
if(process.platform == 'win32')
{
process.stdout.write(' -> Checking firewall rules for previous installation...');
if(require('win-firewall').removeFirewallRule({ program: loc }))
process.stdout.write(' -> Checking firewall rules for previous installation... [0%]');
var p = require('win-firewall').getFirewallRulesAsync({ program: loc, noResult: true, minimal: true, timeout: 15000 });
p.on('progress', function (c)
{
// SUCCESS
process.stdout.write(' [DELETED]\n');
uninstallService(params);
}
else
process.stdout.write('\r -> Checking firewall rules for previous installation... [' + c + ']');
});
p.on('rule', function (r)
{
// FAILED
process.stdout.write(' [No Rules Found]\n');
require('win-firewall').removeFirewallRule(r.DisplayName);
});
p.finally(function ()
{
process.stdout.write('\r -> Checking firewall rules for previous installation... [DONE]\n');
uninstallService(params);
}
});
}
else
{