How to prevent non admin user from disableing the Outlook 2007Addi

K

kapilg

As per the MSDN documentation,With the Office 2007 system ,office Addins are
registered under HKCU and not under HKLM. I have an Outlook 2007 addin which
is also registered under HKCU. but the problem is that, even non admin users
can also disable the addin since it is in HKCU while with Outlook2003 addin,
this was not possible because i got it registered in HKLM.
but I also see some of the Outlook 2007 addins that are registered under
HKLM like Microsoft VBA for Outlook Addin , Microsoft outlook Mobile service
and when a non admin user tries to disable it , outlook displays a pop up
message saying that these addins are registered in HKLM and user does not
have the permission to disable it. So How can I register my Outlook 2007
addin under HKLM like these?
 
K

Ken Slovak - [MVP - Outlook]

Just set the registration to go to HKLM instead of to HKCU. I often do that,
it's especially important for installations under Vista. There's no problem
in doing that.
 
R

Richard Gran

Just to add what Ken said for Vista users, if you plan to register it on
the HKLM, you need to have an admin rights or elevate the program that
will be registering the Add-in to the HKLM or else you will encounter
access denied issue.

Cheers,
Richard
 
K

Ken Slovak - [MVP - Outlook]

Correct. But I've found that works the best under Vista since installation
of anything in the GAC requires admin permissions anyway and almost all of
my addin installers need elevated permissions anyway, so installing for all
users under HKLM ends up working out best.
 
K

kapilg

when I register these Add-in under HKLM, theseAdd-ins are ignored by outlook
and it does not load.
 
K

Ken Slovak - [MVP - Outlook]

What kind of addin is this? Is it managed code? If so is it a shared addin
or a VSTO addin?

For VSTO addins you have to handle things in a special way. For VSTO see the
3 part article by Misha Shneerson of the VSTO team, starting at
http://blogs.msdn.com/mshneer/archive/2007/09/04/deploying-your-vsto-add-in-to-all-users-part-i.aspx

Otherwise if it's a shared addin there should be no problems with it being
registered in HKLM. I have quite a few addins registered in HKLM that work
just fine in Outlook 2007 that were written using C#, VB.NET and VB6.

If you select the addin in the Trust Center what is the message about it? Is
it listed there as an active, inactive or disabled addin?
 
K

kapilg

This is a VSTO addin built using VS2008 and VSTO2005SE.
What Misha has explained in the articles is that Howto install the addin for
all the users on office 2007 machine.
When I select this add in in trust center, I can uncheck the check box so
the next time i start Outlook, this addin is not loaded. it is does not show
any message as it is disabled or inactive.

~Kapil
 
K

Ken Slovak - [MVP - Outlook]

Isn't that exactly what you asked for? If you install for all users, in
HKLM, that's exactly what you asked for and what's explained in those blog
posts.

Obviously if you disable the addin it won't run, what's surprising about
that?
 
K

kapilg

sorry for not explaining it properly-
the problem is not with the installation. this Outlook 2007 addin gets
installed for all the users. MSI registers it in every user's HKCU. This Add
in can not be registered in HKLM.If I register it in HKLM, this Addin will
not be loaded.
Now since this is registered in HKCU for each user , that user, being a non
admin on his/her machine, can manipulate the registry entries to disable it
which is not the case if this could be registered under HKLM coz non admin
users don't have access to HKLM.
Hope I make some sense now.
 
K

Ken Slovak - [MVP - Outlook]

That makes more sense, but why on earth are you registering the addin in
every possible HKCU hive on that machine's registry? Just register it once
in HKLM, following the information in that series of blog posts?
 
K

kapilg

I am registering the Add in in every users HKCU because Microsoft has made a
change in Office 2007 and outlook 2007 VSTO addin can not be registered in
HKLM. These can only be registered in HKCU. If I register it in HKLM, this
add in is ignored and not loaded.
 
R

Richard Gran

That's impossible. You're probably doing something wrong. I can register
our add-in both to HKCU and HKLM hives depending on what the user has
selected during installation.

Cheers,
Richard
 
K

Ken Slovak - [MVP - Outlook]

If you read that blog post just a little further down you'll see the
solution to that which Misha proposed. You use the propagation mechanism
from HKLM to HKCU, but you start with the registration in HKLM.
 

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