Renaming Xap to Zip is dead. Long live renaming Xap to Zip!

1 November 2008

Teach Windows to treat Xap files as first class compressed folders with this simple registry entry. After applying, you'll be able to open .Xap files and view their contents, and get the same shell experience as Zips have:

If you've ever had to do the "rename .Xap to .Zip" routine while doing Silverlight development, then you'll enjoy this fix. The entry also sets the MIME type of .Xaps to "application/x-silverlight-app", so it relates to my earlier post about the MIME type, too.

I've been using this on my Windows Vista and Windows Server 2008 workstation, but have not tried it on XP.

XNA users: Jeff Klawiter pointed out in the comments that part of the XNA Framework uses .xap for its project file extension. So, beware. Sucks that there is overlap.

Disclaimer: Use this registry file at your own risk. I am not responsible in any way for the results. As developers like to say, "it works great on my machine!"

Download and run this registry patch: Xap.reg

Here's the contents of the registry patch:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\.xap]
"PerceivedType"="compressed"
"Content Type"="application/x-silverlight-app"
@="CompressedFolder"

[HKEY_CLASSES_ROOT\.xap\CompressedFolder]

[HKEY_CLASSES_ROOT\.xap\OpenWithProgids]
"CompressedFolder"=""

[HKEY_CLASSES_ROOT\.xap\PersistentHandler]
@="{098f2470-bae0-11cd-b579-08002b30bfeb}"

The experience before the patch:

And after:

Hope this helps!

Jeff Wilcox is a Software Engineer at Microsoft in the Open Source Programs Office (OSPO), helping Microsoft engineers use, contribute to and release open source at scale.

comments powered by Disqus