From 2e45bb1cd9896b65d50ec02bc1ed05c5d630e330 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=86=B0=E7=B3=96XH?= <76904365+bingtangxh@users.noreply.github.com> Date: Thu, 26 Mar 2026 14:27:03 +0800 Subject: [PATCH] Add symlink notes and fix pugixml path Add notes/symlinks.md documenting required symbolic links for the appinstaller and shared directories, plus guidance for creating symlinks in Debug/Release and including shared subdirs in releases. Update pkgread project and its filters to use a relative path for pugixml.cpp (..\packages\pugixml.1.15.0\...) instead of an absolute user-specific NuGet path so the project is portable and includes pugixml.cpp needed to resolve linker errors for non-x86 builds (e.g. ARM). --- notes/symlinks.md | 50 +++++++++++++++++++++++++++++++++ pkgread/pkgread.vcxproj | 2 +- pkgread/pkgread.vcxproj.filters | 2 +- 3 files changed, 52 insertions(+), 2 deletions(-) create mode 100644 notes/symlinks.md diff --git a/notes/symlinks.md b/notes/symlinks.md new file mode 100644 index 0000000..9197a56 --- /dev/null +++ b/notes/symlinks.md @@ -0,0 +1,50 @@ +# 关于该项目中的一些符号链接 + +该项目由于原作者开发方便,使用了一些符号链接。在迁移时会遇到问题。 + +符号链接主要是位于 \appinstaller 目录中。 + +使用了符号链接的文件有: + +- certmgr.h +- notice.h +- pkgmgr.h +- pkgread.h +- priformatcli.h + +以上文件分别指向的是 `..\\.h` 。 + +# 一些最终运行所需文件位于 shared 目录 + +此外,在生成完成后,最终生成的程序需要一些文件,但是这些文件位于的是解决方案的 `shared` 目录。 + +因此,你在测试时,需要将 `shared` 目录中的每一个子目录都在输出目录下(`Debug`和`Release`)创建一个目录符号链接 (`SYMLINKD`),指向 `..\shared\<子目录>` 。 + +例如: + +``` for /d %A in (D:\GitHub\App-Installer-For-Windows-8.x-Reset\shared\*) do @mklink /d "D:\GitHub\App-Installer-For-Windows-8.x-Reset\Debug\%~nA" "%A" ``` + +``` for /d %A in (D:\GitHub\App-Installer-For-Windows-8.x-Reset\shared\*) do @mklink /d "D:\GitHub\App-Installer-For-Windows-8.x-Reset\Release\%~nA" "%A" ``` + +最终发布时,你也需要将 `shared` 目录中的每一个子目录都复制到发布目录,再打包发布。 + +# pkgread 项目需要引用 pugixml.cpp + +最后,pkgread 项目有一个 `pugixml.cpp` 的引用。 +如果没有这个的话,链接器会报错 LNK2019 无法解析的外部符号: + +- `pugi::xml_document::load_file` +- `pugi::as_utf8_` +- `pugi::as_wide_` + +和 LNK1120 n 个无法解析的外部命令。 + +因为这个解决方案需要一个 NuGet 包叫 `pugixml` , +但是这个包默认只有 x86 和 x64 的版本,因此为了编译出 ARM32 版本,我就把 pugixml.cpp 在 pkgread 项目中加了一个引用。 + +迁移之后,你应该需要重新添加这个“现有项”的引用。 + +路径示例: + +```D:\GitHub\App-Installer-For-Windows-8.x-Reset\packages\pugixml.1.15.0\build\native\include\pugixml.cpp``` + diff --git a/pkgread/pkgread.vcxproj b/pkgread/pkgread.vcxproj index d89f598..381593e 100644 --- a/pkgread/pkgread.vcxproj +++ b/pkgread/pkgread.vcxproj @@ -249,7 +249,7 @@ - + false false diff --git a/pkgread/pkgread.vcxproj.filters b/pkgread/pkgread.vcxproj.filters index 73cc715..8be6062 100644 --- a/pkgread/pkgread.vcxproj.filters +++ b/pkgread/pkgread.vcxproj.filters @@ -89,7 +89,7 @@ 源文件 - + 源文件