Archive for November, 2007

Registry vs INI files

Thursday, November 29th, 2007

Raymond has a good article listing the reasons why INI files aren’t good enough, and so Microsoft invented the registry.

Why are INI files deprecated in favor of the registry?

I think it’s a good summary, although it is very one-sided.  He leaves out all the disadvantages the registry has introduced.

There are a few good comments after the article, but they get lost with all the spam and trolls Raymond’s blog attracts.

“… the possibility to migrate 100% of an application and all of its settings intact, from one Windows PC to another Windows PC”

“Well, ini files (meaning .ini, .xml, etc.) obviously have disadvantages. But they also have advantages.  You can easily fit all program + configuration into a single directory, which allows:
- “an application on a memory stick”,
- “an application without installer”,
- “an application with very limited rights” (write and write only one directory, no registry access allowed),
- multiple versions to exist peacefully
- modify a config file by hand, quick and dirty style.”

“I have found the registry to be unreliable due to corruption.”

“…[a tool that] tracks which applications touched what registry entries and could strip unneeded ones on an app uninstall”

“No sane user-visible tool for manipulating registry entries.  That is — manipulating the registry is foremost a programming interface.  Regedit is not even 1/10 of what is needed for even a knowledgeable person to make edits easily”

“XCOPY + INI solves 99% of the problems:
1)Application failure -> XCOPY (whole app or ini only)
2)Uninstall -> DELETE
3)Backup -> COPY *.ini d:\myappbackup\, zip it if needed.”

“I *do* think the migration problems are real. If I want to back up my program settings and reinstall, I know how to do that on Unix for the most part. Backing up /home/evan does most of the trick, and backing up /etc does pretty much all of the rest.”

And Raymond’s snarky reply:  [HKCU backs up your user, HKLM backs up your system. Restoring it is a big more problematic, because you have to merge changes, but this too can be done. -Raymond]
Problematic indeed…

A long comment here, but very good, plus Raymond’s snarky reply:

“The Registry is, for all its other benefits, a proprietary solution … And by that, I mean that there’s a fairly short, finite list of tools that can work with it, and pretty much all of them depend on the Windows kernel.

Why is this bad?  Maybe if you’ve never had to fix a broken Windows box, you wouldn’t know.  When you have a Windows box that is currently unbootable because some random program ate the Registry, your main option, in most cases, is to reformat the machine and start over, not because of the lack of logs, not because of the lack of audits, but because there’s no way to get into the system, manually fix the damage in the Registry, and continue life normally.

Contrast this with Un*x’s .conf files, where you can boot off a CD or even via a network and use any of ten thousand different text editors to edit the .conf files until the system is functional again.”

Raymonds comment - [Said clue was caught years ago. Boot Windows off a CD (use WinPE) and then run regedit from the CD. -Raymond]

Oh how frustrating to get a reply like that!  The Raymond haters have just increased.

Fortunately, the commenter had some backbone and replied:

“I’m sure that’s just ducky if you’re in a corporate environment and have access to a Volume License that includes WinPE.  So what do you have to tell those of us who are asked to repair aunt Sally’s desktop PC while we’re visiting her on vacation?

Actually, okay, WinPE 2.0 is available to the public now … but prior to THIS YEAR, you really did have to have a corporate Volume License …  Hence the existence of third-party solutions, each more hacky than the next.  I wouldn’t exactly call that a viable solution “years ago.”

Would it really have killed you guys to include even a marginally-functional RegEdit on the Windows XP Install CD?”

Also in reply to his comment:

“Does that contain a tool to fix any structural damage to the registry? Like fsck or scandisk for filesystems? Damaged .conf files can be repaired easily, worst case you could rewrite the whole file from scratch with the help of a man page. How do you fix a mutilated registry file?”

Personally, I think the biggest problem is the lack of tools.  A huge proprietary database, with no elegant tools for:
- modification
- clean up
- backup/restore/merge
- defrag
- damage recovery
which just makes it a big black box, that continues to increase in size for the life of the machine, continues to slow down until the system is completely useless, at which point your only choice is to re-install the OS from scratch.  I’ve seen this scenario more times than I can count.  It’s what gives Windows a bad name.

It really needs the tools to combat this problem.

Visual Studio Help

Friday, November 9th, 2007

I have a post on the Visual C++ forums that isn’t getting a lot of attention.  So I’m soliciting more comments.

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2390510&SiteID=1&mode=1

I want to create a “lib of libs”  (what’s the technical term for this?) with Visual Studio and it’s not letting me set this up in a way I want to.

Any ideas?

Gamefest 2007

Wednesday, November 7th, 2007

The audio and slides from Gamefest 2007 are available here:

http://xnagamefest.com/presentations.htm

This is Microsoft’s game developer conference held in August.  A lot of the material you see here is similar to what you will see at GDC, so might as well pick it up now.

Hannah Montana and friends

Friday, November 2nd, 2007

Halloween was fun, here’s some pictures of the troops:

img_2815a.jpg

img_2814a.jpg

img_2816a.jpg

(sad thing is, I’ll probably get a million hits to this blog because of the title)