mirror of
https://wget.la/https://github.com/Wxw-Gu/WechatExplorer
synced 2026-11-30 16:02:58 +08:00
fix: 完善交互、知识库目录与 Windows 运行库提示
This commit is contained in:
1 parent
1edea7d3cc
commit
7ec0e4f539
16 files changed
+283
-20
No files matched your search
@@ -4,8 +4,18 @@ export type DatabaseKeyValidationCode =
|
||||
| 'ACCOUNT_MISMATCH'
|
||||
| 'ROOT_UNAVAILABLE'
|
||||
| 'DATABASE_FILE_MISSING'
|
||||
| 'VC_RUNTIME_MISSING'
|
||||
| 'UNKNOWN_VALIDATION_ERROR'
|
||||
|
||||
export type DatabaseInitCode = DatabaseKeyValidationCode | 'ACCOUNT_SELECTION_REQUIRED'
|
||||
|
||||
export interface DatabaseInitResult {
|
||||
success: boolean
|
||||
code?: DatabaseInitCode
|
||||
error?: string
|
||||
monitoring?: boolean
|
||||
}
|
||||
|
||||
export interface DatabaseKeyValidationResult {
|
||||
success: boolean
|
||||
code?: DatabaseKeyValidationCode
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
export const WINDOWS_VC_RUNTIME_DOWNLOAD_URL = 'https://aka.ms/vc14/vc_redist.x64.exe'
|
||||
|
||||
export const WINDOWS_VC_RUNTIME_ERROR_MESSAGE = `当前 Windows 缺少 Microsoft Visual C++ 2015-2022 x64 运行库,无法加载微信数据库组件。请下载安装后重新启动 WechatExplorer:${WINDOWS_VC_RUNTIME_DOWNLOAD_URL}`
|
||||
|
||||
const VC_RUNTIME_LIBRARY_PATTERN =
|
||||
/(?:vcruntime140(?:_1)?\.dll|msvcp140(?:_[12])?\.dll|concrt140\.dll|ucrtbase\.dll|api-ms-win-crt)/i
|
||||
const WINDOWS_DEPENDENCY_LOAD_PATTERN =
|
||||
/(?:the specified module could not be found|找不到指定的模块|找不到指定模块|win32 error\s*126|error\s*126|err_dlopen_failed)/i
|
||||
|
||||
export function isWindowsVcRuntimeMissingError(detail: string, platform: string): boolean {
|
||||
if (platform !== 'win32') return false
|
||||
return VC_RUNTIME_LIBRARY_PATTERN.test(detail) || WINDOWS_DEPENDENCY_LOAD_PATTERN.test(detail)
|
||||
}
|
||||
Reference in new issue
Block a user