我在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"行产生:
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中运行相同的程序,得到相同的结果。
发布于 2020-10-24 14:43:49
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"执行得很好。
https://stackoverflow.com/questions/64433096
复制相似问题