none
Installing plain-COM addins without administrative privileges RRS feed

  • Question

  • Hi all.

    I'm trying to find a way to install a Office add-in WITHOUT requiring administrative privileges.

    If I understand correctly, while a Clickonce deployment of a VSTO addin does not require administrative privileges in itself, it is mandatory to install the VSTO runtime, which requires such privileges. This fact is also confirmed here [http://social.msdn.microsoft.com/forums/en-us/vsto/thread/80BCBC0C-3356-4CC6-B638-E7C2C9844A66].

    So, I'm trying to understand if a plain unmanaged COM add-in would allow such an install. If I understand correctly, the installation process in composed of two steps:

    1. Registering the DLL (i.e. using regsvr32.exe)

    2. Adding the registry keys under HKEY_CURRENT_USER\Software\Microsoft\Office\Excel\Addins to allow Excel to find the addin.

    While step 2 seems straightforward, as HKCU is user-writable, I can not really get step 1. It seems that using regsvr32.exe does not work as non-admin user, probably because regsvr32 tries to write to HKCR registry section, which is reserved to admin users. Some folks claim that it is possible to perform a "per-user" dll registration, but I can not find a detailed procedure to do it. Additionally, it is not clear to me how these issues relate to Vista/Seven UAC functionality.

    I also found the Registration-free COM functionality, but this [http://msdn.microsoft.com/en-ca/magazine/cc188708.aspx] article says that such a technique can not be applied to Office addins.

    I wonder if someone can confirm if there is any hope to perform non-admin install.

    B.R., Martino.
    Thursday, January 3, 2013 4:35 PM

Answers

  • Hello Martino,

    I confirm that it is possible to install an Office add-in with standard user privileges: Add-in Express for Office and .NET as well as Add-in Express for Office and VCL (native-code Delphi) allow creating such add-ins. Obviously, for a .NET-based add-in, administrative permissions will be required if .NET Framework is not installed. If you need to install the add-in on a PC with no .NET, then you need to use a native-code solution.

    Regsvr32 invokes some functions in an unmanaged DLL: these functions could create all registry entries including HKEY_CURRENT_USER\Software\Microsoft\Office\Excel\Addins\{your add-in}. Please find more info at http://support.microsoft.com/kb/207132. You may also want to look into the source code of COM Shim Wizard, see http://blogs.msdn.com/b/mshneer/archive/2010/03/19/com-shim-wizards-for-vs-2010.aspx.


    Regards from Belarus (GMT + 3),

    Andrei Smolin
    Add-in Express Team Leader

    Please mark answers and useful posts to help other developers use the forums efficiently.

    Friday, January 4, 2013 9:58 PM
  • > Another question: can you confirm me that VSTO runtime must be installed with admin privileges?

    Sorry, I cannot. I assume this requires administrative permissions because it seems VSTO Runtime is a per-machine thing and not a per-user one.


    Regards from Belarus (GMT + 3),

    Andrei Smolin
    Add-in Express Team Leader

    Please mark answers and useful posts to help other developers use the forums efficiently.

    Tuesday, January 8, 2013 1:20 PM

All replies

  • Hello Martino,

    I confirm that it is possible to install an Office add-in with standard user privileges: Add-in Express for Office and .NET as well as Add-in Express for Office and VCL (native-code Delphi) allow creating such add-ins. Obviously, for a .NET-based add-in, administrative permissions will be required if .NET Framework is not installed. If you need to install the add-in on a PC with no .NET, then you need to use a native-code solution.

    Regsvr32 invokes some functions in an unmanaged DLL: these functions could create all registry entries including HKEY_CURRENT_USER\Software\Microsoft\Office\Excel\Addins\{your add-in}. Please find more info at http://support.microsoft.com/kb/207132. You may also want to look into the source code of COM Shim Wizard, see http://blogs.msdn.com/b/mshneer/archive/2010/03/19/com-shim-wizards-for-vs-2010.aspx.


    Regards from Belarus (GMT + 3),

    Andrei Smolin
    Add-in Express Team Leader

    Please mark answers and useful posts to help other developers use the forums efficiently.

    Friday, January 4, 2013 9:58 PM
  • Thank you Andrei.

    I'm going to read the docs you provided me, as probably a native code solution could fit my needs. On this topic, I found a large number of books dealing with VSTO programming, but almost nothing on plain-COM solutions (till now, only a single chapter in Bovey et al., Professional Excel Development, second edition).

    Another question: can you confirm me that VSTO runtime must be installed with admin privileges?

    Sunday, January 6, 2013 9:42 AM
  • > Another question: can you confirm me that VSTO runtime must be installed with admin privileges?

    Sorry, I cannot. I assume this requires administrative permissions because it seems VSTO Runtime is a per-machine thing and not a per-user one.


    Regards from Belarus (GMT + 3),

    Andrei Smolin
    Add-in Express Team Leader

    Please mark answers and useful posts to help other developers use the forums efficiently.

    Tuesday, January 8, 2013 1:20 PM