locked
HKLM VS HKCU RRS feed

  • Question

  • I am in the process of reviewing our VS2008 Isolated shell based application installation for various OS like XP, Vista, Win7 and for 32 and 64 bit sytems. we use installshield 2008 . One of the thing I noticed about registry in some places we used HKLM and some cases it is HKCU. I also noticed that Visual Studio itself has the registry settings in both of these places. Do we have any documentatation on which registry we should be using HKLM or HKCU? Is there any standard as far as the installation of VS2008 isoalated shell based Application? I remember something about VS2008 isolated shell based app. transfer the reg settings from HKLM to HKCU on /setup or on startup! Any help is appreciated

    Thanks,

    AG

    AG

    Monday, April 11, 2011 8:37 PM

Answers

  • HKLM is for all users, HKCU is for the current user. Installing to HKLM would be kind of obnoxious as it would effect every user on the machine with VS installed, so in general you should be writing to HKCU.

    Ryan

    • Marked as answer by AAG Tuesday, April 12, 2011 3:55 PM
    Tuesday, April 12, 2011 3:53 PM

All replies

  • HKLM requires administrator permissions to write to on Vista+.  HKLM is machine settings (for all users), HKCU is per user.  VS does mirror HKLM settings into an HKCU configuration key and redirect registry reads at run-time from HKLM -> HKCU to allow it to run even without admin privileges.

    Ryan

    Monday, April 11, 2011 11:21 PM
  • This does not answer my question. For example in my case the addins path is application folder\addins and not the VS recommended path which is Mydocuments...then which registry I will have to set <HKLM or HKCU>\SOFTWARE\Microsoft\VisualStudio\9.0\AutomationOptions\LookInFolders. If I go with HKLM then I need to find out 32 bit VS 64 for Wow64node and if I go with HKCU then its does not matter between 32 and 64. So the question is what is recommended ? or is there better way for these kind of custom cahnges?

    AG

    Tuesday, April 12, 2011 2:23 PM
  • HKLM is for all users, HKCU is for the current user. Installing to HKLM would be kind of obnoxious as it would effect every user on the machine with VS installed, so in general you should be writing to HKCU.

    Ryan

    • Marked as answer by AAG Tuesday, April 12, 2011 3:55 PM
    Tuesday, April 12, 2011 3:53 PM
  • Sorry for responding to such an old topic, but I have a similar question and haven't found anywhere else.

    I have a to make a reg change for Outlook that goes into HKCU.  I'm working with a terminal services environment and would like to make this change for all current users AND have it automatically apply for any new users.

    In this case, would putting this reg key into HKLM accomplish this?

    Thank you

    Monday, March 25, 2013 6:07 PM
  • Outlook and VS are different apps, so a response on how VS behaves may not apply to Outlook.

    If Outlook is looking for your specific setting only in HKCU then the answer depends on whether Outlook creates the default HKCU key by copying the HKLM key. If so then changes would show up for NEW users created AFTER the change, existing users would likely not be updated.

    If Outlook first checks HKLM and then falls back to HKCU then a change to HKLM should work.

    You can use ProcessExplorer from SysInternals to watch Outlook's registry queries and see if it probes HKLM in your sceanrio.

    Monday, March 25, 2013 6:53 PM
  • great - thanks Ryan
    Monday, March 25, 2013 7:03 PM