@livedesk/client 0.1.136 → 0.1.137
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 +31 -29
- 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
|
@@ -1313,37 +1313,39 @@ function remotePolicyAllows(options, command) {
|
|
|
1313
1313
|
function scheduleClientUpdate(options, payload = {}) {
|
|
1314
1314
|
const parentPid = Number(process.env.LIVEDESK_CLIENT_PARENT_PID || process.ppid);
|
|
1315
1315
|
if (!Number.isInteger(parentPid) || parentPid <= 1) {
|
|
1316
|
-
|
|
1316
|
+
return Promise.reject(new Error('LiveDesk client launcher process id is unavailable.'));
|
|
1317
1317
|
}
|
|
1318
1318
|
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
|
-
|
|
1319
|
+
return new Promise((resolve, reject) => {
|
|
1320
|
+
const child = spawn(command, [
|
|
1321
|
+
'-y',
|
|
1322
|
+
'--prefer-online',
|
|
1323
|
+
'livedesk@latest',
|
|
1324
|
+
'client',
|
|
1325
|
+
'--no-login',
|
|
1326
|
+
'--update-wait-pid',
|
|
1327
|
+
String(parentPid)
|
|
1328
|
+
], {
|
|
1329
|
+
env: {
|
|
1330
|
+
...process.env,
|
|
1331
|
+
LIVEDESK_CLIENT_UPDATE_TARGET_VERSION: String(payload.targetVersion || process.env.LIVEDESK_CLIENT_UPDATE_TARGET_VERSION || '')
|
|
1332
|
+
},
|
|
1333
|
+
detached: true,
|
|
1334
|
+
stdio: 'ignore',
|
|
1335
|
+
windowsHide: true
|
|
1336
|
+
});
|
|
1337
|
+
child.once('error', reject);
|
|
1338
|
+
child.once('spawn', () => {
|
|
1339
|
+
child.unref();
|
|
1340
|
+
resolve({
|
|
1341
|
+
ok: true,
|
|
1342
|
+
status: 'update-scheduled',
|
|
1343
|
+
targetVersion: String(payload.targetVersion || ''),
|
|
1344
|
+
parentPid,
|
|
1345
|
+
restartAfterMs: 500
|
|
1346
|
+
});
|
|
1347
|
+
});
|
|
1338
1348
|
});
|
|
1339
|
-
child.unref();
|
|
1340
|
-
return {
|
|
1341
|
-
ok: true,
|
|
1342
|
-
status: 'update-scheduled',
|
|
1343
|
-
targetVersion: String(payload.targetVersion || ''),
|
|
1344
|
-
parentPid,
|
|
1345
|
-
restartAfterMs: 500
|
|
1346
|
-
};
|
|
1347
1349
|
}
|
|
1348
1350
|
|
|
1349
1351
|
async function handleRemoteCommand(socket, options, message, nextFrameSeq, activeStreams) {
|
|
@@ -1373,7 +1375,7 @@ async function handleRemoteCommand(socket, options, message, nextFrameSeq, activ
|
|
|
1373
1375
|
|
|
1374
1376
|
if (command === 'livedesk.client-update') {
|
|
1375
1377
|
try {
|
|
1376
|
-
const result = scheduleClientUpdate(options, message.payload || {});
|
|
1378
|
+
const result = await scheduleClientUpdate(options, message.payload || {});
|
|
1377
1379
|
writeJsonLine(socket, {
|
|
1378
1380
|
type: 'command.result',
|
|
1379
1381
|
commandId: message.commandId,
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|