feat: add simplified windows x86 support

This commit is contained in:
yankun
2026-06-27 18:33:59 +08:00
parent 7de0777748
commit 67c995db83
12 changed files with 400 additions and 84 deletions
+19 -5
View File
@@ -5,9 +5,10 @@ const path = require('path');
const http = require('http');
const https = require('https');
const crypto = require('crypto');
const { exec } = require('child_process');
const log = require('./logger');
const { resolveOpenclawConfigFile } = require('./frpc');
const { exec } = require('child_process');
const log = require('./logger');
const { resolveOpenclawConfigFile } = require('./frpc');
const { IS_WINDOWS } = require('./platform-paths');
const DEFAULT_BASE_URL = 'https://api.cutos.ai/v1';
const FETCH_TIMEOUT_MS = 10_000;
@@ -89,8 +90,21 @@ function writeJsonFile(filePath, obj) {
* 每次写盘 openclaw.json 成功后应调用一次。
* 使用异步 exec,不阻塞 Node.js 事件循环,避免干扰 LED / VFD 等后续操作。
*/
function restartGateway() {
exec('pkill -9 -x openclaw-gateway', (err) => {
function restartGateway() {
if (IS_WINDOWS) {
exec('taskkill /IM openclaw-gateway.exe /F', (err) => {
if (err && err.code !== 128 && err.code !== 1) {
log.warn('openclaw-provider', `restartGateway: ${err.message}`);
} else if (!err) {
log.info('openclaw-provider', 'openclaw-gateway.exe stopped; waiting for supervisor to restart it');
} else {
log.info('openclaw-provider', 'openclaw-gateway.exe is not running');
}
});
return;
}
exec('pkill -9 -x openclaw-gateway', (err) => {
if (err && err.code !== 1) {
log.warn('openclaw-provider', `restartGateway: ${err.message}`);
} else if (!err) {