Where to store program settings instead of HKEY_LOCAL_MACHINE?

后端 未结 10 1787
星月不相逢
星月不相逢 2020-12-05 01:19

I have some program settings that are currently stored in HKEY_LOCAL_MACHINE. Due to Vista and locked down users, some users don\'t have permission to HKEY_LOCAL_MACHINE, an

相关标签:
10条回答
  • 2020-12-05 02:05

    Might be some good place in the registry to put them I don't know about, but why not just add an ini-file in C:\Documents and Settings\All Users\Application Data\yourApp

    0 讨论(0)
  • 2020-12-05 02:09

    What @uli said, with one exception.

    Settings that never change or should only be changed by an administrator can --should, even-- be kept in the same folder as the application to help prevent tampering.

    Connection info for a database sounds like the kind of thing that shouldn't be changed without administrator intervention. Therefore in this case your application's folder might be okay.

    0 讨论(0)
  • 2020-12-05 02:11

    Can you make a .msi file that can be used to push the registry settings out through group policy?

    0 讨论(0)
  • 2020-12-05 02:13

    There's always old fashioned INI files. They are more portable that registry settings. Another option would be an XML file.

    Don't store them in the Program Files directory though - Vista won't like that.

    0 讨论(0)
提交回复
热议问题