Sunday, October 20, 2019

Windows Registry Nightmares


I remember Windows (and DOS) before it had a registry... Do you remember? Remember the Win.ini and the System.ini files (and Autoexec.bat and Config.sys)? Seems like a lifetime ago - and for some of you I guess it is...

At the time, configuring Windows sure was simpler. Simpler and easier. Simpler and easier and LESS RISKY.

Not so anymore... Today, the venerable INI files have been (mostly) replaced by the Windows Registry.

Have you tried editing the Windows registry manually. Go ahead. On Windows XP or Vista, try to uninstall an application - or better yet, a Windows installed service - manually. I dare you!

What's that you say? I must be crazy? That's insane? No one is dumb enough to try that? Well, I tend to agree with you. I consider myself a fairly experienced PC/Windows guy, but even I think twice before using REGEDIT.

But I do use REGEDIT.
Why? Because I have to.
Why? Because lots of software uninstalls poorly...
And I'm fed up with it!

This behavior reminds me of the bad 'ole days of "DLL hell". Anybody remember that? Where a software would install a DLL with the same name as a system DLL, or worse, it would install a system DLL that was the wrong version? Inevitably, it would screw up your system (in weird ways) and was masterfully difficult to troubleshoot.

And no, "DLL hell" hasn't gone away, but it's gotten better - or at least now it has to share the infamy with "Windows registry purgatory" (Wrp).
(Made that up myself... you think it'll catch on?)

For those of you who have not experienced Wrp (pronouced 'warp'), let me shed some light on this phenomenon. But first, read this to see what the Windows registry is so I don't have to spend a week relating my limited knowledge of the Windows registry.

In the Wikipedia article, near the bottom, there's a somewhat inconspicuous bulleted list item under the heading Advantages and disadvantages:
  • "Any application that does not uninstall properly, or does not have an uninstaller, can leave entries in the registry. Over time the computer suffers "Software Rot" as the registry fills with left-over and possibly malfunctioning entries."
This is the nasty bugger... This is the root of my pain.

Why doesn't software written for the Windows platform clean up after itself well? Is it really that hard?

Ok, yes, it is kinda hard - especially if you register COM controls and/or Windows services. But, that should be part of the price of selling software on the Windows platform in my opinion.

This is the kind of software engineering I alluded to when I wrote about "Leaf Blower Coders". Face it, 
the job is not done until all can be undone.

So, why is this a pain? I mean, really... all that's happening here is that there are orphaned registry entries that can't *do* anything and while it may bloat the registry, it's just a nuisance, right?

WRONG! Very WRONG!

As consultants, integrators, and custom solution providers, it is often common for clients to ask us to install software for them - usually on DEV or QA platforms. We act as experts and the client watches and learns as we show them how their software is loaded and configured. It's also not uncommon for us to be asked to *re-install* software that has been installed incorrectly, or we ask the client to *re-install* software themselves to insure that they have learned how to do it correctly. And THAT is when the uninstall becomes oh-so important.

It's in these *re-install* moments that orphaned registry entries can wreak havoc, I mean REALLY BAD BAD juju, on your day. I won't bore you too much more with details because I've rambled enough already, but orphaned registry entries (and really, *any* orphaned stuff) left hanging around after an official uninstall will cause untold problems with re-installing software - nearly always ending up with a failed install (or worse, an install that appears to work, but you don't find out it really doesn't work until much later after you've spent too much time trying to figure out why the software seems buggy).

So, here's my newest plea to Microsoft platform software vendors...

Please, please read the whys & wherefores of the Windows registry design and use - here, here, and here are good places to start. Take the time to map out all the registry entries your software makes when it installs and over the lifetime your software is installed (as well as any other configuration changes your software makes to the system as a whole). Document that in your software documentation. And then create a stand-alone uninstaller that reliably, repeatably removes them. We, your users and partners, need help to keep the Windows registry beautiful and tidy for future generations. Thank you.

No comments:

Post a Comment