Jump to content











Photo
- - - - -

Reducing Win10 and older OSs footprint

wimlib-imagex wimlib-clc winsxs_reduce

  • Please log in to reply
259 replies to this topic

#26 alacran

alacran

    Gold Member

  • .script developer
  • 1623 posts
  •  
    Mexico

Posted 2 weeks ago


@everyone of good intellect&understanding

i guess healthy competition for the smallest os, which, believe me, is useful, and not only a curiosity, must be gauged on the wim, not on the vhd. I have the smallest 19041/2 264 build combo (vhd+wim) below 3gb put together (of course vhd.gz 15megs). all this was done with my chopping sequence, which could be coupled with any further and wider chopping. of course. I am now trying an older version. I can easily keep my chopping under control, even though it was decided against, but no prob, i will let u know. the only problem is time.

 

All tests made on a VHD so far, are to verify the undesired concecuences (if any), And find the way to prevent them (if exists).

 

There is no need to do it manually on final VHD every time you make a new installation on VHD, all brute force chopping made on previous test, can be included on your WimBootCompress.ini under [ExclusionList] section, and it will do it for you during re-capture.

 

If you want to reduce WinSxS folder, do it before re-capture and then copy back your desired Manifests folder (if required).

 

From quote on first post:

 

Then any files/folders added by the user to [ExclusionList] section will not be included on the new WIM file (no matter the consequences), edit it wisely to avoid future troubles after apply the new WIM on a new installation.

 

In fact it is as a chopping by brute force.

 

As already said, all included in that [ExclusionList] section will not be copied to the new WIM file, and then obviously will make the WIM file smaller and in consecuence also the final Normal, Compact or Wimboot installation on VHD will be smaller too.

 

I suggest to add your desired lines right on top of the list to easy find them latter.

 

As an example:

 

Let's say you want to cut: Windows\SysWOW64 folder and Windows\Microsoft.NET folder

 

Then just adding following two lines on blue, will not copy those folders when re-capturing:

 

\Windows\SysWOW64\*   >>> This means DO NOT copy Windows\SysWOW64 folder and all its content to the WIM

\Windows\Microsoft.NET\*   >>> This means DO NOT copy Windows\Microsoft.NET folder and all its content to the WIM

 

NOTE: Only included 5 lines from the [ExclusionList] to make the example shorter.

 

Your list will be like this:

 

[ExclusionList]

\Windows\SysWOW64\*

\Windows\Microsoft.NET\*
\MSOCache\*
\Recovery\*
\$bootdrive$
\$dwnlvldrive$
\$lsdrive$
........

 

alacran



#27 antonino61

antonino61

    Silver Member

  • Advanced user
  • 876 posts
  •  
    Italy

Posted 2 weeks ago

how about file content sparse and scattered all over the drive?

not everything to be chopped by brute force is concentrated in folders and subfolders. how long should this list be? I will make it, if need be. I got it all written and it has not caused any trouble. will the registry chopping be carried out manually later?



#28 alacran

alacran

    Gold Member

  • .script developer
  • 1623 posts
  •  
    Mexico

Posted 2 weeks ago

Easy way to chop/modify your install.wim

I will ilustrate this with a sample, let's say we want to remove the SysWOW64 folder.

 

Procedure:

 

First and to keep our install ISO or USB device unchanged we will extact from the install.wim the selected index, in this case I selected Pro version.

 

1 - Mount the ISO and run wimlib-clc, on Extract/Verify tab select sources\install.wim, the Pro version and the path to extract it, and click on EXTRACT button, as in picture 1-Export.png (once the process finish you can unmount your ISO).

 

2 - Now we select on wimlib-clc the extracted install.wim and on Update tab Filter we write SysWOW64, and display levels=2, and make a click on Find, see picture 2 - Find.png

 

3 - Then we make right click on \Windows\SysWOW64 and select Delete and make a click on UPDATE button, see picture 3 - Delete.png, and wait a few minutes to let the pocess finish.

 

4 - OPTIONAL: If we want to use the SysWOW64 folder from Win10XPE project we select Add Directory and the path to the (taken from mounted or extracted by 7-zip from your Win10XPE_x64) SysWOW64 folder and make a click on UPDATE button, see picture 4 - Add Directory.png, and wait a few minutes to let the process finish.

 

NOTE: We can do 3 and 4 on a single step if we select on 3 Replace Directory and the path to the new Directory.

 

5 - To Optimize our install.wim file on Export/Optimize tab we make a click on OPTIMIZE button, the file will be re-build to minimize its size

 

alacran

Attached Files


  • wimb likes this

#29 alacran

alacran

    Gold Member

  • .script developer
  • 1623 posts
  •  
    Mexico

Posted 2 weeks ago

Additional way to chop/modify your install.wim or boot.wim

 

I mainly use this approach when dealing with WinPE boot.wim files created with different projects, as sometimes certain files and folders are in unespected places and it is easier to navigate on the 7-zip File Manager than on wimlib-clc.

 

This is a not very well known capability of 7-zip I discovered some time ago, and I have used when creating certain Scripts for ChrisPE project requiring some dependencies as *.dll files, and just added them with 7-zip to the boot.wim on Windows\System32, Windows\SysWOW64 or on same folder of the program to not have to rebuild the boot.wim, of course I also edited the respective script to add the dependencies automatically on future builds.

From: https://www.7-zip.org/

 

Supported formats:

    Packing / unpacking: 7z, XZ, BZIP2, GZIP, TAR, ZIP and WIM
    Unpacking only: AR, ARJ, CAB, CHM, CPIO, CramFS, DMG, EXT, FAT, GPT, HFS, IHEX, ISO, LZH, LZMA, MBR, MSI, NSIS, NTFS, QCOW2, RAR, RPM, SquashFS, UDF, UEFI, VDI, VHD, VMDK, WIM, XAR and Z.

 

In fact 7-zip is only capable to create new WIM files not compressed, As I have tested.

 

But we can delete a file/folder and all info previously there will remain compressed, and also add a file/folder, but all we add will not be compressed.

 

Procedure:

Then after making as on previous Post the step No. 1,

A - To delete a file/folder we open the Wim file with 7-zip, find desired file/folder and delete it and acept 7-zip message, and the WIM container is updated.

B - To add a file/folder we open the Wim file with 7-zip, go to the locatation we want to add the folder/directory and we just drag and drop it and acept 7-zip message, and the WIM container is updated.

 

NOTE-1: This trick may not work if when you open the WIM file with 7-zip there is a Folder named Deleted on it. It is required to use wimlib-clc to Optimize the wim and then this Folder disappears.

NOTE-2: If running 7-zip from certain WinPEs sometimes this do not work as the script used to include/copy the files/folders or maybe editions to the registry during the project build do not contain all required.

NOTE-3: It is highly recommended to Optimize your Wim file (as on previous post step No.5) after making changes to it.

alacran

Attached Files


  • wimb and devdevadev like this

#30 alacran

alacran

    Gold Member

  • .script developer
  • 1623 posts
  •  
    Mexico

Posted 2 weeks ago

how about file content sparse and scattered all over the drive?

not everything to be chopped by brute force is concentrated in folders and subfolders. how long should this list be? I will make it, if need be. I got it all written and it has not caused any trouble. will the registry chopping be carried out manually later?

 

Just add them to the list with the right path, you can use wild cards, next some samples that already are on the current [ExclusionList] (use them as a guide):

 

\Windows\ServiceProfiles\LocalService\NTUSER.DAT*.TM.blf

\Windows\System32\config\*.TM.blf

\Windows\System32\SMI\Store\Machine\SCHEMA.DAT*.log*

\Windows\servicing\Sessions\*_*.xml

 

About the registry changes you have done, maybe it is not a bad idea to concentrate all of them on a (single or several) *.reg file(s) and run it(them) after boot.

 

alacran



#31 antonino61

antonino61

    Silver Member

  • Advanced user
  • 876 posts
  •  
    Italy

Posted 2 weeks ago

a subtraction reg file? add delete or reg delete stuff?



#32 wimb

wimb

    Platinum Member

  • Developer
  • 3058 posts
  • Interests:Boot and Install from USB
  •  
    Netherlands

Posted 2 weeks ago

My first test was to Add 1909 en-US version Win10XPE  folder SysWOW64 to Win10x64 2004 NL VHD,

but in that case there is no 32-bits support (version mismatch gives failure)

 

I have made Win_Reduce_Trusted that can in Mounted VHD Reduce WinSxS and SysWOW64 and Remove more folders / files (not yet ready)

Advantage is that it is very fast and easy to Reduce SysWOW64 in existing VHD and it is for sure that the files match

 

There is some 32-bits support, but as shown text inside programs is missing, but 32-bits FAB is working

 

Attached File  SysWOW64_2020-10-06_091934.jpg   31.72KB   0 downloads == Attached File  SysWOW64_sshot-1.png   472.96KB   0 downloads



#33 ReTokener

ReTokener

    Frequent Member

  • Developer
  • 264 posts

Posted 2 weeks ago

Dear wimb, you asked:

What is the origin of the rapid growth and what can I do after Windows Update to reduce the UsedSize down to say 6 GB ?

I tried to catch what new files are created upon Update 20-09 and which were deleted.

Maybe it helps to assess the need for the update.

 

Additional there is a table summing up filesizes.

 

Here are these files:

Attached File  10x64P_2004.rar   1.61MB   6 downloads

 

Regards   T.

 

 

 

 



#34 wimb

wimb

    Platinum Member

  • Developer
  • 3058 posts
  • Interests:Boot and Install from USB
  •  
    Netherlands

Posted 2 weeks ago

I tried to catch what new files are created upon Update 20-09 and which were deleted.

Maybe it helps to assess the need for the update.

 

Additional there is a table summing up filesizes.

 

Here are these files:

attachicon.gif10x64P_2004.rar

 

 

Thank you for the FileLists that give detailed info on what the 20-09 Update is doing.

 

In fact it is quite bad that version 2004 would need so extensive Update which about doubles the size of the Windows 10x64 OS.

 

I hope that some day we don't have to Update anymore Or in any case that Updates have a small size ....

 

How can I view the table with filesizes 10x64P_2004.ods ? Is it also available or easily convertable as 10x64P_2004.xls ?


  • ReTokener likes this

#35 alacran

alacran

    Gold Member

  • .script developer
  • 1623 posts
  •  
    Mexico

Posted 2 weeks ago

I haven't commented I edited Post No. 14

 

 

EDIT: The minimum files we need to keep are those allready on the wimre.wim + all added by the attached list.

 

Because I was making an improved new list, so far this is what I have done.

 

Attached the Folders and files lists made from my yesterday made Win10XPE_x64 boot.wim, and extracted the SysWOW64 folder to a folder on HD.

Source ISO was Win10_2004_Spanish(Mexico)_x64.iso, version is 10.0.19041.264, Index used was PRO.

 

Hope  you can make from this info a more complete list about what to keep, maybe for a first version you can include all the lang files/folders to test it, and latter (if you want) on a future versions an option to select at least 3 langs to keep (as in my case es-MX fall back laguages are es-ES and also en-US).

 

alacran

Attached Files



#36 alacran

alacran

    Gold Member

  • .script developer
  • 1623 posts
  •  
    Mexico

Posted 2 weeks ago

The EDIT made to post No.14 was to be consistent with info on post No.16 and worked fine.

 

 

I copied from my mounted Win10XPE_x64_LZX.vhd the SysWOW64 folder and now 32 bits programs are running fine.

 

alacran



#37 alacran

alacran

    Gold Member

  • .script developer
  • 1623 posts
  •  
    Mexico

Posted 2 weeks ago

How can I view the table with filesizes 10x64P_2004.ods ? Is it also available or easily convertable as 10x64P_2004.xls ?

Maybe this info can be useful: https://support.micr...fd-f5d61ed347cd

 

Or this online conversion tool: https://www.zamzar.c...ert/ods-to-xls/

 

alacran


  • ReTokener likes this

#38 ReTokener

ReTokener

    Frequent Member

  • Developer
  • 264 posts

Posted 2 weeks ago

Sorry for the unconvenience.

How can I view the table with filesizes 10x64P_2004.ods ? Is it also available or easily convertable as 10x64P_2004.xls ?

I tried to save as ".xls" file, but the list was truncated at line ~65000 for reason unknown.

The ".ods" file is "Open Office Document", created by Apache OpenOffice 4.

 

Regards   T.

 



#39 alacran

alacran

    Gold Member

  • .script developer
  • 1623 posts
  •  
    Mexico

Posted 2 weeks ago

a subtraction reg file? add delete or reg delete stuff?

 

From: https://support.micr...-by-using-a-reg

 

Deleting Registry Keys and Values To delete a registry key with a .reg file, put a hyphen (-) in front of the RegistryPath in the .reg file. For example, to delete the Test subkey from the following registry key:
HKEY_LOCAL_MACHINE\Software
put a hyphen in front of the following registry key in the .reg file:
HKEY_LOCAL_MACHINE\Software\Test
The following example has a .reg file that can perform this task.
[-HKEY_LOCAL_MACHINE\Software\Test]
To delete a registry value with a .reg file, put a hyphen (-) after the equals sign following the DataItemName in the .reg file. For example, to delete the TestValue registry value from the following registry key:
HKEY_LOCAL_MACHINE\Software\Test
put a hyphen after the "TestValue"= in the .reg file. The following example has a .reg file that can perform this task.
HKEY_LOCAL_MACHINE\Software\Test
"TestValue"=-
To create the .reg file, use Regedit.exe to export the registry key that you want to delete, and then use Notepad to edit the .reg file and insert the hyphen.

 

alacran



#40 wimb

wimb

    Platinum Member

  • Developer
  • 3058 posts
  • Interests:Boot and Install from USB
  •  
    Netherlands

Posted 2 weeks ago

32-bits Apps like WinNTSetup and BOOTICE are working now, thanks to alacran  :)

 

The working File_List to Reduce SysWOW64 folder is given in attachment as keep_wow64.txt

 

My 32-bits Office2003-2014 is Not yet working but it might be that a solution can be found ....

 

Win_Reduce_Trusted is working easy and fast and will be further improved to have options for Removal of Files / Folders that are working already OK ....

 

Attached File  SysWOW64_2020-10-06_132741.png   529.83KB   0 downloads

 

Attached File  keep_wow64.txt   35.37KB   8 downloads


  • alacran likes this

#41 antonino61

antonino61

    Silver Member

  • Advanced user
  • 876 posts
  •  
    Italy

Posted 2 weeks ago

will the reduction work even on the vhd, or should it be done on the wim for it to work?



#42 wimb

wimb

    Platinum Member

  • Developer
  • 3058 posts
  • Interests:Boot and Install from USB
  •  
    Netherlands

Posted 2 weeks ago

will the reduction work even on the vhd, or should it be done on the wim for it to work?

 

Sure the Reduction can be applied straight on Mounted VHD and VHD is booting OK.  :)

 

After Reduction if desired you can use VHD_WIMBOOT to Capture in WimBoot mode

and Apply as Compact LZX in small Expandable VHD (max 3-5 GB :unsure: ) for booting with Grub4dos in MBR BIOS mode from RAMDISK by using SVBus driver

Unfortunately there is No UEFI mode  RAMDISK booting for VHD, but in that case we must as usual rely on Win10XPE

 

Win_Reduce_Trusted has speed and ease of use comparable to WinSxS_Reduce_Trusted  :magic:

 

Remember we only Remove Files / Folders and keep the registry of Full Win10x64 untouched,

so everything is working as long as there are no missing files for the work that you do ....

We only need to know what are really the desired minimal core files of Win10x64 and that we can boot and have sufficient functionality like Win10XPE

But instead of Win10XPE we have a non volatile registry that we can modify e.g. for Install of small program or driver ....


  • antonino61 likes this

#43 antonino61

antonino61

    Silver Member

  • Advanced user
  • 876 posts
  •  
    Italy

Posted 2 weeks ago

sorry I musta been missin' out on something - where is Win_Reduce_Trusted? I guess I only have the one for winsxs, which is working splendidly.



#44 wimb

wimb

    Platinum Member

  • Developer
  • 3058 posts
  • Interests:Boot and Install from USB
  •  
    Netherlands

Posted 2 weeks ago

sorry I musta been missin' out on something - where is Win_Reduce_Trusted? I guess I only have the one for winsxs, which is working splendidly.

 

You are right, it is under construction and might appear in a few days .....

 

SysWOW64_2020-10-06_091934.jpg

  • ReTokener and antonino61 like this

#45 antonino61

antonino61

    Silver Member

  • Advanced user
  • 876 posts
  •  
    Italy

Posted 2 weeks ago

for the time being, just outta curiosity, as I am going on manually on a build - supposing I put something on the exclusion list which is not there anymore, because I am forgetful or other reasons, if the file or folder is not found, nothing bad will happen, is that correct?

 

btw, servicing can be deleted, the only thing on it being left there must be runasti, unless otherwise replaced. this refers to the exclusion list posts ago.



#46 wimb

wimb

    Platinum Member

  • Developer
  • 3058 posts
  • Interests:Boot and Install from USB
  •  
    Netherlands

Posted 2 weeks ago

Nothing bad will happen in case of file not found.

Sometimes (quite often) you can regain desired fuctionality by just adding the required missing files.



#47 antonino61

antonino61

    Silver Member

  • Advanced user
  • 876 posts
  •  
    Italy

Posted 2 weeks ago

ok wimb, thankya lots and ... be ready for a plethoric wimbootcompress.ini



#48 wimb

wimb

    Platinum Member

  • Developer
  • 3058 posts
  • Interests:Boot and Install from USB
  •  
    Netherlands

Posted 2 weeks ago

ok wimb, thankya lots and ... be ready for a plethoric wimbootcompress.ini

 

WimBootCompress.ini does Not change in my case .... You can only Capture and Apply files that at least are present .....In my case they are gone ...



#49 antonino61

antonino61

    Silver Member

  • Advanced user
  • 876 posts
  •  
    Italy

Posted 2 weeks ago

would u mind checking out mine when I have finished?



#50 wimb

wimb

    Platinum Member

  • Developer
  • 3058 posts
  • Interests:Boot and Install from USB
  •  
    Netherlands

Posted 2 weeks ago

would u mind checking out mine when I have finished?

 

Can you use Dir_List_x64.exe to make File_List_P.txt and Folder_List_P.txt of your VHD, assuming VHD is Mounted as Drive P:

 

Such File / Folder list can help me to make the lists for Win_Reduce_Trusted of files to keep and files / folders that can be removed.





Also tagged with one or more of these keywords: wimlib-imagex, wimlib-clc, winsxs_reduce

3 user(s) are reading this topic

1 members, 2 guests, 0 anonymous users


    wimb