@oxiaom/adoremix 1.0.24 → 1.0.26

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oxiaom/adoremix",
3
- "version": "1.0.24",
3
+ "version": "1.0.26",
4
4
  "description": "AdoreMix broadcast server - cross-platform installer, runner and service manager",
5
5
  "bin": {
6
6
  "adoremix": "./bin/adoremix.js"
package/src/doctor.js CHANGED
@@ -153,6 +153,13 @@ function runDoctor(workdir, opts) {
153
153
  logger.ok(`✓ Node.js v${nodeVer}`);
154
154
  }
155
155
 
156
+ // 1.5 安装目录不能含中文等非 ASCII 字符(AdoreMix 在含中文路径下运行会出问题)
157
+ if (/[^\x00-\x7F]/.test(workdir)) {
158
+ issues.push({ type: 'workdir-nonascii', severity: 'error', msg: `安装目录含非 ASCII 字符(中文等):${workdir}。AdoreMix 在含中文的路径下运行会出问题,请改用纯英文路径重装(Windows 例 C:\\adoremix,Linux 例 /opt/adoremix)。` });
159
+ logger.error(`❌ 安装目录含非 ASCII 字符(中文等):${workdir}`);
160
+ logger.log(` 请用纯英文路径重新安装:adoremix install --workdir <纯英文路径> --force`);
161
+ }
162
+
156
163
  // 2. native 包是否加载
157
164
  let native;
158
165
  try {
@@ -332,6 +339,20 @@ function runDoctor(workdir, opts) {
332
339
  logger.warn(`⚠ config.ini 不存在`);
333
340
  }
334
341
 
342
+ // 5.5 工作目录是否由旧版本安装(native 有更新时需 install --force 刷新,否则继续用旧二进制)
343
+ const markerPath = path.join(workdir, '.adoremix-installed');
344
+ try {
345
+ const marker = JSON.parse(fs.readFileSync(markerPath, 'utf8'));
346
+ const pkgVer = require('../package.json').version;
347
+ if (marker.version && marker.version !== pkgVer) {
348
+ issues.push({ type: 'workdir-stale', severity: 'warn', msg: `工作目录由 v${marker.version} 安装,当前包 v${pkgVer}。若 native 有更新需 adoremix install --force 刷新二进制/资源(保留 config.ini)。` });
349
+ logger.warn(`⚠ 工作目录由 v${marker.version} 安装,当前包 v${pkgVer},二进制/资源可能陈旧`);
350
+ logger.log(` 刷新:adoremix install --force`);
351
+ } else if (marker.version) {
352
+ logger.ok(`✓ 工作目录版本 v${marker.version} 与当前包一致`);
353
+ }
354
+ } catch (e) { /* .adoremix-installed 不存在或不可解析则跳过 */ }
355
+
335
356
  // 6. .Adore.db 存在 + 有数据
336
357
  const dbPath = path.join(workdir, '.Adore.db');
337
358
  if (fs.existsSync(dbPath)) {
package/src/install.js CHANGED
@@ -159,6 +159,13 @@ function deployWebuiIfPresent(workdir) {
159
159
  async function runInstall(opts) {
160
160
  opts = opts || {};
161
161
  const workdir = opts.workdir || paths.defaultWorkdir();
162
+ // 前置拦截:安装目录不能含中文等非 ASCII 字符(AdoreMix 在含中文路径下运行会出问题)
163
+ if (/[^\x00-\x7F]/.test(workdir)) {
164
+ logger.error(`❌ 工作目录含非 ASCII 字符(中文等):${workdir}`);
165
+ logger.log(` AdoreMix 在含中文的路径下运行会出问题,请用纯英文路径重装,如:`);
166
+ logger.log(` adoremix install --workdir C:/adoremix`);
167
+ return 1;
168
+ }
162
169
  let native;
163
170
  try {
164
171
  native = opts.native || paths.loadNative();
@@ -196,7 +203,9 @@ async function runInstall(opts) {
196
203
  deployWebuiIfPresent(workdir);
197
204
 
198
205
  const config = require('./config');
199
- const cfgOk = await config.ensureConfig(workdir, { interactive: opts.interactive !== false, force: opts.force });
206
+ // install --force 只刷新二进制/资源,**不覆盖已存在的 config.ini**(避免客户升级时配置丢失)。
207
+ // 需要重建配置请用:adoremix config init --force
208
+ const cfgOk = await config.ensureConfig(workdir, { interactive: opts.interactive !== false, force: false });
200
209
  if (!cfgOk) {
201
210
  logger.warn('配置未生成。请稍后运行 adoremix config init');
202
211
  }