实现数据库密钥设置页

This commit is contained in:
电摇小子
2026-07-14 11:07:35 +08:00
parent ab24185670
commit f1ceef0e5e
21 changed files with 1264 additions and 77 deletions
@@ -0,0 +1,23 @@
import { execFile } from 'child_process'
import { promisify } from 'util'
const execFileAsync = promisify(execFile)
const WINDOWS_WECHAT_IMAGES = ['Weixin.exe', 'WeChat.exe']
export async function isWindowsWechatRunning(): Promise<boolean> {
if (process.platform !== 'win32') return false
for (const imageName of WINDOWS_WECHAT_IMAGES) {
try {
const { stdout } = await execFileAsync(
'tasklist',
['/FI', `IMAGENAME eq ${imageName}`, '/FO', 'CSV', '/NH'],
{ windowsHide: true }
)
if (stdout.toLowerCase().includes(`"${imageName.toLowerCase()}"`)) return true
} catch {
// Try the other supported WeChat executable name.
}
}
return false
}