Install the Installers/Windows SDK Signing Tools-x86_en-us.msi file - it's only 388 KiB large. For reference, it pulls in its files from the following .cab files, so these are also needed for a standalone install:
如果想在 CI 场景中使用它,也可以将 signtool.exe和这个文件夹中的其他文件提交到版本控制存储库中。我试过了,看起来效果不错。
(All files are probably not necessary since there are also some other .exe tools in this folder that might be responsible for these dependencies, but I am not sure which ones could be removed to make the set of files even smaller. Someone else is free to investigate further in this area. :) I tried to just copy signtool.* and that didn't work, so at least some of the other files are needed.)
You might not need Windows SDK at all. If you have VS-2019 installed, you might already have signtool in C:\Program Files (x86)\Microsoft SDKs\ClickOnce\SignTool\signtool.exe
注意: 这个特别的signtool版本(与 Windows SDK 版本相比)的好处是它是自包含的,并且不需要它旁边所有的 dll (mssign32.dll,wintrust.dll等,通常位于 Windows SDK 文件夹中)。
You can even add this file to your source code repo (just one file), since this tool hasn't changed since 2016.