【问题标题】:signtool: options interpreted as files on AppVeyorsigntool:选项解释为 AppVeyor 上的文件
【发布时间】:2020-10-19 18:20:10
【问题描述】:

我在 AppVeyor 构建 (Visual Studio 2019) 上遇到了这种超级奇怪的行为:在 shell 脚本 (cmd.exe) 中,当使用 signtool 签署我的应用程序时,所有选项都被解释为文件 (@987654322 @ 可以一次签署多个文件)。

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

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 中运行相同的程序,结果相同。

【问题讨论】:

  • 您能否将完整的appveyor.yml(敏感数据已编辑/删除)发送至support@appveyor.com。
  • 我通过电子邮件发送了它。非常感谢及时回复??????
  • 啊,我明白了,星期一的邮件被困在垃圾文件夹中!现在调查一下。

标签: cmd appveyor signtool


【解决方案1】:

AppVeyor 工作人员推荐的(也通过电子邮件)没有任何帮助。

最终有帮助的是不混合 Windows 和 Linux (WSL) 环境。在appveyor.yml 中,我通过sh 调用构建脚本(或在AppVeyor 工作人员的推荐下稍后bash):

build_script: 
    - cmd: C:\\msys64\\usr\\bin\\bash.exe wxPython/build/Windows/build-all.sh

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

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" 执行良好。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-08-21
    • 2020-11-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-04-14
    • 2020-06-15
    相关资源
    最近更新 更多