Skip to content

Commit 7ff3ba8

Browse files
committed
build(desktop): 打包 MCP Skill 并保留输出目录选择
- PyInstaller 打包时加入 wechat-mcp-copilot Skill 资源 - 使用跨平台 add-data 分隔符生成参数 - 安装/更新时若用户已迁移输出目录,则跳过默认目录迁移提示
1 parent b030aa6 commit 7ff3ba8

2 files changed

Lines changed: 15 additions & 2 deletions

File tree

desktop/scripts/build-backend.cjs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,12 @@ VSVersionInfo(
5555
`;
5656
}
5757

58+
function pyInstallerAddData(sourcePath, targetPath) {
59+
return `${sourcePath}${path.delimiter}${targetPath}`;
60+
}
61+
5862
const nativeDir = path.join(repoRoot, "src", "wechat_decrypt_tool", "native");
59-
const addData = `${nativeDir};wechat_decrypt_tool/native`;
63+
const skillDir = path.join(repoRoot, "skills", "wechat-mcp-copilot");
6064
const projectToml = path.join(repoRoot, "pyproject.toml");
6165

6266
const desktopPackageJsonPath = path.join(repoRoot, "desktop", "package.json");
@@ -88,7 +92,9 @@ const args = [
8892
"--version-file",
8993
versionFilePath,
9094
"--add-data",
91-
addData,
95+
pyInstallerAddData(nativeDir, "wechat_decrypt_tool/native"),
96+
"--add-data",
97+
pyInstallerAddData(skillDir, "skills/wechat-mcp-copilot"),
9298
entry,
9399
];
94100

desktop/scripts/installer-custom.nsh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,13 @@ FunctionEnd
148148
Function WDA_OutputDirPageCreate
149149
Call WDA_InitOutputDirSelection
150150

151+
; If the user already moved output away from the default AppData location,
152+
; keep that choice silently on install/update. Only show this migration prompt
153+
; while the effective output directory is still the default.
154+
${If} $WDA_SelectedOutputDir != "${WDA_DEFAULT_OUTPUT_DIR}"
155+
Abort
156+
${EndIf}
157+
151158
nsDialogs::Create 1018
152159
Pop $WDA_OutputDirPage
153160

0 commit comments

Comments
 (0)