You are here

Why do programs use the registry at all?

16 posts / 0 new
Last post
rich.bradshaw
Offline
Last seen: 11 years 4 months ago
Joined: 2006-10-05 08:41
Why do programs use the registry at all?

Reading through the threads here, it seems that programs that want to use the registry are a problem for making apps portable. Why do programs use the registry anyway? I can understand for adding things to Windows context menus etc, but why bother for things like settings - surely a local .ini file or something would be a lot more sensible... Why do people write software that uses the registry at all - what are the benefits over a small config file?

Ryan McCue
Ryan McCue's picture
Offline
Last seen: 15 years 2 weeks ago
Joined: 2006-01-06 21:27
Well

I'll quote something I heard (my memory is a little rusty):
Programs started getting bigger and had more things to keep track of. Users also wanted to move their programs around. The registry was created to keep track of all the bits and pieces a program left.
Edit: Wikipedia's say:
The Windows Registry was introduced to tidy up the profusion of per-program INI files that had previously been used to store configuration settings for Windows programs. These files tended to be scattered all over the system, which made them difficult to keep track of.
See also: http://en.wikipedia.org/wiki/Windows_registry#Advantages_of_the_Registry...
----
R McCue
Cube Games
People who didn't need people needed people around to know that they were
the kind of people who didn't need people.
(Maskerade)

"If you're not part of the solution, you're part of the precipitate."

TheVoyager
Offline
Last seen: 10 years 8 months ago
Joined: 2006-11-27 16:00
Why do programs use the registry at all?

Well I for one hate the registry, there are a lot of programs out there that do not clean up properly when you uninstall them, the worst offender being Symantec.

Trying to clean it up manually can be a nightmare, and will sometimes cause more problems than you are trying to alleviate.

When everything had its own ini file at least you could look at it , amend it if necessary, add to it, and 9 times out of 10 it was located in the programs directory.

Bob

Bob

rich.bradshaw
Offline
Last seen: 11 years 4 months ago
Joined: 2006-10-05 08:41
Exactly... I don't see what

Exactly... I don't see what is so bad about each program having it's own ini file, and then having a giant ini file for Windows (which can be the registry). Why do programs end up in there... Oh well - guess that's where we are stuck now!

Ryan McCue
Ryan McCue's picture
Offline
Last seen: 15 years 2 weeks ago
Joined: 2006-01-06 21:27
It is worth noting

that the registry is just a few physical files, located in your Windows directory.
----
Ryan McCue
Cube Games
Life is like a sewer. What you get out of it depends on what you put into it.
(Tom Lehrer)

"If you're not part of the solution, you're part of the precipitate."

BenMcLean
Offline
Last seen: 13 years 5 months ago
Joined: 2006-08-23 19:32
its all microsoft's fault.

its all microsoft's fault. software shouldn't have needed to be "installed" to run ever since at least win98SE

mranime
Offline
Last seen: 17 years 1 month ago
Joined: 2007-03-20 21:21
RE: its all microsoft's fault.

Why is everyone so quick to blame Microsoft?

They can't be held accountable for how other software developers choose to package their own software.

Espreon
Espreon's picture
Offline
Last seen: 12 years 2 months ago
Joined: 2006-09-29 18:23
I the registry...

Just use Linux + Wine. Even though I am a Windows user, I will get a computer and have Windows on it and I will get a Ubuntu CD and Windows (Ubuntu eradicating Windows) and I will enjoy a more cluttered way of doing things! ( which is better then relying on something stupid like the Registry). Besides Windows Vista is gonna suck due to the DRM and the locked down kernel + the hefty price for the OS and the hardware for the Premium version (gotta have that eye candy!) and I doubt Vienna will be any better.

Jank
Offline
Last seen: 17 years 4 months ago
Joined: 2007-01-08 14:31
Why registry?

I think programs can be protected against copying etc better when using the registry. Programs not using registry can simply copied to another computer.
Thats why all this registry is about.

Jan

Espreon
Espreon's picture
Offline
Last seen: 12 years 2 months ago
Joined: 2006-09-29 18:23
If you are saying that

I am sure you are for DRM.

www.LukeFranklin.com
Offline
Last seen: 16 years 11 months ago
Joined: 2007-03-18 18:27
Why do programs use the registry at all?

I believe that Microsoft invented the registry to prevent people from sharing copyrighted programs with other people. I'm all for the Ubuntu Linux way of thinking, "Free for all, kinda thing", but of course I can't do without windows due to compatibility, so I have both! I try to use Ubuntu as much as possible however I due to the fact that I am a VB ASP.Net programmer I still use Windows heaps.

Luke Franklin
www.LukeFranklin.com

Signature automatically removed for containing links

mranime
Offline
Last seen: 17 years 1 month ago
Joined: 2007-03-20 21:21
I seriously doubt that...

...Microsoft introduced the registry as a copy protection method. I'm not sure of when exactly it was implemented with Windows but it was in Windows 3.1 which was way before digital piracy was as rampant as it is today.

It makes sense to try to centralize all of the program customization settings into one place, rather than have configuration files scattered all over the disk. It would be nice if software developers included an option to set whether the software would use the registry or write the settings to an .INI file, but alas...

www.LukeFranklin.com
Offline
Last seen: 16 years 11 months ago
Joined: 2007-03-18 18:27
Oh.

Oh.

Luke Franklin
www.LukeFranklin.com

Signature automatically removed for containing links

calvin-c
Offline
Last seen: 17 years 6 months ago
Joined: 2007-03-27 17:08
Not quite

Actually, the registry was introduced with Win95. There were user.dat & system.dat files in Win3 but they weren't the registry. According to my memory of that time, the registry was introduced because of problems discovered when the win.ini grew to be over 1000 lines. (Or maybe it was the system.ini, but I think it was win.ini.)

And the biggest problem with individual .ini files was finding the things. One of the major things stored in an .ini file was the location of the program-which meant that the .ini file couldn't itself be stored in the program directory. The logical place for them was the Windows directory but people kept deleting them. God knows why, but they did. So when Microsoft introduced the registry many apps moved their settings to it.

I'm sure that Microsoft could have fixed the length problem in the win.ini processing, but they chose to 'fix' it this way. I won't say they didn't have any other reasons for choosing this fix, but there was a real problem they were addressing besides anything else they achieved.

FWIW one of the biggest reasons Symantec is known for leaving stuff behind is the number of people who thought they'd just uninstall & reinstall it rather than renewing the subscription. Again, they probably could have fixed it another way, but they decided to leave fragments behind to show that it had been previously installed, thus picking up the old subscription wherever it left off. (As I know from personal experience, if you reformat the hard drive & reinstall everything you got a new subscription, up thru NAV 2002, at least.)

portable_dev
Offline
Last seen: 17 years 5 months ago
Joined: 2007-03-16 14:24
Nope.

From the horses mouth.

Also from the horses mouth, but I can't post it since it would violate copyright, is a little article I found in the VS6 MSDN library titled "What Is (sic) the Registry?". The full path is "Books -> Programming the Windows 95 User Interface -> Part 2 -> Chapter Ten: The Registry -> What Is the Registry?" in case you happen to have a copy.

In it they give their reasoning behind the registry: 64KB limit on inis, no rules regarding win.ini data storage (what's allowed and where it can be stored), hard for users to find the data that needed to be edited.

The only real issue with using app-specific private profiles was a simple client/server handshake issue regarding DDE and OLE, and in that case using a common database makes perfect sense. All of these reasons resulted in the 3.1 "registration database."

But somehow you jump across the wide chasm between that limited-case use to the following statement which can be found on each private profile api's SDK doc page:

This function is provided for compatibility with 16-bit Windows-based applications. Win32-based applications should store initialization information in the registry.

I wonder if MS really meant only initialization and everyone just decided to hell with that, lets just put it all in there. In any case, it's funny how those apis have survived while there's nary a 16-bit app to be found for ages. Maybe the registry wouldn't be the garbage dump it's become if they would have just beefed up the private profile apis instead.

MCBastos
Offline
Last seen: 9 months 3 weeks ago
Joined: 2007-04-02 12:03
It's a matter of permissions

In NT-descended versions of Windows (NT, 2000, XP, 2003, Vista...) the Registry allows the system administrator to do a thing that's hard to do with INI files: set up permissions in a key-by-key basis.

With INI, you could at best establish permissions on a file-by-file basis. That is, you can write-protect a whole INI file for nonadmin users, but you can't do it just for a couple lines inside the INI: you end up needing to split your INI in two. Or three. Or seventeen...

I know this isn't a valid reason for using the registry in Windows 9x (where everybody runs with administrator privileges anyway), but I suppose that MS used Windows 9x to "educate" developers about using the registry...

Not that it worked 100%: a number of headaches with older apps running in 2K/XP resulted from these apps expecting to be always able to write to the "Local Machine" hive, when in fact by default that hive is read-only for apps running without Admin privileges. The same kind of problem affected apps using INIs residing inside the "Program Files" tree...

MCBastos

Topic locked