Office add-in with user rights

1000 Views Asked by At

I'm developping an Office Add-in for Excel using Visual Studio 2015 and C#. This add-in was for administrators user only and it was working fine. I recently changed this behavior and a regular user (without admin rights) can now install the add-in.

Using InstallShield Limited Edition I changed the properties:

  • ALLUSERS from '1' to ''
  • Require Administrative Privilege from 'Yes' to 'No'
  • InstallDirectory from 'ProgramFilesFolder' to 'AppDataFolder'

At Excel startup the users have now a dialog asking to install the add-in. The dialog the users receive looks like the one here: Unknown Publisher

  • Why is the add-in not installed yet?

Despite the fact that the add-in should be installed by my EXE file, in this dialog the add-in is not signed however the EXE is signed.

Should I sign the VSTO file? I tried with signTool and cannot do it. Is that even possible?

2

There are 2 best solutions below

4
Fabrice T On

You should try this:

  • Put your VSTO in a trusted folder

  • Did you try to sign your VSTO in VS ? Solution Explorer -> Property -> Signing

I faced that issue since a year, I understood that some paths are trusted some not.

For example ProgramFilesFolder is always trusted, I am not believing the same for AppDataFolder

In my situation I moved to AllUser.

Another advanced solution would be to think about WIX Toolset, you will have full control over the deployment

0
GuillaumeDSL On

I finally found the answer to my own question...

Here is the link that helped me: http://amolpandey.com/2012/10/07/lets-deploy-vsto-deployment-via-regedit/ Many thanks to Amol Pandey for his tutorial.

If the link is not working in the future the idea is to update the registry and especially the registry keys which I didn't need before:

  • HKEY_CURRENT_USER\Software\Microsoft\VSTO\Security\Inclusion
  • HKEY_CURRENT_USER\Software\Microsoft\VSTO\SolutionMetadata