首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >signtool:在AppVeyor上解释为文件的选项

问signtool:在AppVeyor上解释为文件的选项
EN

Stack Overflow用户
提问于 2020-10-20 02:20:10
回答 1查看 98关注 0票数 0

我在AppVeyor版本(Visual Studio2019)上有一个超级奇怪的行为:在一个外壳脚本(cmd.exe)中,当用signtool为我的应用程序签名时,所有的选项都被解释为文件(signtool可以同时签名多个文件)。

"$WINDOWSKITBIN\\signtool.exe" sign /tr http://timestamp.digicert.com /td sha256 /fd SHA256 /n "Jan Gerner" /v /debug "build\\TypeWorld.exe"行产生:

代码语言:javascript
复制
Successfully signed: build\TypeWorld.exe
Number of files successfully Signed: 1
Number of errors: 10
SignTool Error: File not found: C:/Program Files/Git/tr
SignTool Error: File not found: http://timestamp.digicert.com
SignTool Error: File not found: C:/Program Files/Git/td
SignTool Error: File not found: sha256
SignTool Error: File not found: C:/Program Files/Git/fd
SignTool Error: File not found: SHA256
SignTool Error: File not found: N:/
SignTool Error: File not found: Jan Gerner
SignTool Error: File not found: V:/
SignTool Error: File not found: C:/Program Files/Git/debug

想要的文件TypeWorld.exe被签名,只是没有所有的选项,所有的选项都被解释为要签名的文件,很明显,然后就找不到了。

我已经确认转义的反斜杠和文件夹变量是正确的。

这一行echo "$WINDOWSKITBIN\\signtool.exe" sign /tr http://timestamp.digicert.com /td sha256 /fd SHA256 /n "Jan Gerner" /v /debug "build\\TypeWorld.exe"

生成预期的呈现:C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x86\signtool.exe sign /tr http://timestamp.digicert.com /td sha256 /fd SHA256 /n Jan Gerner /v /debug build\TypeWorld.exe

我尝试在PowerShell中运行相同的程序,得到相同的结果。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-10-24 14:43:49

AppVeyor工作人员的建议(也是通过电子邮件)都没有帮助。

最终起到帮助作用的是不要混用Windows和Linux (WSL)环境。在appveyor.yml中,我通过sh (或后来在AppVeyor员工的建议下调用bash )调用构建脚本:

代码语言:javascript
复制
build_script: 
    - cmd: C:\\msys64\\usr\\bin\\bash.exe wxPython/build/Windows/build-all.sh

相反,对于某些命令,最好保持简单,所以我将代码签名部分转换为一个很好的旧Windows批处理文件:

代码语言:javascript
复制
build_script: 
    - wxPython/build/Windows/build-sign.bat

在批处理文件中,行signtool.exe sign /tr http://timestamp.digicert.com /td sha256 /fd SHA256 /n "Jan Gerner" /v "build\\TypeWorld.exe"执行得很好。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/64433096

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档