Sign in to follow this  

why use register table,I know many big software don't adopt it.

This topic is 4676 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

like warcraft,I just copy installed directory and file ,it just work.

Share this post


Link to post
Share on other sites
Several reasons:
  • It allows you to have a nice uninstaller in the control pannel
  • You can store data in a way that doesn't require you having a settings file
  • It helps prevent people "just copying the directory" to pirate the game (I'm not implying you pirated it)

    Share this post


    Link to post
    Share on other sites
    Quote:
    Original post by Ravuya
    I am not entirely sure what you're asking.
    I'm assuming he's asking "What's the point in using the registry?"

    Share this post


    Link to post
    Share on other sites
    I don't mind programs using the registry, but I REALLY hate it when they don't remove their settings on uninstal. MS should make windows track registry changes, and undo all of them a program has caused when you uninstall that program (or have an option of doing so at least).

    As far as I can tell, the only real bonus to the registry is that you can take the liberty of just picking a place to put it and you always know where it is (ie from updater programs that are not run from the game's directory), so you don't have to ask users stuff like 'where is the settings file?' or 'where is the game installed?'

    As a repository for OS settings, the registry makes sense, but it doesn't really work as a general ini replacement and I hate that everybody is treating it as such.

    Share this post


    Link to post
    Share on other sites
    Quote:
    Original post by Extrarius
    I don't mind programs using the registry, but I REALLY hate it when they don't remove their settings on uninstal. MS should make windows track registry changes, and undo all of them a program has caused when you uninstall that program (or have an option of doing so at least).


    Yes yes YES! Personally, I don't think the registry was a bad idea, but I can't say the same about the implementation. I know some shareware companies wouldn't like it, but they can figure out a new copy protection trick. It would really help to remove the crap that tends to build up in the registry.

    It would be pretty simple to implement too, you could do it similarly to a source control system, just storing deltas.

    Share this post


    Link to post
    Share on other sites
    The original point of the registry, as far as I know, was mostly for administrators. It provides a central place that can be backed up and secured. It's format is more consistent then the randomness seen in config files. It also has a clear way to provide per-user configs which historically Windows didn't have.

    It gets abused and misused like everything else.

    Share this post


    Link to post
    Share on other sites
    Quote:
    Original post by Extrarius
    As a repository for OS settings, the registry makes sense, but it doesn't really work as a general ini replacement and I hate that everybody is treating it as such.


    Unfortunately MS seems to be pushing things that way.

    Quote from MSDN WritePrivateProfileString:
    Quote:
    The WritePrivateProfileString function copies a string into the specified section of an initialization file.

    Note This function is provided only for compatibility with 16-bit versions of Windows. Applications should store initialization information in the registry.


    Further, even if you do use an ini file, it might get moved by Windows into the registry:

    Quote:
    The system maps most .ini file references to the registry, using the mapping defined under the following registry key:

    HKEY_LOCAL_MACHINE
    SOFTWARE
    Microsoft
    Windows NT
    CurrentVersion
    IniFileMapping



    To avoid all of that, you have to stop using the MS-supplied functions and write your own. No big deal, but they hooked developers on the ini functions and then messed them up.

    Share this post


    Link to post
    Share on other sites
    The programs still don't store your data in the registry though, so you still have to hunt down that when you format or something, so just having the settings there would be alot easier -- I've never seen a util for exporting all the registry entries pertaining to a given file.

    The C:\Documents and Settings folder would seem like a logical place for settings to me...

    Share this post


    Link to post
    Share on other sites
    I always dump prefs into a subfolder of %APPDATA%, which is usually C:\Documents and Settings\(username)\Application Data\.

    Please don't be an idiot and write ini files in the same folder as the executable:
    1. Multiple users on the same computer all have one copy of the preferences
    2. Limited user accounts don't have write permission to Program Files, and I/O code is typically not checked for errors
    3. A nonessential datafile doesn't need to be stored alongside the executable anyway

    Share this post


    Link to post
    Share on other sites
    Quote:
    Original post by Anon Mike
    The original point of the registry, as far as I know, was mostly for administrators. It provides a central place that can be backed up and secured. It's format is more consistent then the randomness seen in config files. It also has a clear way to provide per-user configs which historically Windows didn't have.

    It gets abused and misused like everything else.


    That and COM,don't forget COM, or DCOM or COM+ or MTS:), part of the registry desing was so component programmers had a place to register their components to other developers.

    Cheers
    Chris

    Share this post


    Link to post
    Share on other sites
    Quote:
    Original post by chollida1
    That and COM,don't forget COM, or DCOM or COM+ or MTS:), part of the registry desing was so component programmers had a place to register their components to other developers.



    The old farts among us may recall the days of Windows 3.x, when the registry was almost exclusively used for that very data... and when all that mess was just called "OLE."

    Personally I think the registry is a great thing, but it got screwed up in the Win95/98 era. People had two basic choices: INI files or the Registry. The registry thing looked to be the wave of the future, and Microsoft pressured developers into using it, so we did. Unfortunately this has the nasty side effect of cluttering up the registry with application crap that shouldn't be there.

    This problem is fixed in Windows 2000 and later (maybe even NT4 but I don't remember much of NT4 so I can't say for sure). The APPDATA folder is specifically designed to handle that information without compromising the usefulness of the registry. There are also other huge bonuses as antareus mentioned. Unfortunately, 9x got developers into the registry habit, and the APPDATA paradigm goes quietly forgotten. To date the only software I know of that uses that folder is Microsoft products (and of course my own projects, when I have a need to store application specific data).

    In my mind, registry hell is a lot like DLL hell - it's a torment of our own making. Some slightly better design decisions and a little foresight can avoid a lot of these issues.

    Share this post


    Link to post
    Share on other sites
    Lots of things store stuff in application data in lieu of the registry. Firstly, Application Data is more suited to larger files (like caching etc).

    Secondly, it's less system-specific - you're not relying on the OS to have a useable registry.

    Microsoft's own stuff seems to store mostly settings in the registry, and bigger stuff like caches and persistent data, in the "application data" directory.

    Things like Mozilla, stores its entire profile in "Application data" and doesn't use the registry very much.

    I wrote a windows app a while ago, and used "Application data" instead of the registry, just because it seemed easier and cleaner.

    Mark

    Share this post


    Link to post
    Share on other sites
    The problem with APPDATA, or the registry, or any central system is that it indriectly prevents multiple installations of a program unless special steps are taken to allow it (such as having an <AppName> key, with each installation getting a key under it like Inst1, Inst2 and searching for the matching entry on startup). In other cases this can be dealt with using 'user profiles' of some sort, but there are times when entirely seperate installations can be very useful.

    As long as I have a choice, I'll prefer configurations files in the program's directory in my own programs.

    Share this post


    Link to post
    Share on other sites
    Guest Anonymous Poster
    I haven't seen anybody mention the fact that the bigger your registry becomes, the longer it takes to boot up your computer. I noticed this on one of those 'dreaded reinstalls' awhile ago. With the same apps reloaded, but all the old registry crap gone - several noticable seconds were shaved off my boot time. Sold me on the APPDATA path.

    (I don't know if 1: XP has optimized this away [it seems to boot real fast], and 2: if the excess registry crap uses up any system memory.)

    David

    Share this post


    Link to post
    Share on other sites
    Sign in to follow this