The Windows registry

Programming, for all ages and all languages.
Post Reply
Perica
Member
Member
Posts: 454
Joined: Sat Nov 25, 2006 12:50 am

The Windows registry

Post by Perica »

..
Last edited by Perica on Tue Dec 05, 2006 9:36 pm, edited 1 time in total.
User avatar
Colonel Kernel
Member
Member
Posts: 1437
Joined: Tue Oct 17, 2006 6:06 pm
Location: Vancouver, BC, Canada
Contact:

Re:The Windows registry

Post by Colonel Kernel »

It's like a big database with a hierarchy of keys that contain values. These values are configuration information for... everything. Drivers, installed software, user preferences, registered COM objects, etc. It's also a maintenance/administration nightmare and its use is being phased out slowly over time.
Top three reasons why my OS project died:
  1. Too much overtime at work
  2. Got married
  3. My brain got stuck in an infinite loop while trying to design the memory manager
Don't let this happen to you!
AxelDominatoR

Re:The Windows registry

Post by AxelDominatoR »

The Windows' Registry is accurately designed so that over time the computer becomes slower and slower.
So there are two choices:
A) Reinstall
B) Buy a new computer

( installing a different OS is something much more of a rarity :P )

Axel
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:The Windows registry

Post by Solar »

From an OS designer's perspective, the Registry is a place where the OS or its applications can store tidbits of administrative data.

Which application to open for *.txt files.

Where to open the window of application X on startup.

What icon to display for *.doc files.

Which desktop background picture to load.

Every OS needs a place like that. For Linux, it's either /etc or any of the ~/.* files / directories. For Windows, it's the Registry.

And everytime a Linux user has to hunt down which configuration file he has to edit now, the Windows user has to look into the Registry. Which is why it has such a bad rep.

Linux users don't tend to see /etc and ~/.kde and ~/.gnupg and ~/.ssh and ~/.fetchmailrc and ~/.procmailrc and ~/.muttrc and ~/.whateverrc as a "design entity" and continue pointing fingers at the Windows registry while both are simply a bad solution for the same design problem.

Sorry, couldn't resist.
Every good solution is obvious once you've found it.
ark

Re:The Windows registry

Post by ark »

Solar's description is correct. The registry is basically just a place to store configuration data, and no matter what operating system you are using that information has to be stored somewhere.

The biggest flaws of the Windows registry are the apparent inability to document the information where it appears and the tendency to spread related configuration options out across unrelated portions of the registry. Also the fact that it is stored in binary format ain't the greatest thing in the world, either.

By the way, if you're going to use the registry, then you should use it properly. That means options having to do with user preferences go into the user portion of the registry (HKEY_CURRENT_USER) and options having to do with the system go into the system portion of the registry (HKEY_LOCAL_MACHINE).

Specifically, don't write user options to the system registry. If the user is not an administrator, then your program will most likely be denied access to the system portion of the registry, and the fault will be your program's, not the registry's.
ark

Re:The Windows registry

Post by ark »

Also, if you write a program that uses the registry, it should be able to handle the case where a value it expects to find in the registry is not there and revert to an appropriate default.

It should not do as many (poorly written) Windows programs do and refuse to run.
Perica
Member
Member
Posts: 454
Joined: Sat Nov 25, 2006 12:50 am

Re:The Windows registry

Post by Perica »

..
Last edited by Perica on Tue Dec 05, 2006 9:37 pm, edited 1 time in total.
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:The Windows registry

Post by Solar »

Perica wrote:
Solar wrote:Linux users don't tend to see /etc and ~/.kde and ~/.gnupg and ~/.ssh and ~/.fetchmailrc and ~/.procmailrc and ~/.muttrc and ~/.whateverrc as a "design entity" and continue pointing fingers at the Windows registry while both are simply a bad solution for the same design problem.
What do you propose would be a better solution?
One central point where configurations are stored, one global format in which to store them, one global API of functions with which to store them, in a format that allows making a backup without special mojo (i.e., copy / zip / tar / whatever).
Every good solution is obvious once you've found it.
mystran

Re:The Windows registry

Post by mystran »

I guess the alternatives to registry/config-files is an OSDev topic so I'll comment on that in a new thread there.

edit: the thread is here
dh

Re:The Windows registry

Post by dh »

I use the registry for VB programming. In short, it's another patented Microsoft piece of ....... It is kinda usefull for the fact that all sorts of data is located in one place (and thus easy to edit) but this makes it prone to crackers who go in, destroy it and be on their way. While I've never personally heard of this, it is very possible and ms claims it is required for windows to run so it could be a target sooner or later.


Cheers, DH.
mystran

Re:The Windows registry

Post by mystran »

It is definitely needed for windows to run. In fact, Windows is pretty intolerant about problem in register, and the smallest modifications there (when done to the right place) can prevent the whole thing from booting.

IIRC you could even make your "Windows 2003 Server" act as a "Windows XP Profession" and such by toggling a few bits in the register (ofcourse you can't get any missing files this way but..)
dh

Re:The Windows registry

Post by dh »

One can always count on MS to put in some stupid little "feature" in as well.

Aprently there is a small bug in XP home that allows tge user to access XP Pro features. Simply reboot into safe mode and voila. This extra stuff is accessed by right clicking on the my computer icon and looking for a new entry...
Ytinasni

Re:The Windows registry

Post by Ytinasni »

Aprently there is a small bug in XP home that allows tge user to access XP Pro features. Simply reboot into safe mode and voila. This extra stuff is accessed by right clicking on the my computer icon and looking for a new entry...
That 'extra stuff' would be the security tab? It being there in safemode isnt a bug, it's by design.
Also, if you need that functionality, there's a commandline tool (cacls.exe) that does almost all of that, without needing to go into safemode.
dh

Re:The Windows registry

Post by dh »

Nope, not security. I think it's "management" or something along thoes lines.
Schol-R-LEA

Re:The Windows registry

Post by Schol-R-LEA »

AxelDominatoR wrote: The Windows' Registry is accurately designed so that over time the computer becomes slower and slower.
So there are two choices:
A) Reinstall
B) Buy a new computer
There are any number of tools to 'optimize' the registry, which work with varying degrees of effectiveness. However, anything that edits the registry involves some risk of corrupting it, and even the most effective optimizers can only do some much. They can put off the need for a re-install for several months, but they can't forestall it indefinitely.

Mind you, there are plenty of things that will make a poorly secured and maintained Windows box (or is that redundant?) grind to a halt long before registry bloat can become a factor. I'm still hearing from tech support customers who don't have anti-virus and anti-spyware scanners on their system, which with a broadband connection is simply asking for trouble.
Post Reply