The Secret Of Windows Vista Winsxs Folder

来源: 奉旨灌水 2008-10-20 20:02:33 [] [博客] [旧帖] [给我悄悄话] 本文已被阅读: 次 (8716 bytes)
The Secret Of Windows Vista Winsxs Folder.

Most of you may have noticed the WinSxS folder and been surprised at its size. For those who have not, the folder is situated at C:\Windows\Winsxs and has a whopping size ! Mine is almost 5 GB and has around 6000 folders & 25000 files and occupies almost 40% of the Windows folder ! While the size of this Winsxs folder, in XP is around 25-50 MB; its large size in Vista, is intriguing, to many ! Check the image below.

Size of  WinSxS in Windows
So what is the mystery of this Winsxs folder in Vista?
What's the purpose of so many folders & sub folders?
What does it contain?
Can you delete this directory?
Can you atleast move it somewhere else?
Or can its size be reduced to save disk-space?

The Winsxs folder, stores multiple copies of dll's in order to let multiple applications run in Windows without any compatibility problem. If you browse inside, you will see what look like a lot of duplicate dlls, each having the same name. These are actually, different versions of the same files which are being stored; as different programs may require different versions. In short, Winsxs, which stands for 'Windows Side By Side', is Vista's native assembly cache. Libraries which are being by multiple applications are stored there. This feature was first introduced, in Windows ME and was considered as Microsoft's solution to the so-called 'dll hell' issues that plagued Windows 9x.

In Winsxs the 'backup' folder is the largest as can be noticed in the image below.
Sub-folders of WinSxS

Again, as can be seen in the image below, in the Winsxs folder, the 'Other' File types takes the bulk of the space. These primarily consist of .imd, .ngr, .csd, .dll, .dll.mui, .exe and such other file types.

File Types in WinSxS

In Vista, there isn't a 'dllcache' folder and nor can you find the 'i386' folder, where the system caches (like in XP) all it's source modules. It is this WinSxS folder which stores the shared components of side-by-side applications. These files can be multiple versions of the same assembly or application. Every side-by-side assembly has a unique identity. One of the attributes of the assembly identity is its version. "Side-by-side assemblies are used by the operating system as fundamental units of naming, binding, versioning, deployment, and configuration. The Winsxs folder includes all manifests, optional components and 3rd party Win32 files".

But, why so many subfolders, and why keep so many different versions of the same dll, exe or other files ?

As mentioned, Windows stores the old dll's and library components in the WinSxS folder. Now if a newer version of this file is a part of the OS, but a particular application requires a particular older version for running, then the older version from the winsxs folder will be used, leaving the newer version in its present place, for other applications which may require it.

So obviously you cannot delete this directory or move it elsewhere. Nor is it advisable to delete anything here, as such a step could probably make your applications un-workable or even break your system! If you have many applications installed, you can expect to have a jumbo sized winsxs folder.

If you delete components from the WinSxS folder like the manifets or the assemblies, etc, you could be in trouble. Each system would react differently. What may work for one could break another! For instance, if you install a program that requires that particular assembly, which you may have deleted, then that program will just not run! Compressing the folder is also a no-no, as it could cause problems during WindowsUpdates or while installing a Hotfix.

The safest way to clean it, is by simply uninstalling applications which you don't require. However, this too is not fool proof, as many applications still leave behind their files here, since they may be shared between other applications. So the probability of dud unused dll's being left behind is quite high.

And if you are into trying out new software or installing and uninstalling frequently, you may notice that your winsxs size is indeed large, as Vista will store multiple copies of these dll files, in order to let multiple applications without compatibility problem.

Update : One of the largest changes between previous versions of Windows and Windows Vista was a move from an INF described OS to componentization. A component in Windows is one or more binaries, a catalog file, and an XML file that describes everything about how the files should be installed. From associated registry keys and services to what kind security permissions the files should have. Components are grouped into logical units, and these units are used to build the different Windows editions. All of the components in the operating system are found in the WinSxS folder – in fact we call this location 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. Let me repeat that last point – there is only one instance (or full data copy) of each version of each file in the OS, and that instance is located in the WinSxS folder. So looked at from that perspective, the WinSxS folder is really the entirety of the whole OS, referred to as a "flat" in down-level operating systems. This also accounts for why you will no longer be prompted for media when running operations such as System File Checker (SFC), or when installing additional features and roles. Now that you know why the store can grow to be so large, your next question is probably to ask why we don’t remove the older versions of the components. The short answer to that is reliability. The component store, along with other information on the system, allows us to determine at any given time what the best version of a component to project is. That means that if you uninstall a security update we can install the next highest version on the system – we no longer have an “out of order uninstall” problem. It also means that if you decide to install an optional feature, we don’t just choose the RTM version of the component, we’ll look to see what the highest available version on the system is. As each component on the system changes state that may in turn trigger changes in other components, and because the relationships between all the components are described on the system we can respond to those requirements in ways that we couldn’t in previous OS versions. The only way to safely reduce the size of the WinSxS folder is to reduce the set of possible actions that the system can take – the easiest way to do that is to remove the packages that installed the components in the first place. This can be done by uninstalling superseded versions of packages that are on your system. Service Pack 1 contains a binary called VSP1CLN.EXE, a tool that will make the Service Pack package permanent (not removable) on your system, and remove the RTM versions of all superseded components. This can only be done because by making the Service Pack permanent we can guarantee that we won’t ever need the RTM versions.
请您先登陆,再发跟帖!

发现Adblock插件

如要继续浏览
请支持本站 请务必在本站关闭/移除任何Adblock

关闭Adblock后 请点击

请参考如何关闭Adblock/Adblock plus

安装Adblock plus用户请点击浏览器图标
选择“Disable on www.wenxuecity.com”

安装Adblock用户请点击图标
选择“don't run on pages on this domain”