codewave-openclaw-installer 2.1.3 → 2.1.5

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.
@@ -55,6 +55,8 @@ export const CHANNEL_DEFINITIONS = {
55
55
  desktopAppWindowsCandidates: [
56
56
  'DingTalk.exe',
57
57
  'DingtalkLauncher.exe',
58
+ 'DingDing/DingTalk.exe',
59
+ 'DingDing/DingtalkLauncher.exe',
58
60
  'Programs/DingTalk/DingTalk.exe',
59
61
  'Programs/DingTalk/DingtalkLauncher.exe',
60
62
  ],
@@ -83,6 +85,7 @@ export const CHANNEL_DEFINITIONS = {
83
85
  desktopAppWindowsCandidates: [
84
86
  'WXWork.exe',
85
87
  'WeCom.exe',
88
+ 'D:\\WXWork\\WXWork.exe',
86
89
  'Programs/WeCom/WeCom.exe',
87
90
  'Programs/WXWork/WXWork.exe',
88
91
  ],
@@ -246,6 +249,16 @@ export function detectDesktopAppInstallMatches({
246
249
  const roots = getDesktopSearchRoots({ platform, homeDir, env });
247
250
 
248
251
  for (const candidate of fileCandidates) {
252
+ const isAbsoluteCandidate = platform === 'win32'
253
+ ? path.win32.isAbsolute(candidate)
254
+ : path.posix.isAbsolute(candidate);
255
+ if (isAbsoluteCandidate) {
256
+ if (exists(candidate)) {
257
+ matches.push(candidate);
258
+ }
259
+ continue;
260
+ }
261
+
249
262
  for (const root of roots) {
250
263
  const candidatePath = joinForPlatform(platform, root, candidate);
251
264
  if (exists(candidatePath)) {
package/bin/install.mjs CHANGED
@@ -37,6 +37,18 @@ const NPM = 'npm';
37
37
  const PIP = isWin ? 'pip' : 'pip3';
38
38
  const DRY_RUN = shouldDryRun(process.argv);
39
39
  const OPENCLAW_CONFIG_PATH = join(homedir(), '.openclaw', 'openclaw.json');
40
+
41
+ function resolveExecutable(cmd) {
42
+ if (!isWin) {
43
+ return cmd;
44
+ }
45
+ if (cmd === 'npm') return 'npm.cmd';
46
+ if (cmd === 'npx') return 'npx.cmd';
47
+ if (cmd === 'pip') return 'pip.exe';
48
+ if (cmd === 'pip3') return 'pip3.exe';
49
+ if (cmd === 'python3') return 'python.exe';
50
+ return cmd;
51
+ }
40
52
  const WINDOWS_UNINSTALL_KEYS = [
41
53
  'HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall',
42
54
  'HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall',
@@ -51,12 +63,13 @@ function step(index, total, title) {
51
63
  }
52
64
 
53
65
  function run(cmd, args, opts = {}) {
66
+ const executable = resolveExecutable(cmd);
54
67
  if (DRY_RUN) {
55
- console.log(dim(` [dry-run] ${cmd} ${args.join(' ')}`));
68
+ console.log(dim(` [dry-run] ${executable} ${args.join(' ')}`));
56
69
  return Promise.resolve(0);
57
70
  }
58
71
  return new Promise((resolve) => {
59
- const child = spawn(cmd, args, { stdio: 'inherit', shell: isWin, ...opts });
72
+ const child = spawn(executable, args, { stdio: 'inherit', shell: false, ...opts });
60
73
  child.on('close', (code) => resolve(code ?? 1));
61
74
  child.on('error', (err) => {
62
75
  console.log(yellow(` ⚠ 进程启动失败: ${err.message}`));
@@ -66,8 +79,9 @@ function run(cmd, args, opts = {}) {
66
79
  }
67
80
 
68
81
  function runCapture(cmd, args, opts = {}) {
82
+ const executable = resolveExecutable(cmd);
69
83
  return new Promise((resolve) => {
70
- const child = spawn(cmd, args, { stdio: ['ignore', 'pipe', 'pipe'], shell: isWin, ...opts });
84
+ const child = spawn(executable, args, { stdio: ['ignore', 'pipe', 'pipe'], shell: false, ...opts });
71
85
  let stdout = '';
72
86
  let stderr = '';
73
87
  child.stdout?.on('data', (chunk) => { stdout += chunk.toString(); });
@@ -80,7 +94,7 @@ function runCapture(cmd, args, opts = {}) {
80
94
  function commandExists(cmd) {
81
95
  return new Promise((resolve) => {
82
96
  const check = isWin ? 'where' : 'which';
83
- const child = spawn(check, [cmd], { stdio: 'ignore', shell: isWin });
97
+ const child = spawn(check, [cmd], { stdio: 'ignore', shell: false });
84
98
  child.on('close', (code) => resolve(code === 0));
85
99
  child.on('error', () => resolve(false));
86
100
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codewave-openclaw-installer",
3
- "version": "2.1.3",
3
+ "version": "2.1.5",
4
4
  "description": "网易智企 CodeWave OpenClaw 扩展:Skills + CLI 依赖一键安装",
5
5
  "type": "module",
6
6
  "main": "index.js",