简体   繁体   English

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

[英]Using Inno Setup, how to import a certificate .cer file?

Can I use Inno Setup to import a .cer file (a certificate)? 我可以使用Inno Setup导入.cer文件(证书)吗?

How can I do it? 我该怎么做?

I need to create a certificate installer for Windows XP, Windows Vista and Windows 7. 我需要为Windows XP,Windows Vista和Windows 7创建证书安装程序。

Actually the CertMgr.exe is not available on all PCs and furthermore it does not appear to be redistributable (as hinted by @TLama); 实际上, CertMgr.exe并非在所有PC上都可用,而且它似乎不是可再发行的(正如@TLama暗示的那样); and besides you don't even need it. 除此之外你甚至都不需要它。

CertUtil is available on every Windows machine (that I have tested) and works perfectly: CertUtil可用于每台Windows机器(我已经测试过)并且运行良好:

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

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

[Files]
Source: CertMgr.exe; DestDir: {app}; Flags: deleteafterinstall
Source: yourcertificate.cer; DestDir: {app}; Flags: deleteafterinstall

And in [Run] section, write something like this: 在[Run]部分中,写下这样的内容:

Filename: {app}\CertMgr.exe; Parameters: "-add -all -c yourcertificate.cer -s -r localmachine trustedpublisher"; Flags: waituntilterminated runhidden;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM