none
I have a typical requirement, I have a installation that an addin installed in all users need to be deactiavted by a single user RRS feed

  • Question

    1. I have a typical requirement, I have a instllation that  makes the installation in the HKLM for all users.
    2. The requiremnt is  if there is a user logged in , and  disbales OUtlook addin it should disable in for the specific user and not all users.

    Can it  be done?

    regards

    Amarnath Panda



    Saturday, March 17, 2012 12:09 PM

Answers

  • Hi Armanath,

    why not modify your AddIn and check for a specific Registry-Value in HKCU in the AddIn Startup code.

    e.g. REG DWORD AddInEnabled 0/1.
    When the Key is there and set to zero, just don't execute the AddIn-Startup code.

    Make sure there are no NullRef-Exceptions on AddIn Shutdown code.

    This is a simple solution I think.

    You can set the Additional Key for a specific user if you like.

    Greets - Helmut


    Helmut Obertanner [http://www.obertanner.de] [http://www.outlooksharp.de]


    Monday, March 26, 2012 6:33 AM
    Answerer

All replies

  • Hi Amarnath,

    Thanks for posting in the MSDN Forum.

    You need create the same registry hive entry in the HKCU and set the load LoadBehavior to 2. HKCU's registry hive will have higher priority then HKLM. And the hive can exist in HKLM & in HKCU at the same time.

    I hope it can help you.

    Have a good day,

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us

    Monday, March 19, 2012 3:56 AM
    Moderator
  • i would surely try that thank you. but is there any event pertaining to Disbaling of the Addin?
    Tuesday, March 20, 2012 5:20 AM
  • Hi Amarnath,

    What's mean of "but is there any event pertaining to Disbaling of the Addin?"? Where is the event from? Host application?

    Have a good day,

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us

    Wednesday, March 21, 2012 6:44 AM
    Moderator
  • i mean is there a Event fired at the time when user diables the addin sometihing like ThisAddin_Deactivate() , so that i can trap the event.

    Wednesday, March 21, 2012 8:34 AM
  • Hi Amarnath,

    I think the ThisAddIn_Shutdown method is what you want if I caught your mean. And I never see the ThisAddin_Deactivate method in Add-in project.

    Have a good day,

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us

    Thursday, March 22, 2012 6:19 AM
    Moderator
  • in general you cannot depend on some event to fire if user will disable your add-in, it can be done in registry or during startup of office app, if your add-in crashed last time and in such situations there will be no notifications.
    Thursday, March 22, 2012 9:07 AM
  • If this is for Outlook 2010, unless a registry key is set the ThisAddin_Shutdown() event won't fire. See http://blogs.msdn.com/b/rgregg/archive/2009/10/02/additional-shutdown-changes-for-outlook-2010-beta.aspx

    --
    Ken Slovak
    MVP - Outlook
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
     
     
    "Tom_Xu MSFT" <=?utf-8?B?VG9tX1h1IE1TRlQ=?=> wrote in message news:f2fd2f60-ce96-4dd9-b573-d7ab9c7c4dfe...

    Hi Amarnath,

    I think the ThisAddIn_Shutdown method is what you want if I caught your mean. And I never see the ThisAddin_Deactivate method in Add-in project.

    Have a good day,

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us


    Ken Slovak MVP - Outlook
    Thursday, March 22, 2012 1:25 PM
  • HI tom ,

    I tried putting the additioanl entries at the HKCU for my addin, So as suggested by you iit is in both the places with HCKU addin name

    LoadBehavior to 2 but the addin is still active .So it is picking up the value from HKLM. I did restart outlook after changing the values.

    Monday, March 26, 2012 6:19 AM
  • Hi Armanath,

    why not modify your AddIn and check for a specific Registry-Value in HKCU in the AddIn Startup code.

    e.g. REG DWORD AddInEnabled 0/1.
    When the Key is there and set to zero, just don't execute the AddIn-Startup code.

    Make sure there are no NullRef-Exceptions on AddIn Shutdown code.

    This is a simple solution I think.

    You can set the Additional Key for a specific user if you like.

    Greets - Helmut


    Helmut Obertanner [http://www.obertanner.de] [http://www.outlooksharp.de]


    Monday, March 26, 2012 6:33 AM
    Answerer
  • yes helmut that would be a last resort . i jus wanted to check with defaultoutlook behaviour given this sceario.

    Monday, March 26, 2012 7:28 AM