Word add-in - install "everyone" vs "just me"

D

David Thielen

Hello;

Sorry for the wide distribution but I am stuck on these 4 items and
have googled and searched msdn and microsoft.com - all to no avail.

This is for a Word add-in written in C# and using the
IDTExtensibility2 approach (ie not VSTO).

When I created my add-in, I selected the check box install for
everyone. The setup program Visual Studio then created gives the user
the option to install the add-in for "everyone" or for "just me." And
this is how I want it to work - that the user can decide if the add-in
is for everyone or just them.

When I run the install, if I select "just me" it installs fine and
runs fine.

If I select "everyone" it installs fine but when I run Word it is not
there (even if I reboot after installing). I then go to COM Add-ins...
and explicitly select the COM shim dll and add it - and after that the
dialog still lists no add-ins. So it silently refuses to add it.

A developer inthe Word group told me "the setup registers the add-in
per-machine (which partly explains the problem in (1) below) but the
code assumes you’re registered per-user, so your add-in Connect
constructor fails and throws an uncaught exception."

So clearly there is a problem here. But what I have not been able to
find anywhere is:

1) How does the code assume your are registered per user vs. per
machine?

2) How do I set up the code to be able to be registered per user or
per machine (as different users will want this each way).

3) Is there anything else I need to do in setup to make this work
right? I am worried as I am using the setup Visual Studio created and
it allows the option on install - which apparently is wrong.

thanks - dave
 
M

Mike Walker

Hi David,

Com Addin's register as COM Components but also register in the registry for
Office to be able to initialise the components the location of this registry
is what is likely to be at fault ;

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\Word\Addins\comshimdll.Connect
would be used for Machine registration
HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\Word\Addins\comshimdll.Connect
would be used for User registration

both are presuming the COMClass is comshimdll.Connect is also registered,
some com addin shim samples are written to register to the User registry
only and hence only work on the registration of the DLL in this position.
Another area which will be what u have expierienced is that the ComAddins
section in the Office application will not list when it is registered in the
Local Machine registry key area.

I hope this points u in the right direction.

Mike Walker
MVP Visual Developer VSTO
(Please Reply via NG)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top