1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2025-12-13 23:03:35 +00:00

Updated notifybar-desktop to support setting TSID on Windows

This commit is contained in:
Bryan Roe
2019-12-06 15:38:32 -08:00
parent b0903fec7b
commit d9af17e2c9
2 changed files with 6 additions and 5 deletions

File diff suppressed because one or more lines are too long

View File

@@ -18,18 +18,18 @@ var ptrsize = require('_GenericMarshal').PointerSize;
var ClientMessage = 33; var ClientMessage = 33;
function windows_notifybar_check(title) function windows_notifybar_check(title, tsid)
{ {
if(require('user-sessions').getProcessOwnerName(process.pid).tsid == 0) if(require('user-sessions').getProcessOwnerName(process.pid).tsid == 0)
{ {
return (windows_notifybar_system(title)); return (windows_notifybar_system(title, tsid));
} }
else else
{ {
return (windows_notifybar_local(title)); return (windows_notifybar_local(title));
} }
} }
function windows_notifybar_system(title) function windows_notifybar_system(title, tsid)
{ {
var ret = {}; var ret = {};
@@ -39,7 +39,7 @@ function windows_notifybar_system(title)
.createEvent('close') .createEvent('close')
.addMethod('close', function close() { this.child.kill(); }); .addMethod('close', function close() { this.child.kill(); });
ret.child = require('child_process').execFile(process.execPath, [process.execPath.split('\\').pop(), '-b64exec', script], { type: 1 }); ret.child = require('child_process').execFile(process.execPath, [process.execPath.split('\\').pop(), '-b64exec', script], { type: 1, uid: tsid });
ret.child.parent = ret; ret.child.parent = ret;
ret.child.stdout.on('data', function (c) { }); ret.child.stdout.on('data', function (c) { });
ret.child.stderr.on('data', function (c) { }); ret.child.stderr.on('data', function (c) { });
@@ -256,6 +256,7 @@ switch(process.platform)
{ {
case 'win32': case 'win32':
module.exports = windows_notifybar_check; module.exports = windows_notifybar_check;
module.exports.system = windows_notifybar_system;
break; break;
case 'linux': case 'linux':
case 'freebsd': case 'freebsd':