如何使用 InnoSetup (ISCC.exe) 和 DigiCert 的 smctl.exe 创建签名卸载程序?

问题描述 投票:0回答:2

我使用 smctl.exe 在我们的构建服务器上签署桌面应用程序。 我使用包含 /S 参数的 *.iss 文件调用执行 iscc.exe,如下所示:

/Dsigning=true /Dbuildworkingdir=${bamboo.build.working.directory} ${bamboo.build.working.directory}\150_Software\10_SW\InnoSetup\EPCSetup.iss "/Ssigntool=smctl.exe sign --keypair-alias key_XXXXXXXX --input $f"

这会生成正确签名的“setup.exe”。

只要我的 *.iss 文件中有这一行,这就可以工作:

SignedUninstaller=no

一旦切换到

SignedUninstaller=yes
,构建就会失败。

以下是竹日志的相应摘录:

build   27-Sep-2023 08:09:20    Preparing Setup program executable
build   27-Sep-2023 08:09:20       Updating version info (SETUP.E32)
build   27-Sep-2023 08:09:21       Running Sign Tool signtool: C:\Program Files\DigiCert\DigiCert Keylocker Tools\smctl.exe sign --keypair-alias key_XXXXXXXXX --input "D:\Atlassian\ApplicationData\Bamboo\local-working-dir\360449\CFN-DIG-JOB1\150_Software\10_SW\InnoSetup\Output\uninst.e32.tmp"
build   27-Sep-2023 08:09:24    There were no files found for signing
error   27-Sep-2023 08:09:24    Error in D:\Atlassian\ApplicationData\Bamboo\local-working-dir\360449\CFN-DIG-JOB1\150_Software\10_SW\InnoSetup\EPCSetup.iss: The Sign Tool command returned an exit code of 0, but the file does not have a digital signature.
error   27-Sep-2023 08:09:24    Compile aborted.

我的调查显示 smctl.exe 使用 Microsoft Signtool.exe 进行签名。 Signtool.exe 只能对可执行文件进行签名。

现在我无法再继续下去了。 InnoSetup 想要签署“uninst.e32.tmp”,但 smctl.exe 拒绝。有人知道这个问题吗?我能做些什么? 另外:为什么 InnoSetup 尝试签署 *.tmp 文件?

任何提示将非常感激。

inno-setup code-signing signtool
2个回答
2
投票

您可以通过获取 DigiCert 证书的 SHA1 指纹,然后使用:

将实际的 Microsoft 签名工具与 DigiCert 结合使用
...\path\to\signtool.exe sign /sha1 <thumbprint> /tr http://timestamp.digicert.com /td sha256 /fd sha256 %1

其中

%1
代表要签名的文件。

假设您已经运行 DigiCert 设置工具

smksp_cert_sync.exe
,您可以使用 Signtool 来下载有关它们为您存储的证书的元数据。这会以signtool 理解的某种标准方式注册它们。由于您正在使用
smctl
我认为这已经完成了。

我相信您可以通过运行(开始>运行)

certmgr.msc
来获取指纹,以查看“当前用户\个人\证书”下的所有证书列表。

我曾经对所有内容(包括 Inno 卸载程序存根)使用 DigiCert 签名,效果很好。


1
投票

uninst.e32.tmp
是一个可执行文件,只是带有
.tmp
扩展名。

根据错误消息,看起来

smctl
甚至没有尝试对文件进行签名。所以问题不在于文件本身,而可能在于它的名称(扩展名)。

将文件重命名为

.exe
可能会解决问题。您可以编写一个脚本(一个简单的批处理文件即可)来重命名该文件,对其进行签名,然后将其重命名回来。并在 Inno Setup 中将该脚本/批处理配置为签名工具。

有关此类批处理文件的一些示例,请参阅

© www.soinside.com 2019 - 2024. All rights reserved.