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

Guilherme de Jesus Santos picture Guilherme de Jesus Santos · Oct 5, 2012 · Viewed 7.6k times · Source

Can I use Inno Setup to import a .cer file (a certificate)?

How can I do it?

I need to create a certificate installer for Windows XP, Windows Vista and Windows 7.

Answer

SlowLearner picture SlowLearner · Oct 21, 2016

Actually the CertMgr.exe is not available on all PCs and furthermore it does not appear to be redistributable (as hinted by @TLama); and besides you don't even need it.

CertUtil is available on every Windows machine (that I have tested) and works perfectly:

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