Is it possible that deploy COM Add-In and XLL for all users via Install only once.

Add-in Express™ Support Service
That's what is more important than anything else

Is it possible that deploy COM Add-In and XLL for all users via Install only once.
 
Takahiro Hyakuno




Posts: 6
Joined: 2010-09-07
Hi

I created a ADX COM Add-in Project and added XLL Add-in Module.
I'm using "Add-in Express 2010 for Microsoft Office and .NET, Professional" and VS2008 Pro.

I want to deploy them for all Users on a PC via Install only once by Administrator.

I did the following.
- I set the RegisterForAllUsers Flag of the Com Addin on true.
- I set "privileges" of adxloader.dll.manifest to "administrator".
- I set Arguments of install custom action to "/install="MyAddin.dll" /privileges=administrator""

Finally I installed it to a PC with WinXP and Office2007 as the Administrator.

Although both of COM Add-in and XLL do work by a user installed, XLL doesn't work by different users on the same PC.
Is it possible that both of them do work for all users(include normal user) on the same PC?

I would like to know whether we can solve this problem by installer ,custom action or any others.
( ex. we can call regsvr32.exe while we install and so on...)


If you have any questions about this inquiry, don't hesitate to contact me.
Thank you for your cooperation.

I am looking forward to hearing from you soon.

P.S. Do you have any staff can read/write Japanese?
I would appreciate if I can contact the staff because I am not good at English well.
Posted 07 Sep, 2010 11:59:50 Top
Eugene Astafiev


Add-in Express team


Posts: 8540
Joined: 2007-07-25
Hi Takahiro,

FYI Registering an XLL add-in creates a value in the following key:

HKCU\Software\Microsoft\Office\{version}.0\Excel\Options.

The value name is OPEN or OPEN{n} where n is 1, if another Excel add-in is registerd, 2 - if there are two other Excel add-ins registered, etc. The value contains a string which is constructed in the following way:
str = "/R " + "" + pathToTheDll + ""

Is it possible that both of them do work for all users(include normal user) on the same PC?


No, it isn't. Note that Excel add-ins can be registered on the per-user basis only. In other words, if a COM add-in has RegisterForAllUsers=True in the properties of its add-in module, then the combination of the COM add-in and an Excel add-in will register the Excel add-in for the only user, the user running the installer.

BTW Unfortunately none of us speaks Japanese.
.NET, Extended MAPI, Windows Phone & RT
Posted 07 Sep, 2010 12:19:34 Top
Takahiro Hyakuno




Posts: 6
Joined: 2010-09-07
Hi Eugene.

Thank you for your early reply!
I can understand your answer.

After all, I try the following instead of install by per-users.



Private Sub AddinModule_AddinStartupComplete(ByVal sender As Object, ByVal e As System.EventArgs) _
Handles Me.AddinStartupComplete
Me.ExcelApp.AddIns.Add({fullpath of adxloader.MyXLL.dll}).Installed = True
End Sub


I think this code may work, because COM add-in works for All users.


another topics in this forum was help for me.
Topic «Excel UDFs not appearing, XLL not loading, no errors reported»


Thanks.
Posted 08 Sep, 2010 11:58:47 Top
Eugene Astafiev


Add-in Express team


Posts: 8540
Joined: 2007-07-25
Hi Takahiro,

I think you can try using that code and then please let me know whether it works for you. Note, that an XLL add-in will not be uninstalled with your COM add-in in that case. You need to uninstall it manually. Also there may be a lot of various pitfalls.
.NET, Extended MAPI, Windows Phone & RT
Posted 08 Sep, 2010 12:29:22 Top
Henri Pellemans




Posts: 84
Joined: 2010-05-06
Eugene Astafiev wrote:
FYI Registering an XLL add-in creates a value in the following key:

HKCU\Software\Microsoft\Office\{version}.0\Excel\Options.


I am also looking for a solution to install an ADX XLL add-in for all users.

I found an [old] article at MSFT and I copied most of it below.

Hi Eugene, could you have a look at this article and find out if the workaround also works for ADX XLLs? Thanks you.


=============================
MSFT article August 30, 2004:

Office COM Add-ins register themselves for a particular Office application when performing COM registration (that is, when the DllRegisterServer function is called from Regsvr32.exe or a setup package). The add-in uses either the HKEY_CURRENT_USER or the HKEY_LOCAL_MACHINE registry hive to determine whether it should be treated as a per-user add-in or a system add-in, respectively.

Add-ins that are registered under HKEY_CURRENT_USER apply to that user only, and can be enabled and disabled on a user-by-user basis. Add-ins that are registered under HKEY_LOCAL_MACHINE are global to the system and load for all instances of that application. However, they do not appear in the application's COM Add-Ins dialog box, and they cannot be turned on or off for particular users.

The VB Add-in Designer is written to build per-user add-ins. If you need to make a system add-in or you want to make a more robust per-user add-in, you can use the additional registry data section of the designer object to specify a custom registration path for your add-in.

For additional information about building Office COM Add-Ins by using the Designer, and on the meaning of the registry values, click the following article number to view the article in the Microsoft Knowledge Base:
238228 (http://support.microsoft.com/kb/238228/ ) How to build an Office 2000 COM Add-In in Visual Basic

The examples below assume that you are using the designer add-in example that is given in the article that is listed above. However, you can apply these techniques to any COM Add-in project.

Registering a COM Add-In as a System Add-In

To register the add-in as a system add-in, you need to duplicate the registration under the HKEY_LOCAL_MACHINE path for the application for which the add-in is written. In the add-in example this is Microsoft Excel, but this works for other Office applications as well.

To use this workaround you need to know the ProgID for the connection object that your dynamic-link library (DLL) exports so that you can specify it in the registry key name. In the example, MyAddin.Connect is the default name for the DLL project and designer object, but if you change these values in your project, you need to change them in the registry key name as well.

In VB, create an Excel COM Add-In project.

In the Designer window, click the Advanced tab and add this key path for the Registry Key for Additional Addin Data section:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\Excel\Addins\MyAddin.Connect

Click New Value and add a new DWORD value. Name it LoadBehavior and set the value to 3.

Compile and run the add-in. When it is registered, the add-in loads for all users as a system add-in.
Posted 03 Oct, 2010 08:22:27 Top
Andrei Smolin


Add-in Express team


Posts: 9381
Joined: 2006-05-11
Hi Henri Pellemans,

Henri Pellemans wrote:
Hi Eugene, could you have a look at this article and find out if the workaround also works for ADX XLLs?


The article demonstrates how to register with HKLM an add-in that registers with HKCU, not vice versa. The problem is: all users on the PC access the same instance of HKLM while personal settings for each of them are stored in the personal instance of HKCU. Looking at this abstractly, there are only two possibilities to register an add-in for all users: A) to register the add-in with HKLM and B) to register with all instances of HKCU. COM add-ins support option A while Excel add-ins don't. That is, the only way to register an Excel add-in for all users is to create appropriate keys/values in every HKCU on that PC. You can try doing this in the code of your COM add-in. But while a per-machine COM add-in may register an Excel add-in (in the corresponding instance of HKCU) it will not be possible to remove the registration of the Excel add-in while unregistering the COM add-in. Why? Because the COM add-in will be able to access the only HKCU instance, namely, of the user uninstalling the add-in.

Regards from Belarus (GMT+2),

Andrei Smolin
Add-in Express Team Leader
Posted 04 Oct, 2010 02:43:02 Top