@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.
- package/package.json +1 -1
- package/service.js +12 -4
package/package.json
CHANGED
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
|
-
|
|
410
|
-
|
|
411
|
-
|
|
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' });
|