Cleaning Up Old Avalon Installs

If you're upgrading to the latest version of Avalon (I really should start to call it Windows Presentation Foundation, I know, but I want to make sure that search engines find blog entries like this for both the codename and the final technology name), you might find that there's some old cruft on your machine lying around that causes you problems during the installation process. Dan Mohr, an SDE/T on the team explains further:

"With the PDC bits, the Windows Presentation Foundation installer does not force overwrite existing files.  This may cause problems if you have files from previous Windows Presentation Foundation builds left on the machine. This problem is compounded by a bug in some earlier versions (before the May CTP) that caused the shared DLL reference counts in the registry to not be correctly decremented during uninstall leaving some shared files on the machine."

Dan has written a small shell script that will remove existing Avalon files and ensure that the shared DLL reference counts in the registry are removed.  Note that this script should only be run after uninstalling all previous Avalon builds, otherwise you'll wind up with a half-complete installation that is hard to remove. To run Dan's script, download this JavaScript file and execute it with cscript.exe as follows:

    cscript cleanupSharedFiles.js

Welcome to the world of pre-beta software - if you think this is painful, you should try running daily builds :)