Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。
TypeScript agentai-agentai-assistantandroidclaude-codecodexelectroniosllmmacosreact-nativetypescriptwindows
fix(windows): resolve NSIS custom include paths
guyongb34371e21453
diff --git a/apps/desktop/resources/installer-directory.nsh b/apps/desktop/resources/installer-directory.nshindex 9f80cf968b..0d1773c5e7 100644--- a/apps/desktop/resources/installer-directory.nsh+++ b/apps/desktop/resources/installer-directory.nsh@@ -62,7 +62,7 @@ Var cindyDirectoryMessage!macro customHeader!ifndef BUILD_UNINSTALLER- !include "installer-directory-messages.nsh"+ !include "${BUILD_RESOURCES_DIR}\installer-directory-messages.nsh"Function CindyGetUserSidStrCpy $cindyUserSid ""diff --git a/apps/desktop/resources/installer.nsh b/apps/desktop/resources/installer.nshindex 2b7d4e6954..62c2b6bb74 100644--- a/apps/desktop/resources/installer.nsh+++ b/apps/desktop/resources/installer.nsh@@ -7,8 +7,8 @@; 接受);dev 仍独立名,dev 安装器绝不误伤同机并存的正式安装。注册表键名; Windows 大小写不敏感,shell 键 "Cindy" 与历史写入的 "cindy" 是同一个键,; 行为零变化。-!include "winget-shortcuts.nsh"-!include "installer-directory.nsh"+!include "${BUILD_RESOURCES_DIR}\winget-shortcuts.nsh"+!include "${BUILD_RESOURCES_DIR}\installer-directory.nsh"!ifndef BUILD_UNINSTALLER!macro customInitdiff --git a/apps/desktop/scripts/check-windows-installer.mjs b/apps/desktop/scripts/check-windows-installer.mjsindex 91057da3d8..18e8569469 100644--- a/apps/desktop/scripts/check-windows-installer.mjs+++ b/apps/desktop/scripts/check-windows-installer.mjs@@ -67,6 +67,7 @@ try {'/WX','/V2',`/DTEST_ROOT=${root}`,+ `/DBUILD_RESOURCES_DIR=${resources}`,`/X!addincludedir "${resources}"`,`/X!addincludedir "${path.join(nsisTemplatesDir, 'include')}"`,path.join(desktop, 'scripts', 'fixtures', 'installer-directory-check.nsi'),diff --git a/apps/desktop/scripts/nsis-include-paths.test.mjs b/apps/desktop/scripts/nsis-include-paths.test.mjsnew file mode 100644index 0000000000..f4831cb771--- /dev/null+++ b/apps/desktop/scripts/nsis-include-paths.test.mjs@@ -0,0 +1,24 @@+import { readFileSync } from 'node:fs';+import { describe, expect, it } from 'vitest';++const installer = readFileSync(new URL('../resources/installer.nsh', import.meta.url), 'utf8');+const directory = readFileSync(+ new URL('../resources/installer-directory.nsh', import.meta.url),+ 'utf8',+);++describe('Windows NSIS include paths', () => {+ it('resolves project-owned includes from BUILD_RESOURCES_DIR', () => {+ expect(installer).toContain('!include "${BUILD_RESOURCES_DIR}\\winget-shortcuts.nsh"');+ expect(installer).toContain('!include "${BUILD_RESOURCES_DIR}\\installer-directory.nsh"');+ expect(directory).toContain(+ '!include "${BUILD_RESOURCES_DIR}\\installer-directory-messages.nsh"',+ );+ });++ it('does not depend on the NSIS working directory for project-owned files', () => {+ expect(installer).not.toContain('!include "winget-shortcuts.nsh"');+ expect(installer).not.toContain('!include "installer-directory.nsh"');+ expect(directory).not.toContain('!include "installer-directory-messages.nsh"');+ });+});