@yeaft/webchat-agent 0.0.6 → 0.0.7

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/service.js +12 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yeaft/webchat-agent",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "description": "Remote agent for Yeaft WebChat — connects worker machines to the central server",
5
5
  "main": "index.js",
6
6
  "type": "module",
package/service.js CHANGED
@@ -406,10 +406,18 @@ function winInstall(config) {
406
406
  try { execSync(`schtasks /delete /tn "${WIN_TASK_NAME}" /f 2>nul`, { stdio: 'pipe' }); } catch {}
407
407
 
408
408
  // Create scheduled task that runs at logon
409
- execSync(
410
- `schtasks /create /tn "${WIN_TASK_NAME}" /tr "wscript.exe \\"${vbsPath}\\"" /sc onlogon /rl highest /f`,
411
- { stdio: 'pipe' }
412
- );
409
+ // Try with highest privilege first, fall back to limited (no admin required)
410
+ try {
411
+ execSync(
412
+ `schtasks /create /tn "${WIN_TASK_NAME}" /tr "wscript.exe \\"${vbsPath}\\"" /sc onlogon /rl highest /f`,
413
+ { stdio: 'pipe' }
414
+ );
415
+ } catch {
416
+ execSync(
417
+ `schtasks /create /tn "${WIN_TASK_NAME}" /tr "wscript.exe \\"${vbsPath}\\"" /sc onlogon /rl limited /f`,
418
+ { stdio: 'pipe' }
419
+ );
420
+ }
413
421
 
414
422
  // Also start it now
415
423
  execSync(`schtasks /run /tn "${WIN_TASK_NAME}"`, { stdio: 'pipe' });