Yesterday, I finally decided to bite the bullet and flatten my dev machine. I got this machine in 2003, and obviously installed XP on it, I’ve been self-hosting Vista on it since some time around April of this year, upgrading just about every week.
The thing about upgrades of interim builds of the OS is that sometimes things don’t quite work right after the upgrade. Sometimes things get ACL’ed incorrectly, sometimes registry settings get migrated that should be reset, sometimes stuff gets put in the wrong place. These problems get noticed and fixed after they occur, but they sometimes leave little bits and pieces behind.
One great example hit about 2 months ago – I suddenly lost my ability to view JPGs in the sidebar. They worked just fine everywhere else (I thought), but not from the sidebar. Digging into the sidebar code, I realized that the sidebar was just calling ShellExecuteEx on the JPG file, which led me to realize that I couldn’t launch JPGs from the command interpreter either. Digging into the ShellExecuteEx code, I realized that the file association handler for JPG files wasn’t working correctly – it was loading a DLL, but the object hosted in that DLL didn’t implement some class.
I looked at the COM registration in regedit, and it looked ok, so I asked for the shell team for help. They asked me to get a regmon trace, and using the trace, they figured out what had happened. It turns out that the handler for some COM class was moved from one DLL to another DLL back in July. No big deal, the COM registry had been fixed up so it wasn’t a problem. The problem for me was that an upgrade back in June had accidentally virtualized the COM registration for the object that contained this class. When the registry was updated, the virtualized registry wasn’t updated (because the system didn’t know about it).
Our customers would never see this bug, neither would any user performing a clean upgrade, it only showed up because I upgraded from build-to-build – if I’d clean installed it would never have hit me.
So yesterday, I decided that it was time to flatten my dev machine. I’ve had enough “wierd” things happen (strange Outlook behaviors, etc) that I decided it would just be safer to reset the world.
It’s weird, I’ve not reinstalled an OS on my of my machines in a VERY long time (at least a couple of years now), it felt strange.
But I figured it had to be done. First thing I did was to uninstall all the software on my machine that I didn’t think I used day-to-day (I had a LOT of junk that had built up over time). I wrote down all the stuff I knew I would need, and made sure that I had copies of the software to reinstall. I next used the Windows Easy Transfer (migration wizard) tool to back up my user settings, and reinstalled the OS. So far so good. I next used the migration wizard to put my stuff back, and reinstalled all my apps.
The cool thing is that it worked just about perfectly. I now have a newly scrubbed clean machine, all my data’s back (and even then, my old data’s not been lost – the upgrade copied all the data that was going to be reset to the Windows.old directory on my hard disk). I’m still going through confirming that I didn’t leave any data behind that I cared about, currently it looks perfect.
 Flatten vs. Pave over. To flatten a machine is to reinstall the OS clean, to pave a machine is to reformat the hard disk. You flatten a machine to resolve OS corruptions, you pave over a machine to recover from a virus infection.
 KC Lemson is getting to me 🙂
Edit: Fixed stupid typo.