Lines 1-38javascript
4 * hermes-ru-launcher.js — Self-healing launcher с автообновлением
6 * При запуске через ярлык «Hermes RU»:
7 * 1. Проверяет целостность перевода (app.asar.unpacked/dist)
8 * 2. Сравнивает локальную версию с последним релизом на GitHub
9 * 3. Если есть новая версия — скачивает, обновляет перевод, потом запускает Hermes
10 * 4. Запускает Hermes.exe
12 * Не убивает Hermes. Не трогает app.asar.
15const fs = require('fs');
16const path = require('path');
17const os = require('os');
18const https = require('https');
19const { spawn, execSync, execFileSync } = require('child_process');
20
HighChild Process
Package source references child process execution.
launcher/hermes-ru-launcher.jsView on unpkg · L18 21const DATA_DIR = path.join(os.homedir(), '.hermes', 'russian-loc');
22const HERMES_EXE_PATH_FILE = path.join(DATA_DIR, 'hermes-exe-path.txt');
23const VERSION_FILE = path.join(DATA_DIR, 'version.json');
24const GITHUB_API = 'https://api.github.com/repos/anatolijlaptev1991-ctrl/hermes-ru/releases/latest';
25const PENDING_MAX_AGE_MS = 24 * 60 * 60 * 1000;
26const LAUNCHER_LOCK_MAX_AGE_MS = 20 * 60 * 1000;
27const LAUNCHER_LOCK_FILE = path.join(DATA_DIR, 'launcher.lock');
28const LOG_FILE = path.join(DATA_DIR, 'hermes-ru.log');
29const LOG_ENABLED_FILE = path.join(DATA_DIR, '.log-enabled');
30let _logEnabled = null;
32function isLogEnabled() {
33 if (_logEnabled !== null) return _logEnabled;
34 if (process.env.HERMES_RU_LOG === '1') { _logEnabled = true; return true; }
35 if (process.env.HERMES_RU_LOG === '0') { _logEnabled = false; return false; }
HighSame File Env Network Execution
A single source file combines environment access, network access, and code or shell execution; review context before blocking.
launcher/hermes-ru-launcher.jsView on unpkg · L18 36 _logEnabled = fs.existsSync(LOG_ENABLED_FILE);