Answer

In order to install a certificate (.cer) file required by Microsoft Office 2010 on the target computer the CertMgr.exe tool is required. The installation of the certificate file will be done by using a custom action.

ImportantThe CertMgr.exe tool is available in Windows SDK and can be downloaded from the Microsoft website.

Add the certificate

Files and FoldersAdd the certificate file to the project in the Files and Folders Page. The CertMgr.exe tool is not required to be added to the project.

Create the custom action

Custom ActionsNavigate to the Custom Actions Page and select the Add Resources action group.

  • From the toolbar select the "Launch attached file" option. In the opened dialog navigate and select the CertMgr.exe file.
  • Using the "Properties" pane on the right select the Deferred with no impersonation option under the "Execution Options" section.
  • In the "Command Line" field write the following code:
-add -all "[#MyCertificate.cer]" -r localMachine TrustedPublisherName
  • Replace MyCertificate.cer with the actual name of your certificate file.

TipIt is mandatory to use the [ Edit... ] button located on the right to select the certificate file. In the Edit Custom Action Parameters dialog use the [ File... ] button and pick the file.

Add the rest of your application files, build and test the project.