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

问题描述

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

signtool行产生:

"$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"

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

解决方法

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"执行正常。

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...