engine7 7.0.7 → 7.0.8
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/dist/cli.mjs +9 -4
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -583,12 +583,17 @@ engine7 service \u2014 \u5F00\u673A\u81EA\u542F\u52A8\u7BA1\u7406
|
|
|
583
583
|
const taskName = "Engine7";
|
|
584
584
|
const nodeExe = process.execPath;
|
|
585
585
|
const cliMjs = path.resolve(engine7Bin);
|
|
586
|
-
const
|
|
586
|
+
const absConfig = path.resolve(configPath2);
|
|
587
|
+
const wrapperPath = path.join(cwd, "engine7-start.cmd");
|
|
588
|
+
const wrapperContent = `@echo off\r
|
|
589
|
+
cd /d "${cwd}"\r
|
|
590
|
+
"${nodeExe}" "${cliMjs}" start --config "${absConfig}"\r
|
|
591
|
+
`;
|
|
592
|
+
fs.writeFileSync(wrapperPath, wrapperContent);
|
|
587
593
|
try {
|
|
588
|
-
execSync(`schtasks /create /tn "${taskName}" /tr ${
|
|
594
|
+
execSync(`schtasks /create /tn "${taskName}" /tr "${wrapperPath}" /sc onlogon /rl highest /f`, { stdio: "inherit", shell: true });
|
|
589
595
|
console.log(`\u2705 Windows \u8BA1\u5212\u4EFB\u52A1 "${taskName}" \u5DF2\u521B\u5EFA\uFF08\u5F00\u673A\u81EA\u542F\u52A8\uFF09`);
|
|
590
|
-
console.log(`
|
|
591
|
-
console.log(` cli: ${cliMjs}`);
|
|
596
|
+
console.log(` wrapper: ${wrapperPath}`);
|
|
592
597
|
} catch {
|
|
593
598
|
console.error("\u274C \u521B\u5EFA\u8BA1\u5212\u4EFB\u52A1\u5931\u8D25\uFF0C\u53EF\u80FD\u9700\u8981\u7BA1\u7406\u5458\u6743\u9650");
|
|
594
599
|
process.exit(1);
|