When - and why - should you store data in the Windows Registry?

后端 未结 14 2561
礼貌的吻别
礼貌的吻别 2020-12-02 05:28

As a developer, tools that store configuration/options in the registry are the bane of my life. I can\'t easily track changes to those options, can\'t easily port them from

相关标签:
14条回答
  • 2020-12-02 06:21
    • Originally (WIN3) configuration was stored in the WIN.INI file in the windows directory.
    • Problem: WIN.INI grew too big.
    • Solution (Win31): individual INI files in the same directory as the program.
    • Problem: That program may be installed on a network and shared by many people.
    • Solution(Win311): individual INI files in the user's Window directory.
    • Problem: Many people may share a windows folder, and it should be read-only anyway.
    • Solution (Win95): Registry with separate sections for each user.
    • Problem: Registry grew too big.
    • Solution (WinXP): Large blocks of individual data moved to user's own Application Data folder.
    • Problem: Good for large amounts of data, but rather complex for small amounts.
    • Solution (.NET): small amounts of fixed, read-only data stored in .config (Xml) files in same folder as application, with API to read it. (Read/write or user specific data stays in registry)
    0 讨论(0)
  • 2020-12-02 06:27

    Personally I have used the registry to store install paths for use by the (un)install scripts. I'm not sure if this is the only possible option, but seemed like a sensible solution. This was for an app that was solely in use on Windows of course.

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