Files
WechatExplorer/src/main/runtime-mode.ts
T
Wxw-Gu eaa25cd29e feat: Reader Skill 支持版本自检与自助更新
微信机器人回复剥离引用编号、列表改用空行分隔,失败通知补失败时刻
 问问微信关键词检索在索引落后时按单会话直读原始记录兜底
 关闭窗口支持记住选择并在设置中修改
 退群监控刷新列表
2026-10-14 10:31:01 +08:00

18 lines
558 B
TypeScript

import { app } from 'electron'
import { existsSync } from 'fs'
import { join } from 'path'
export function isPackagedRuntime(): boolean {
if (app.isPackaged) return true
// 非 Electron 进程(例如单元/集成测试)里 process.resourcesPath 不存在,
// 此时 join 会抛错。没有 resources 目录就必然不是打包运行时。
const resourcesPath = process.resourcesPath
if (!resourcesPath) return false
return (
existsSync(join(resourcesPath, 'app.asar')) &&
existsSync(join(resourcesPath, 'app-update.yml'))
)
}