signtool:选项被解释为AppVeyor上的文件 [英] signtool: options interpreted as files on AppVeyor

查看:66
本文介绍了signtool:选项被解释为AppVeyor上的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I’m having this super weird behaviour on an AppVeyor build (Visual Studio 2019): In a shell script (cmd.exe), when signing my app with signtool, all the options are interpreted as files (signtool can sign multiple files at once).

行"$ WINDOWSKITBIN \\ signtool.exe"符号/tr http://timestamp.digicert.com/td sha256/fd SHA256/n"Jan Gerner"/v/debugbuild\\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 进行了签名,所有选项都被解释为要签名的文件,显然找不到.

The wanted file TypeWorld.exe is signed, just without all the options, and all the options are interpreted as files to sign which then aren’t found, obviously.

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

I've confirmed the escaped backslashes and folder variable to be correct.

此行 echo"$ WINDOWSKITBIN \\ signtool.exe";符号/tr http://timestamp.digicert.com/td sha256/fd SHA256/n"Jan Gerner"/v/debugbuild\\TypeWorld.exe"

产生预期的渲染: C:\ Program Files(x86)\ Windows Kits \ 10 \ bin \ 10.0.19041.0 \ x86 \ signtool.exe标志/tr http://timestamp.digicert.com/tdsha256/fd SHA256/n Jan Gerner/v/debug build \ TypeWorld.exe

我尝试在PowerShell中运行相同的结果.

I tried running the same in PowerShell, to same result.

推荐答案

AppVeyor员工推荐的任何建议(也通过电子邮件发送)都没有帮助.

None of what the AppVeyor staff recommended (also by email) helped.

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

What did help in the end is to not mix Windows and Linux (WSL) environments. In appveyor.yml I was calling the build script through sh (or later bash at the recommendation of AppVeyor staff):

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

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

Instead, for some commands it's better to keep things simple, so I converted the code signing part to a good old Windows batch file:

build_script: 
    - wxPython/build/Windows/build-sign.bat

在批处理文件中,该行 signtool.exe标志/tr http://timestamp.digicert.com/td sha256/fd SHA256/n"Jan Gerner"/v"build \\ TypeWorld.exe" 执行正常.

Inside the batch file, the line signtool.exe sign /tr http://timestamp.digicert.com /td sha256 /fd SHA256 /n "Jan Gerner" /v "build\\TypeWorld.exe" executes fine.

这篇关于signtool:选项被解释为AppVeyor上的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆