Certificate files are installed through command line with the help of Operating System inbuilt tool called "CERTUTIL.EXE" which exists under c:\windows\system32 folder in Windows Vista and Windows 7.

Install Certificate:

Certutil.exe –f  –enterprise  –addstore  root   <CERTFILEPath>

For installation write a CUSTOM ACTION [in MSI or MST] where 

Working Directory : SystemFolder

File Name & Commandline : Certutil.exe –f  –enterprise  –addstore  root   <CERTFILEPath>

Put it in INSTALL EXEC SEQUENCE after InstallFinalize and condition should be REMOVE<>"ALL" so that the custom action should also run during REPAIR. 

After installation verify the certificate installation through MMC. 

Note: Copy .CER file to INSTALLDIR which will be <CERTFILEPath>Uninstall Certificate:

 

Use "Subject Key Identifier" to uninstall a particular certificate from the machine. 

  

Certutil.exe - delstore –enterprise  root   <Subject Key Identifier >

Check the Certificates Properties to get the "Subject Key Identifier".

efpo9J.png
 

For installation write a CUSTOM ACTION [in MSI or MST] where 

Working Directory : SystemFolder

File Name & Commandline : Certutil.exe - delstore –enterprise  root   <Subject Key Identifier >

Put it in INSTALL EXEC SEQUENCE after InstallInitialize and condition should be REMOVE="ALL" so that the custom action should only run during UNINSTALLATION. 

After uninstallation verify the certificate uninstallation through MMC. 

Note: <Subject Key Identifier > should be without spaces