Windows 8.1, WinSxS and C++


The folder winsxs in the Windows folder is usually quite large and you never want to delete it, never ever touch anything in it.  If you do, you will enter what used to be called DLL Hell. WinSxS stands for Windows side by side.  At least till Windows 8.1.

Why is Winsxs so big and gets bigger?

All of the components in the operating system are found in the WinSxS folder –  this location is referred to as  the component store.  Each component has a unique name that includes the version, language, and processor architecture that it was built for.  The WinSxS folder is the only location that the component is found on the system, all other instances of the files that you see on the system are “projected” by hard linking from the component store.  If you look at one of the files in one of the folders, you don’t see much, and if you look at another folder the files are different.  In either case do not make any changes.

For more info and references for that paragraph see: http://www.winvistaclub.com/f16.html and somewhat older link: http://blogs.technet.com/b/askcore/archive/2008/09/17/what-is-the-winsxs-directory-in-windows-2008-and-windows-vista-and-why-is-it-so-large.aspx

Why is this?  The files in the folders are pointing to DLLs that are located in the Windows\System32 folder elsewhere on the computer.  The size reported in Explorer shows the size report for not only the file in the Windows\System32 it shows it as the file size in WinSxS even though the actual file in WinSxs is quite small.  This file size reporting  can be repeated a number of times additively in the File Explorer reporting, making the reported size seem much larger when viewing the report size using file explorer than it really is.  Other, safe tools, which I won’t link to for security reasons will also show the same additive size reports.  But in any case, do not make any changes to this file with one exception which is new for Windows 8.1: You can use the Deployment Image Servicing and Management tool: Dism.exe (I changed this later in the day 8/25/2013 and had originally written disn.exe which is incorrect).

Run Disn.exe from a cmd shell with administrator privileges (or elevated privileges) and you can get some clean up on the files.  I won’t put the string you would use in this blog, but you can get it from this link: Determine the Actual Size of the WinSxS Folder and about half down the page you will see the process.

The output looks like the following, which is also shown in the link above.

image

 

What does this have to do with C++?

A C++ Developer could build a DLL.  The DLL could be referenced in the WinSxS folder.  More to follow.  Eventually.

Comments (4)

  1. Subtle but important typo; disn.exe should be dism.exe.

  2. Guest says:

    More to follow ?? whats this ?? a teaser ???

  3. SoCal Sam says:

    Thank you Wes, that is definitely a typo of importance!

  4. SoCal Sam says:

    Yep, there is more to come, I am working on showing how deployment or installation files look in WinSxS.