Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create visual studio setup project with Sign Certificate for Excel Add In Project

I have prepared one setup project for my C# excel add in project. Installing that setup in client PC my add in is installing as unknown publisher.

To resolve this I am adding certificate manually in client PC, but my goal is install my add in as trusted known publisher without adding certificate manually.

Is there any solution to do this?

Thanks in advance.

like image 475
Rama Krishna Avatar asked Nov 21 '17 06:11

Rama Krishna


People also ask

How do I add a certificate to Visual Studio project?

Click File, and then select Add/Remove Snap-in. a. Double-click Certificates, select My user account, and then click Finish.

How do I sign an application in Visual Studio?

You sign an application or component by using the Signing tab of the project properties window (right-click the project node in Solution Explorer and select Properties). Select the Signing tab, then select the Sign the assembly check box.


1 Answers

If you are using an official certificate from a certificate authority you can sign the setup file (ie msi or .exe) using signtool.exe adding a post-build line to your setup project's properties.

signtool sign /f MyCert.pfx /tr http://timestamp.comodoca.com/rfc3161 /v "C:\...\...\MySetupProject.msi

Signtool is automatically installed with visual studio.

In addition to this and prior to building your setup project, you want to sign the add-in's .dll file (also with signtool) and the manifest (with mage).

like image 130
Mike Avatar answered Sep 28 '22 07:09

Mike