Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

fix(desktop): .cindy 关联幂等检查补扩展名归属校验

Lizi7736a8dce2f4
diff --git a/apps/desktop/src/main/cindy-brain/fileAssociation.ts b/apps/desktop/src/main/cindy-brain/fileAssociation.ts
index e9bd95bbb8..b537ef7e98 100644
--- a/apps/desktop/src/main/cindy-brain/fileAssociation.ts
+++ b/apps/desktop/src/main/cindy-brain/fileAssociation.ts
@@ -89,10 +89,11 @@ export function registerCindyFileAssociation(): void {
const command = `"${exe}" "%1"`;
const commandKey = `${KEY_PROG}\\shell\\open\\command`;
const upToDate =
+ (await regQueryDefault(KEY_EXT)) === PROG_ID &&
(await regQueryDefault(commandKey)) === command &&
(await regQueryNamed(KEY_EXT, 'Content Type')) === CINDY_MIME &&
(await regQueryNamed(KEY_EXT_SHARE, 'Content Type')) === SHARE_MIME;
- if (upToDate) return; // 已注册且指向当前 exe
+ if (upToDate) return; // 已注册、扩展名归属自己且指向当前 exe
await regSetDefault(KEY_EXT, PROG_ID);
await regSetNamed(KEY_EXT, 'Content Type', CINDY_MIME);