@livedesk/client 0.1.136 → 0.1.138
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/livedesk-client-node.js +35 -30
- package/fast/linux-x64/livedesk-client-fast.dll +0 -0
- package/fast/linux-x64/livedesk-client-fast.pdb +0 -0
- package/fast/osx-arm64/livedesk-client-fast.dll +0 -0
- package/fast/osx-arm64/livedesk-client-fast.pdb +0 -0
- package/fast/osx-x64/livedesk-client-fast.dll +0 -0
- package/fast/osx-x64/livedesk-client-fast.pdb +0 -0
- package/fast/win-x64/livedesk-client-fast.dll +0 -0
- package/fast/win-x64/livedesk-client-fast.pdb +0 -0
- package/package.json +1 -1
|
@@ -1311,39 +1311,44 @@ function remotePolicyAllows(options, command) {
|
|
|
1311
1311
|
}
|
|
1312
1312
|
|
|
1313
1313
|
function scheduleClientUpdate(options, payload = {}) {
|
|
1314
|
-
const
|
|
1314
|
+
const configuredParentPid = Number(process.env.LIVEDESK_CLIENT_PARENT_PID || process.ppid);
|
|
1315
|
+
const parentPid = Number.isInteger(configuredParentPid) && configuredParentPid > 1
|
|
1316
|
+
? configuredParentPid
|
|
1317
|
+
: process.pid;
|
|
1315
1318
|
if (!Number.isInteger(parentPid) || parentPid <= 1) {
|
|
1316
|
-
|
|
1319
|
+
return Promise.reject(new Error('LiveDesk client launcher process id is unavailable.'));
|
|
1317
1320
|
}
|
|
1318
1321
|
const command = process.platform === 'win32' ? 'npx.cmd' : 'npx';
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1322
|
+
return new Promise((resolve, reject) => {
|
|
1323
|
+
const child = spawn(command, [
|
|
1324
|
+
'-y',
|
|
1325
|
+
'--prefer-online',
|
|
1326
|
+
'livedesk@latest',
|
|
1327
|
+
'client',
|
|
1328
|
+
'--no-login',
|
|
1329
|
+
'--update-wait-pid',
|
|
1330
|
+
String(parentPid)
|
|
1331
|
+
], {
|
|
1332
|
+
env: {
|
|
1333
|
+
...process.env,
|
|
1334
|
+
LIVEDESK_CLIENT_UPDATE_TARGET_VERSION: String(payload.targetVersion || process.env.LIVEDESK_CLIENT_UPDATE_TARGET_VERSION || '')
|
|
1335
|
+
},
|
|
1336
|
+
detached: true,
|
|
1337
|
+
stdio: 'ignore',
|
|
1338
|
+
windowsHide: true
|
|
1339
|
+
});
|
|
1340
|
+
child.once('error', reject);
|
|
1341
|
+
child.once('spawn', () => {
|
|
1342
|
+
child.unref();
|
|
1343
|
+
resolve({
|
|
1344
|
+
ok: true,
|
|
1345
|
+
status: 'update-scheduled',
|
|
1346
|
+
targetVersion: String(payload.targetVersion || ''),
|
|
1347
|
+
parentPid,
|
|
1348
|
+
restartAfterMs: 500
|
|
1349
|
+
});
|
|
1350
|
+
});
|
|
1338
1351
|
});
|
|
1339
|
-
child.unref();
|
|
1340
|
-
return {
|
|
1341
|
-
ok: true,
|
|
1342
|
-
status: 'update-scheduled',
|
|
1343
|
-
targetVersion: String(payload.targetVersion || ''),
|
|
1344
|
-
parentPid,
|
|
1345
|
-
restartAfterMs: 500
|
|
1346
|
-
};
|
|
1347
1352
|
}
|
|
1348
1353
|
|
|
1349
1354
|
async function handleRemoteCommand(socket, options, message, nextFrameSeq, activeStreams) {
|
|
@@ -1373,7 +1378,7 @@ async function handleRemoteCommand(socket, options, message, nextFrameSeq, activ
|
|
|
1373
1378
|
|
|
1374
1379
|
if (command === 'livedesk.client-update') {
|
|
1375
1380
|
try {
|
|
1376
|
-
const result = scheduleClientUpdate(options, message.payload || {});
|
|
1381
|
+
const result = await scheduleClientUpdate(options, message.payload || {});
|
|
1377
1382
|
writeJsonLine(socket, {
|
|
1378
1383
|
type: 'command.result',
|
|
1379
1384
|
commandId: message.commandId,
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|