1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2025-12-18 09:13:14 +00:00

1. Fixed edge case bug with installPath on Windows Service Manager

2. Updated Agent installer to copy .proxy file if present at install time
3. Updated proxy check on Linux/Gnome to only call gsettings if home folder is present for given user
This commit is contained in:
Bryan Roe
2020-06-25 16:59:30 -07:00
parent 10bde8c328
commit 557840e642
4 changed files with 18 additions and 8 deletions

File diff suppressed because one or more lines are too long

View File

@@ -18,7 +18,15 @@ limitations under the License.
function installService(params) function installService(params)
{ {
process.stdout.write('...Installing service'); process.stdout.write('...Installing service');
var proxyFile = process.execPath;
if (process.platform == 'win32')
{
proxyFile = proxyFile.split('.exe').join('.proxy');
}
else
{
proxyFile += '.proxy';
}
var options = var options =
{ {
@@ -30,6 +38,7 @@ function installService(params)
parameters: params parameters: params
}; };
if (process.platform == 'win32') { options.companyName = ''; } if (process.platform == 'win32') { options.companyName = ''; }
if (require('fs').existsSync(proxyFile)) { options.files = [{ source: proxyFile, newName: process.platform=='win32'?'MeshAgent.proxy':'meshagent.proxy' }]; }
var i; var i;
if ((i=params.indexOf('--_localService="1"'))>=0) if ((i=params.indexOf('--_localService="1"'))>=0)

View File

@@ -58,6 +58,7 @@ function linux_getProxy()
var ids = require('user-sessions').loginUids(); var ids = require('user-sessions').loginUids();
for (var i in ids) for (var i in ids)
{ {
if (!require('fs').existsSync(require('user-sessions').getHomeFolder(ids[i]))) { continue; }
setting = require('linux-gnome-helpers').getProxySettings(ids[i]); setting = require('linux-gnome-helpers').getProxySettings(ids[i]);
if (setting.mode == 'manual') if (setting.mode == 'manual')
{ {

View File

@@ -1747,7 +1747,7 @@ function serviceManager()
require('fs').copyFileSync(options.servicePath, folder + '\\' + options.name + '\\' + options.target + '.exe'); require('fs').copyFileSync(options.servicePath, folder + '\\' + options.name + '\\' + options.target + '.exe');
} }
options.servicePath = folder + '\\' + options.name + '\\' + options.target + '.exe'; options.servicePath = folder + '\\' + options.name + '\\' + options.target + '.exe';
if (!options.installPath) { options.installPath = folder + '\\' + options.name + '\\'; } options.installPath = folder + '\\' + options.name + '\\';
} }
else else
{ {
@@ -2192,7 +2192,7 @@ function serviceManager()
} }
} }
if (options.files) if (process.platform != 'win32' && options.files)
{ {
for (var i in options.files) for (var i in options.files)
{ {