使用Inno Setup,如何导入证书.cer文件?

Gui*_*tos 9 installation installer inno-setup distribution certificate

我可以使用Inno Setup导入.cer文件(证书)吗?

我该怎么做?

我需要为Windows XP,Windows Vista和Windows 7创建证书安装程序.

Slo*_*ner 10

实际上CertMgr.exe并非在所有PC上都可用,而且它似乎不是可再发行的(正如@TLama暗示的那样); 除此之外你甚至都不需要它.

CertUtil 可以在每台Windows机器上使用(我已经测试过)并完美运行:

[Run]
Filename: "certutil.exe"; Parameters: "-addstore ""TrustedPublisher"" {app}\MyCert.cer"; \
    StatusMsg: "Adding trusted publisher..." 
Run Code Online (Sandbox Code Playgroud)

  • [此处](https://social.technet.microsoft.com/Forums/en-US/09fb7a70-69c2-4cc0-ad82-173c06774261/availability-of-certutil-on- Different-windows-versions?forum =winserversecurity)certutil.exe 随 Windows 7 及更高版本一起提供。对于早期版本,请从 [Microsoft 下载](http://www.microsoft.com/downloads/details.aspx?FamilyID=c16ae515-c8f4-47ef-a1e4-a8dcbacff8e3&DisplayLang=en) 下载 ([ref](https:// Social.technet.microsoft.com/Forums/exchange/en-US/dde3925d-0376-4615-ac5e-61fae88f3da2/where-cound-i-download-certutilexe-and-certreqexe65311?forum=winservergen)) (2认同)

Sim*_*aWB 2

将 Certmgr.exe 和 yourcertificate.cer 添加到安装程序中:

[Files]
Source: CertMgr.exe; DestDir: {app}; Flags: deleteafterinstall
Source: yourcertificate.cer; DestDir: {app}; Flags: deleteafterinstall
Run Code Online (Sandbox Code Playgroud)

在 [Run] 部分中,编写如下内容:

Filename: {app}\CertMgr.exe; Parameters: "-add -all -c yourcertificate.cer -s -r localmachine trustedpublisher"; Flags: waituntilterminated runhidden;
Run Code Online (Sandbox Code Playgroud)

  • 就我而言,它是自签名证书。这样 localmachine 行就以 root 结尾 (2认同)