简体   繁体   English

如何使用 Excel 插件项目的签名证书创建 Visual Studio 安装项目

[英]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.我已经为我的 C# excel 添加项目准备了一个安装项目。 Installing that setup in client PC my add in is installing as unknown publisher.在客户端 PC 中安装该设置我的插件安装为未知发布者。

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.为了解决这个问题,我在客户端 PC 中手动添加证书,但我的目标是将我的插件安装为受信任的已知发布者,而无需手动添加证书。

Is there any solution to do this?有没有办法做到这一点?

Thanks in advance.提前致谢。

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.exe 对安装文件(即 msi 或 .exe)进行签名,并将构建后行添加到安装项目的属性中。

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

Signtool is automatically installed with visual studio. Signtool 随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).除此之外,在构建安装项目之前,您还需要对加载项的 .dll 文件(也使用 signtool)和清单(使用 mage)进行签名。

在此处输入图片说明

Here is how, I discovered using other thread这是我发现使用其他线程的方法

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

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