aicp-tracker 1.1.0 → 1.1.1
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/setup.js +6 -2
- package/package.json +1 -1
package/bin/setup.js
CHANGED
|
@@ -47,11 +47,15 @@ function installAutoStart() {
|
|
|
47
47
|
|
|
48
48
|
try {
|
|
49
49
|
if (process.platform === 'win32') {
|
|
50
|
-
//
|
|
50
|
+
// Write a .cmd wrapper so schtasks never has to deal with quoted paths
|
|
51
51
|
const { execFileSync } = require('child_process');
|
|
52
|
+
const wrapperDir = path.join(os.homedir(), '.aicp-tracker');
|
|
53
|
+
const wrapperPath = path.join(wrapperDir, 'start.cmd');
|
|
54
|
+
fs.mkdirSync(wrapperDir, { recursive: true });
|
|
55
|
+
fs.writeFileSync(wrapperPath, `@echo off\r\n"${nodePath}" "${scriptPath}" start\r\n`);
|
|
52
56
|
execFileSync('schtasks', [
|
|
53
57
|
'/create', '/tn', TASK_NAME,
|
|
54
|
-
'/tr',
|
|
58
|
+
'/tr', wrapperPath,
|
|
55
59
|
'/sc', 'ONLOGON', '/f',
|
|
56
60
|
], { stdio: 'pipe' });
|
|
57
61
|
} else if (process.platform === 'darwin') {
|