An issue with WinSxS deep cleaning

Surprisingly, it can be done in ntlite by disabling the component stack. For example, removing hyperv will also remove files in winsxs.
I mistakenly disabled the component stack during the integration patch, which resulted in the destruction of winsxs.
The component stack should be disabled when removing components after inheriting patches, To enable deep removal.
This method is very effective and can reduce the size of WIM to around 2.8g. Although it did not meet expectations, it is already sufficient.
The translation is a bit messy. The meaning is to disable winsxs after integrating the patch, Disable winsxs during component removal, rather than disabling it during the integration patch period.
 
install.wim = 2.8gb is easily achievable on a captured wim after it has been cleaned(no component removals - just a clean up) and the install size is usually around 2.5 times the size of the install wim.
 
Yes, but only if no patches have been installed. After installing the patch, especially for ancient systems like 1607, the size of Wim approaches 5GB.
 
that is a fully updated wim with net3.5 enabled and net 4.8 installed and no language packs.
 
How did you do it? For ltsc2021, Accumulated updates,. net3.5,. net updates add up to approximately 900MB. After adding them and clearing 'customization',, the WIM image will be 4.16GB。
 
1809 and w7. and that IS, not a "will be" which is a guess/estimate. 17763.1 iso using only the latest updates availible at the time.
 
Win7 can achieve this. For LTSC2019, perhaps we are not using the same version? It is even larger than LTSC2021.
My 'will be' refers to the meaning after completing something, not a zombie. Perhaps our statements are different.
 
it can be done in ntlite by disabling the component stack.
Yes, just uncheck Servicing Stack in Compatibility. I didn't suggest this because I thought you had already tried it. Even so there are still many files and folders in WinSxS that are left over. But just with this the size of install.wim is reduced a lot.

After installing the patch, especially for ancient systems like 1607, the size of Wim approaches 5GB.
Here LTSB 2016 (version 1607) with updates and .net 4.8 with updates and dism /resetbase the install.wim is 2.93 GB.

For LTSC2019, perhaps we are not using the same version? It is even larger than LTSC2021.
You mean bigger after updates right? LTSC 2021 is actually much bigger because it has Edge and updates in the official ISO and LTSC 2019 doesn't.

You are probably using Custom clean update in NTLite, which in builds before version 1903 does not clean almost anything because in version 1903 there was a change in how the cleanup is done using Dism, NTLite was adjusted for this too but apparently did not keep the old way for the older builds. It is better to use Dism Compatible instead (or Dism ResetBase but I do not know if this is done correctly) although it will take a long time due to the compression of the files instead of the removal.

In builds before 1903 it is necessary to do a reg tweak and use 2 dism commands in sequence to do the resetbase (removal of superseded files instead of compression)

https://forums.mydigitallife.net/posts/1356912/
https://forums.mydigitallife.net/posts/1396708/

Code:
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\SideBySide\Configuration]
"DisableResetbase"=dword:00000000
"SupersededActions"=dword:00000001

Code:
Dism /Image:C:\Mount /Cleanup-Image /StartComponentCleanup
Dism /Image:C:\Mount /Cleanup-Image /StartComponentCleanup /ResetBase

Logically you have to change C:\Mount to the path where the image is mounted.

In version 1903 or higher this will break the installation/integration of cumulative updates.

Better to use W10UI by abbodi1406 which detects the build version and uses the best mode automatically and safely and integrates all updates too.


PS:

If you uncheck Servicing Stack in Compatibility you can use Custom clean update which will remove files correctly from what I remember.

In version 1903 and later Dism Compatible is fast and removes superseded files from cumulative updates, just not from .net updates.
 
Last edited:
You are probably using Custom clean update in NTLite, which in builds before version 1903 does not clean almost anything because in version 1903 there was a change in how the cleanup is done using Dism, NTLite was adjusted for this too but apparently did not keep the old way for the older builds. It is better to use Dism Compatible instead (or Dism ResetBase but I do not know if this is done correctly) although it will take a long time due to the compression of the files instead of the removal.
Thank you very much for so many methods and solving my confusion, AeonX. This question has been bothering me until now. After reading your proposal, I think my mistake is that I never tried dism /resetbase and ignored the difference between the new and old versions.
Yes, the cleaning up after unchecking the Servicing Stack in Compatibility is not deep enough. I used ntlite's custom to clean up ltsb2016, which took a lot of time compared to the new version. After your answer, I learned that the custom cleaning of ntlite was not reserved for older versions because I did not use older versions. I was going to try to download the older version, but I guess I'll run into licensing issues.
I always thought that ntlite's custom cleaning was deeper than dism /resetbase, but that was wrong. Let me try your and abbodi1406 professional program. I'll use both dism and resetbase and custom to clean it up.
Thank you so much for your professional approach! This has helped me tremendously.
 
Last edited:
Thanks, this works very well for ltsb2016, after running the dism-resetbase command, the wim size is reduced by about 1.4GB, but the consequence is that the patch cannot be uninstalled, but this does not affect the use at all. Prior to this, it exceeded 4GB and could not be stored in the USB flash drive of the PE of fat32.
 
Last edited:
I always thought that ntlite's custom cleaning was deeper than dism /resetbase
In general it's pretty close when it's not broken lol in older versions of Windows 10 this is broken, unfortunately.

but the consequence is that the patch cannot be uninstalled
Yes, this is a direct consequence of using the /ResetBase switch in the Dism command. It breaks the Reset this PC feature as well.

To avoid this you can try the Dism Compatible option in NTLite or the command below without the reg tweaks (both are equivalent):
Code:
Dism /Image:C:\Mount /Cleanup-Image /StartComponentCleanup

But it will take much longer and reduce the size less.
 
Back
Top