Announcement

Collapse
No announcement yet.

Fear and loathing of the Windows Registry

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Fear and loathing of the Windows Registry

    Splitting this out so as not to overrun the other topic with an unrelated discussion...

    Originally posted by ScratchMonkey View Post
    But tell us how you really feel. :D
    If it weren't for games I'd be rid of this pox on my machine. ;)


    The registry is a bit fragile for what it does, but the intent is good: A central database where programs can store their configuration.
    This is good and bad. I don't dispute that a location to store global settings for programs. I do question why it has to be a proprietary format instead of a simple directory on the file system. Unix-like OSes have been getting by with /etc long before there was even a DOS, let alone a Windows. Oddly enough I have none of the registry related problems with /etc.

    The problem, however, is that too many programs store too much configuration in the registry and don't do the sensible thing of "Gee, George, I'm running here, let's look here!" I've had games lose save files because the registry harfed on itself. I could see the file on the file system but because there wasn't a registry entry for it the game simply would not load that save file. Same goes for applications. Registry harfs on itself and it can't just look locally and notice "Yup, all here" and just rebuild the required Registry entries.

    It's no worse than programs storing all their configuration on the same hard drive.
    It is worse because there is one and only one way to properly access the registry. That's Microsoft's own API. That does not inspire confidence because their own tools which are not feature complete with one another! At least with information on the file system I can get in there with other tools, sensibly back up portions with a simple copy, make reasonable edits and do so without having to deal with a single-source API. It is entirely possible; wine does it!

    WoW does use the registry to remember the installation location for other programs that will perform upgrades. I had to run the launcher when patch 3.2 came out to refresh the registry entry with my relocated directory, so that the patch could figure out where I'd put it.
    Which I never noticed since I don't start directly from the client. Even so in the vast majority of cases patching starts with the launcher. But I agree, for those who don't that is a critical oversight on Blizzard's part.

    Many programs with license keys (such as the BF series) store the key in the registry. I believe the last time I moved a BF game to another computer (and drive letter) I just had to re-enter the license to be able to play. (I've also exported the relevant key from the old registry and imported it into the new.)
    I haven't gotten around to doing that. However, and this is my main beef with the registry vs. on-disc files ala /etc, I don't have the option of exporting the registry key. My XP registry still exists in Windows.old but it is absolutely useless because I cannot get at it without Microsoft's API. All those neato cool Registry tools floating around all go through that API. None of them touch the Registry directly. This is a problem when I have a Registry file over yonder which is not in use. Can't look at it, can't get data from it, it is just a huge, useless file at this point.

    Contrast that to my old Dell CPx laptop that went through several reinstalls of KUbuntu, XUbuntu and Debian. I have every single /etc backed up on my server going back 3 iterations. My server, in turn, has the /etc from it's previous install in case I needed it. My leased machine has gone through 3-4 real and VMs at as many companies. In each case I pulled /etc over from the old machine to the new and was able to get my net presence up and running within an hour. I could do that because I could selectively copy portions of the configuration that I needed without having to be actively using said configuration.

    WoW's big crime is that it's not multi-user aware, so it stores volatile data (eg. its WTF directory) in its common directory instead of the user's home directory (Documents and Settings for XP, Users for Vista, /home were there a Linux version).
    Granted. Having per-user configuration also allows the user to move between machines fairly easily. For example this post is written on my new Mini 10v running Ubuntu. I just pulled over configuration files from my server to configure my shell environment just the way I like it. Shell configuration files I've pulled from machine to machine for over a decade. :icon_eek:

    But even that "flaw" is nice. You have to admit that being able to copy the directory to another drive and just run it is a far cry better than some other applications and programs beholden to the Registry. Heck, when I reinstalled my wife's machine I just threw my WoW directory onto the file server, pulled it onto her machine and off it ran. I've even run it on other people's machines from my USB drive when visiting relatives. In that regard it is quite nice. :D

    Vista works around this through a redirection scheme that vectors writes to Program Files to one's profile under Users. If you share a computer with others, this is a Good Thing, because it means each user has her own settings, not clobberable by other users. It means that the game's binaries remain pristine, unaffected by viruses that aren't able to escalate their privileges.
    Uh, no, that's a decidedly bad thing. Vista is forcing data to be written elsewhere. Have a beef with the original developers, sure, but I won't praise the OS from arm-wrestling the applications through what amounts to driver level shenanigans. That is downright appalling. Besides, it isn't like anything WoW writes can contain viruses or clobber the binaries. The binaries are pristine, the data is non-executable. There is nothing wrong with the application handling per-user configuration within its own directory and it most certainly is not up to Big Brother Microsoft to force it to do otherwise. To do so would make simple things, like throwing the game on a USB drive to play while travelling, harder than it should be.
    "...the rules aren't there to enumerate what is always correct but what is always wrong..."

  • #2
    Re: Fear and loathing of the Windows Registry

    I don't think we disagree, for the most part.

    That one needs to use proprietary APIs to touch the registry is horrid. But the concept is nice. Just look at recent versions of Firefox, which switched from text config files to sqlite databases. And you can download tools (including a Firefox plugin) to muck with those files.

    /etc is a mess. Gnome attempted to address it be using a hierarchical database in the user's home directory, but it creates lots of tiny files and hence works best on a filesystem optimized to store such tiny files. ext2/3 isn't such a filesystem. (Although I hear ext4 may be.) ReiserFS was supposed to be good for that, but I guess that's not a viable FS to use anymore.

    Also realize that /etc is for machine configuration, so it's comparable to the HKEY_LOCAL_MACHINE hive. The HKEY_CURRENT_USER hive is more like the dot directories under the user's home directory.

    Being able to drag the WoW directory around on a USB key is certainly nice, but a better way to handle that is to drag two directories, one for the app that's write-protected and one that's all the user-specific state. The tricky part is telling the app part where the user part is. On a fixed system you just look in the home directory, but that doesn't work so well with removable media.

    The Vista hack is a workaround to the fact that Program Files is not writable for regular users. Most people install to the default location, which is under Program Files. (I don't, and have WoW installed under \Games, so it's not subject to that limitation and the workaround hack.)

    Your hives that are "lost" under Windows.old are usable. You can attach the hive to an empty key in your existing recipe, in a manner similar to mounting a drive in Linux. Use the "Load Hive" entry in the File menu. It will create a new key under the USERS or LOCAL_MACHINE hive (your choice) and mount the hive on that key for editing. When done, use Unload Hive to unmount it.

    http://technet.microsoft.com/en-us/l...8WS.10%29.aspx
    Dude, seriously, WHAT handkerchief?

    snooggums' density principal: "The more dense a population, the more dense a population."

    Iliana: "You're a great friend but if we're ever chased by zombies I'm tripping you."

    Comment


    • #3
      Re: Fear and loathing of the Windows Registry

      Originally posted by ScratchMonkey View Post
      I don't think we disagree, for the most part.
      Nope.

      /etc is a mess. Gnome attempted to address it be using a hierarchical database in the user's home directory
      .

      /etc is still a million times better than the Registry. I rather enjoy taking regular snapshots using my favorite DVCS. >.>

      Also realize that /etc is for machine configuration, so it's comparable to the HKEY_LOCAL_MACHINE hive. The HKEY_CURRENT_USER hive is more like the dot directories under the user's home directory.
      I did say it was for global configuration. However I don't draw the comparison between the different portions of the Registry. It is one file, one blob, you lose it you lose it all. There is no "local" in that mess.

      The Vista hack is a workaround to the fact that Program Files is not writable for regular users. Most people install to the default location, which is under Program Files. (I don't, and have WoW installed under \Games, so it's not subject to that limitation and the workaround hack.)
      *eyes his /games directory* Heyyyyyyyy, you sneaking peeks at my machine!?
      "...the rules aren't there to enumerate what is always correct but what is always wrong..."

      Comment


      • #4
        Re: Fear and loathing of the Windows Registry

        Originally posted by ScratchMonkey View Post
        That one needs to use proprietary APIs to touch the registry is horrid. But the concept is nice.
        Doesn't it make sense that something so complex as the system registry would be locked down or only accessed by something Microsoft deems to write/modify the registry appropriately? Why open that up to being played with by just anyone with an idea or concept.?. I can just imagine the issues..
        |TG|ARMA Pathfinder
        ..now where did I put my keys?

        Comment


        • #5
          Re: Fear and loathing of the Windows Registry

          The registry isn't fun but with each iteraton of windows it gets better. And it allows you to do so many wonderful things like tie programs together without having to do cmd-line piping and to be able to double click on something and have the system know what program to use to open it. The problem isn't Microsoft it is the programmers who leave things behind in the registry.

          Comment


          • #6
            Re: Fear and loathing of the Windows Registry

            Originally posted by Greyed View Post
            I did say it was for global configuration. However I don't draw the comparison between the different portions of the Registry. It is one file, one blob, you lose it you lose it all. There is no "local" in that mess.
            Actually, it's several files. I forget the command you use but when you back up the registry, it creates several files, one per hive, in the backup directory.
            Dude, seriously, WHAT handkerchief?

            snooggums' density principal: "The more dense a population, the more dense a population."

            Iliana: "You're a great friend but if we're ever chased by zombies I'm tripping you."

            Comment


            • #7
              Re: Fear and loathing of the Windows Registry

              Originally posted by peardog View Post
              Doesn't it make sense that something so complex as the system registry would be locked down or only accessed by something Microsoft deems to write/modify the registry appropriately? Why open that up to being played with by just anyone with an idea or concept.?. I can just imagine the issues..
              It's not a problem on Linux. You can (with appropriate privileges) edit files in /etc and it doesn't automatically corrupt the system.

              The registry does support the use of Access Control Lists (ACLs) which Linux only partially supports, so in that sense it's easier to create more complex access control, instead of just root versus everyone else.

              Originally posted by deathknight View Post
              The registry [...] allows you to do so many wonderful things like tie programs together without having to do cmd-line piping and to be able to double click on something and have the system know what program to use to open it. The problem isn't Microsoft it is the programmers who leave things behind in the registry.
              "Leaving things behind" isn't always a problem. I can leave my program's config in the registery after removing the program and it's not going to affect other programs. They don't even know to look there. It's only an issue if I go mucking with a shared area, such as the automatic launcher machinery (the "shell commands"). If I leave a hook behind there, the GUI will continue to look for my program after it's deleted.

              What do you mean by "tying programs together"? How is the registry involved in that? Or are you just referring to the launch machinery? The various Linux GUIs also have that mechanism. Each GUI has a database where programs can register to handle actions on their files.
              Dude, seriously, WHAT handkerchief?

              snooggums' density principal: "The more dense a population, the more dense a population."

              Iliana: "You're a great friend but if we're ever chased by zombies I'm tripping you."

              Comment

              Connect

              Collapse

              TeamSpeak 3 Server

              Collapse

              Advertisement

              Collapse

              Twitter Feed

              Collapse

              Working...
              X