none
Question on setting condition property for registry keys based on ALLUSERS property. RRS feed

  • Question

  • Hi,

    I creating a MSI package using the Setup project. I have to add registry entries based on users' chosen "Everyone" or "Just Me" options. So, for all the entries that I need to create for all users, I set the "Condition" property for all the keys to "ALLUSERS=2". However, when I run the installer and select "Just Me" it still creates these entries. In addition I have tried to set the condition from the root key to all sub-keys and still copies all.Could you tell me where I might be doing it wrong.

    Thank you,

    Rajat

    • Moved by Mike Dos Zhang Monday, May 2, 2011 10:21 AM vsto deployment question (From:ClickOnce and Setup & Deployment Projects)
    Thursday, April 28, 2011 5:18 PM

All replies

  • Just put your registry entries in the "User/Machine Hive" in the IDE and that will happen automatically.
    Phil Wilson
    Thursday, April 28, 2011 6:53 PM
  • Phil,

    Thanks for your reply. This is little complicated but i will try to explain. The setup project is for VSTO 3.0 targeted to Office 2007 solution. This version of VSTO does not allow writing registry key to HKLM so I'm using the Misha Shneerson's workaround,
    http://blogs.msdn.com/b/mshneer/archive/2007/09/05/deploying-your-vsto-add-in-to-all-users-part-ii.aspx to propagate the registry key into the HKLM. However, I do not need to do this for Office 2010. So, I cannot move the registries to the "User/Machine Hive". Therefore, I'm trying to find a way to stop this registry entry from getting created if a user selects the "Just Me" option and the only way i can think of is to use the condition property to check the "ALLUSERS" property value. But this does not seem to work.

    Rajat

     

    Thursday, April 28, 2011 7:44 PM
  • Hi rbshrestha,

    For the VSTO application deployment question, you need to post it in the VSTO forum, the experts here have more experiences on this topic, so I moved the thread here.

     

    Best wishes,


    Mike [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, May 2, 2011 10:23 AM
  • Mike,

    Thanks for your reply. I think this is a general Setup project question more than VSTO because all I'm trying to find out is how to use the "Condition" property to check the value of "ALLUSERS" and based on the value create the registry entry or not.

    Rajat

     

     

    Monday, May 2, 2011 2:24 PM
  • ALLUSERS=1 should be true for an Everyone install. Use NOT (ALLUSERS=1) for the Just me because I think I've  ALLUSERS be empty for that case.
    Phil Wilson
    Monday, May 2, 2011 4:47 PM
  • Phil,

    I tried that but it still creates the Hive even if i selected "Just Me".

    Any help will be appreciated.

    Rajat

     

     

    Tuesday, May 3, 2011 3:10 PM
  • You'll need to explain that a little more. I don't understand what you mean by "creates the Hive", and without seeing the code or the exact conditions I can't really help.
    Phil Wilson
    Thursday, May 5, 2011 5:22 PM
  • Hey Rajat,

    I know exactly what you're doing because I've done it and been down that path. One thing you should look at is the EnableLocalMachineVSTO key as documented here:
    http://support.microsoft.com/kb/976811

    I ended up stumbling upon the key when investigating an issue we were encountering and it does away with the need to perform the AddIn propogation scheme that Misha suggests.

    I'm accessing the All Users selection and doing the check like this:

    if (this.Context.Parameters["ISALLUSERS"].Equals("1"))
    {
      MessageBox.Show("All Users!");
      //...
    }
    

    Hope this helps!

    Casey

    • Proposed as answer by CaseyMargell Monday, May 9, 2011 4:36 PM
    Thursday, May 5, 2011 6:35 PM