Windows 8 and the Registry

During an audience Q & A on the Windows Weekly podcast on Friday, someone asked me about Windows 8 and the Registry, and why Microsoft didn't simply get rid of the Registry in this release. I explained that Microsoft couldn't get rid of the Registry because it was required by "legacy" Windows applications--i.e. every single Windows application written to date--and that perhaps the Registry could simply be de-emphasized over time as new, self-contained Metro-style apps appeared and replaced our previous applications. The theory here being that Metro-style apps were truly "self-contained," or application packages that exist in isolation from each other, both in memory while running and on the file system itself.

This would be a wonderful future world if it were true. Sadly, it is not.

Tipped off by Gavin R. via email, I watched the BUILD session Windows Runtime internals: understanding "Hello World" today, and if you're interested in this kind of thing I recommend you do so as well. In it, Microsoft's Matt Merry explains that, sadly, the Registry isn't just alive and well in Windows 8; it's still a core technology behind Windows 8 and its new, Metro-style apps.

Cue overly-loud sighing sounds.

"Probably not a surprise to you, but we store [app] registrations in this thing called the Registry," he says at about the 8:50 mark of this talk. He then demonstrates where you can go to find Windows 8 app registrations in the Registry: In HKEY_CURRENT_USER, since as with legacy applications, Metro-style apps are installed per-user. If you're curious exactly where these things are, they're in:

HKEY_CURRENT_USER\Software\Classes

But it's not just these new apps that use the Registry. Everything new in Windows 8 uses the Registry. This includes the OS itself, and new OS features like contracts. As Merry notes, "There are two registrations for [any] app. There is an extension registration and there is a class registration. Apps implement contracts: The search contract, the share contract, the PlayTo contract. Those contract registrations are extension registrations to the operating system. And believe it or not, when you click on the tile for an app, that's just another contract activation. That's the Windows.Launch contract."

You can find a list of Windows 8 contracts in HKEY_CURRENT_USER\Software\Classes\Extensions\ContractId. These include: Background Tasks, File, File Picker, Launch, Protocol, Search, and Share.

Expanding the Windows.Launch key, and then PackageId, Merry uncovers a slew of messy keys representing the Metro-style apps installed on his Developer Preview PC. And it's a disaster, just like in today's Windows versions.


registry_lives_0


This says to me that true drag and drop install and uninstall will not be possible in Windows 8, as it is in Mac OS X. I know that install/uninstall is not difficult, and in fact one might argue that drag and drop makes no sense in an OS that is deemphasizing the file system anyway. Fair enough. But true app isolation, to me, means that these things are in fact self-contained. And that doesn't appear to be the case.

I could go on, but you get the idea: For all the newness of the Windows 8 runtime engine, WinRT, and the new Metro-style apps, Windows 8 still very much uses and relies on a legacy construct, the Registry,  which shows no signs of being obsoleted anytime soon. (And there's a huge emphasis on Explorer.exe in this talk as well, which I find odd given its supposed retirement as the shell in Windows 8.) I'm not a blind hater of the Registry like some people--many of whom expected to see Microsoft move to self-contained XML files for this kind of thing. And while I expect that Microsoft will someday write a very long blog post explaining why using the Registry isn't just OK but preferable, I am surprised by this information. Clearly it requires some research.

Discuss this Article 23

jefferydmitchell
on Oct 16, 2011
This is...unfortunate. I can't say that I'm surprised though. At this point I guess it requires too much effort and brain power to retire the Registry and think of something new. I suppose that it's necessary for backward compatibility too. I've installed the Windows 8 Developer preview on a spare machine, so that I can experience it first hand. I intend to follow along with all the early builds as best as possible. I just don't know about this new direction from Microsoft. At this point I feel like I have to force myself to like it, because I know it's the future and I know there's little choice if you want to stay with Windows. I guess we'll have to wait and see if developers jump on-board. I do find Microsoft's arrogance in explaining these changes quite interesting...it's almost like they're taking a page from Apple's playbook. "You vill change and you vill enjoy it!" Maybe this is a good excuse to get more comfy with OS X on my MacBook. :)
dgardfrey
on Oct 16, 2011
I think only you and like two other guys are obsessed about this. To state the obvious, you uninstall metro apps by right-clicking and choosing uninstall. That's it. Apple has all those messy files as well, they're just hidden from the user, right? I believe Leo said this on Windows Weekly the last time you brought up the registry.
alex_norcliffe
on Oct 16, 2011
Agreed - especially disheartening when you look at some of the technical implementations of the registry itself http://rwmj.wordpress.com/2010/02/18/why-the-windows-registry-sucks-tech... Seems to me the Registry is crying out for a clean API writing to a transactional, indexed store. Windows 8 with its new app paradigm was probably the first real opportunity in years to do this with acceptable breaking changes (+ a migration scenario)
alex_norcliffe
on Oct 16, 2011
Seriously some of the UX on the registration / commenting side needs a lot of work. Had to register to comment; registration involves filling in home address / phone number, company name / demographics (all required fields) and then the validation doesn't even work (email address was truncated on page refresh). Took 8 steps to do it. Then upon commenting I'm forced to submit a rating of the article. I like the site, but having some zen with the users and putting some of those fields as non-mandatory would be an improvement. Making the field mandatory did nothing to persuade me to enter real information, leaving you with a database that needs more cleaning than if people submitted the info voluntarily.
alex_norcliffe
on Oct 16, 2011
...and I've got zero idea whether my comment has been submitted for moderation or lost to the ether; the page just refreshes having cleared the comments box. I might stop now; I'm possibly talking to myself...
brian.reiter
on Oct 16, 2011
@thurrot. This should not be a surprise because WinRT is fundamentally built on top of COM. I'm not sure we need to care very much about how WinRT uses the registry. It's just plumbing. Do you worry about the mess of squirrely folder names in the GAC or Chrome's extension directories and cache files? I'm not sure why people have such an antipathy for the registry. It's a securable, fast and reliable hierarchical database. Config files can't easily reproduce the same feature set. Yes, some apps use it badly but mostly that makes them crappy apps. OS X drag-n-drop app deployment is not a panacea, either. Apps can drop configuration files and shared executables all over your Mac and there is usually no uninstall script to clean all that stuff up. I feel like a lot of the registry complaints are rooted in unix vs windows theology. Windows doesn't do things the unix way and is therefore wrong.
nascentt
on Oct 16, 2011
The thing is. The registry isn't needed to save/read application settings. It's accessed via API. The API could have easily been re-routed to xml config files instead. Especially in terms of HKLM\Software and HKCU\Software. Windows7 was highly about using virtual folders and Symbolic Links to move things around without breaking legacy, it would've been trivial to do the same with registry. I'm not entirely sure the registry is bad for internal OS stuff. There's a LOT of stuff to store that really was a nightmare with ini files in 3.1, the issue is letting 3rd party software using it. First of all it puts the OS at risk when something goes wrong. Secondly it breaks backup and portability of individual applications. Hell if it's possible to use PortableApps launcher, sandboxie or ThinApp to make programs portable, then it's sure as hell possible to do at the OS level.
PedroR
on Oct 16, 2011
Metro apps can't access the registry. Yes, Windows uses the registry to keep track of installed apps and contracts, but that is it. The app itself can't access the registry. So, I would the registry is being de-emphasized.
PedroR
on Oct 16, 2011
Jesus, the comment section of this site is a mess! Paul, do you know a thing called Disqus???
Info Dave
on Oct 16, 2011
A question Paul. What parts of the registry will exist on an ARM tablet? My guess is Metro doesn't need a registry to run. Perhaps the x86 version is making entries that are not part of Metro, and not necessary. This is as good a time as any to begin to move away from the system registry. Good riddance.
PedroR
on Oct 17, 2011
@Dave Metro apps can't access the registry. In fact, if you try to use the registry API in your app, the compiler won't allow it. The WinRT is built on top of COM, so I guess that rhe registry is here to stay. And I don't think that's really a bad thing. What usually screws the registry is 3rd party apps, and if those can no longer write to the register, my guess is that we will see a much more healthy registry. Not that the registry is that broken. In all my tech career, I saw only a handfull of PCs if broken registrys. And for the most part, it was caused by registry cleaners, the most unusefull and dangerous piece of software anyone can run on their PC!
PedroR
on Oct 17, 2011
I have a solution for the registry: remove regedit.exe from windows. That way Paul can't see it, and all is good!
PedroR
on Oct 17, 2011
Where are my comments? Did they died and go to hell? Are they on purgatory, waiting for St. Paul's judgment?
jcwuerfl
on Oct 17, 2011
Perfect chance to get rid of the registry. Sad... they should have NOT allowed any new metro ui apps to use the registry at all! Bad move by Microsoft! The registry is horrible, and it has been that way since windows 95.
Waethorn
on Oct 17, 2011
Show me a better way, and then your criticisms are justified. How else do you get program settings indexed in such a way as to provide tie-ins with the operating system (think of Contracts, file associations, links to .Net, etc.) in the fastest way possible? Want individual .ini for .xml files? Then your hard drive is thrashing around due to data being non-contiguous. Want the system to index the locations of all of the settings files? You still need a central place to do that, so why not just put all of the settings together. Moving them into one single folder? Why would separate files be better than a single database? What about managing permissions then? Security? Backup? Why is that so different than using the current registry? A lot of people want to criticize something but have no answer on a solution.
spivonious
on Oct 17, 2011
The registry is needed for COM to work, and since WinRT is sitting on top of COM, the registry is not going away any time soon. Honestly, if apps stopped using it to store app settings and not removing them when uninstalled, the registry would stay "lean and mean".
Waethorn
on Oct 17, 2011
@Pedro: +1 on the comment about registry "cleaners". More like registry vacuums, where they suck (pun!) all of the necessary registry keys out. I know one of the most destructive programs I've seen is also one of the most recommended registry cleaners out there (usually by the guy down the street that supposedly knows stuff about computers...) is CCleaner. I've had to fix countless systems where CCleaner was run and totally destroyed the registry because somebody was told by their neighbour "that has no problems with their PC" that CCleaner miraculously tuned up their system and "made it run 5x faster". Every week there's at least a couple systems that come in for service with the same story. These "neighbours" are the same people that get free internet TV, download pirated software from Bittorrent websites, use file-sharing programs to get free (read: illegal) music, etc., and yet "never get any viruses". I have news for you gullible users out there: your neighbours aren't being truthful with you, and they're my most frequent clientele. Trust a trained professionals diagnosis instead of your neighbours wishful thinking.
Dave (not verified)
on Nov 9, 2012

Hey, I do all that, yet I've been in IT for years. If CCleaner caused problems, then there were already major problems to begin with. Besides, you have no idea how these people are using it. Any tool can be dangerous in the hands of an untrained laymen. You're making a blind stereotype about your clientele, and to be honest, it's probably the reason why you only have a job where you're stuck fixing people's ****y computers in the first place.

PedroR
on Oct 17, 2011
@jcwuerfl Paul's article is a little misleading. All the registry entries he is talking about are made by Windows, not by the app. Metro apps can't even read the registry, much less write to the registry.
brian.shapiro
on Oct 17, 2011
@Waethorn: Indexing them would be better than putting all of the settings files in one location, because it would be easier to remove settings associated with an application. If you had settings localized for each application, you could also manage conflicts between two applications that want to modify the settings, or only permit certain applications to modify the settings of a particular file without user permission.
brian.shapiro
on Oct 17, 2011
@Waethorn: Indexing them would be better than putting all of the settings files in one location, because it would be easier to remove settings associated with an application. If you had settings localized for each application, you could also manage conflicts between two applications that want to modify the settings, or only permit certain applications to modify the settings of a particular file without user permission.
shplendid
on Oct 18, 2011
The problem with the Registry is that it is a single point of failure for the whole windows machine. If it becomes corrupted due to a virus of a failing Hard drive, the whole machine is toast. It also makes the whole Application/Machine configuration as opaque as it could possibly be. Deleting a .plist file to reset an application that has gone squirly is much simpler than trying to unravel Registry entries with arcane names. From empirical evidence, it also has a huge impact on overall performance. We have a couple of utilities that we use to backup and compact the registry and that can make a big difference to an older machine. Why doesn't the Registry back it self up regularly so that machines are recoverable? While I can't blame MSFT for software vendors inability to write uninstallers that actually work (Symantec) the fact that they encourage a its use for application configuration and the decentralized implementation of entry locations renders the Registry a nightmare in the real world.
Waethorn
on Oct 20, 2011
@brian: "Indexing them would be better than putting all of the settings files in one location, because it would be easier to remove settings associated with an application." Whether you're clearing out files, or clearing out settings from the registry, the difference is minimal. With the registry, however, you have much tighter control over the modification processes. "If you had settings localized for each application, you could also manage conflicts between two applications that want to modify the settings" You already don't have this problem because applications are sandboxed. No app can write data into another apps dataspace. Settings in the registry are created by Windows too, so the app doesn't have direct access to the registry. So your points are completely moot.

Please or Register to post comments.

IT/Dev Connections

Las Vegas
September 30th - October 4th

Paul ThurottYou'll have the opportunity to experience:
• 120 Technical
Sessions
• Networking with Peers
• Expert Speakers


Come See Paul Thurrott & Mary Jo Foley in Person!

Register Now

Office 365 InfoCenter

Get the latest insight and info from Paul

Read Now!

What I Use