Search code examples
certificatevstoclickonceadd-in

How to create a Trust Prompt for my Exel Add-In installer


I created a VSTO Excel Add-in ribbon. That I published to setup.exe. But when the end user tries to install it, it fails with this error:

Customized functionality in this application will not work because the certificate used to sign the deployment manifests for [Add-In] or its location is not trusted. Contact your administrator for further assistance.

I can install the Add-In by doing the following.

  1. Unzip and right click on “setup.exe” and select properties
  2. Click on Digital Signatures tab
  3. Select [issuer] from the Signature list and click the Details button
  4. When the Digital Signature Details dialogue appears, click View Certificate
  5. When the Certificate dialogue appears, click on Install Certificate
  6. The Certificate Import Wizard window should appear. Choose the following: a. Store Location: Current User, click the Next button. b. Certificate Store: Place all certificates in the following store, Click Browse, select Trusted Root Certification Authorities, click the Next button. c. Click the Finish button. d. A security Warning should appear asking “… Do you want to install this certificate?” Click Yes. e. Click OK. On the “The import was successful.” Dialogue.
  7. Click OK to exit the Certificate dialogue
  8. Click OK to exit the Digital Signature Details dialogue.
  9. Click OK to exit the setup Properties dialogue.

then I run the setup and all works. The problem is we must send this setup file to many users. and NO ONE will want to do that. I've been messing around with the solution properties -> Signing -> Sign the ClickOnce manifests, but I can’t seem to bring up the Trust Prompt on anything I alter. I don’t have a paid for certificate, I just need the prompt to appear for the user to choose to trust it. I haven’t found an answer online on how to allow this prompt to appear. Any help is greatly appreciated.


Solution

  • You can deploy your VSTO to the Program Files directory. Your add-in will be considered as being safe since admin rights are required to install in this directory. I believe it is the simplest way.

    Granting Trust when using Windows Installer You can use Windows Installer to create an MSI file to install Office solutions into the Program Files directory, which requires administrator rights. For Office solutions in the Program Files directory, the Visual Studio 2010 Tools for Office Runtime considers these Office solutions to be trusted and does not show the ClickOnce trust prompt. source msdn