1. inTerActionVRI

    inTerActionVRI MDL Expert

    Sep 23, 2009
    1,748
    3,575
    60
    New Packs.

    NET3
    NET6
    PowerShell7

    This was the ones I realized in the repository.

    This NET3 will only be possible to integrate with the update for Toolkit 12.3, as the pack is in TPK format for W10 and W11. I imagine MSMG has made this pack in order to remedy the integration problem that generates "pending.xml".

    If this is possible, this is very good.
    These are just assumptions.
     
  2. graver.x

    graver.x MDL Senior Member

    Jan 18, 2020
    347
    484
    10
    #22782 graver.x, Jun 5, 2022
    Last edited: Jun 5, 2022
    I don't see your actions when using Toolkit, so I can't know what you are doing wrong.

    And what is "Pacote Package" in your removal process?
    I noticed an error in your list: "Microsoft-Windows-PowerShell-ISE-FOD~31bf3856ad364e35~amd64" instead of "Microsoft-Windows-PowerShell-ISE-FOD-Package~31bf3856ad364e35~amd64".

    Toolkit Menu: [3] Remove -> [3] Remove Windows Components Using Package List -> [1] Remove Windows Components Using Package List (DISM Method):

    Code:
    ===============================================================================
            MSMG ToolKit - Remove Windows Components Using Package List
    ===============================================================================
    
    -------------------------------------------------------------------------------
    ####Starting Removing Windows Components Using Package List####################
    -------------------------------------------------------------------------------
    
        Image                    : Install.wim
        Image Index              : 1
        Image Architecture       : x64
        Image Version            : 10.0.19044.1741.0
    
    -------------------------------------------------------------------------------
    ####Removing Windows Components Using Package List#############################
    -------------------------------------------------------------------------------
    
    ===========================[Install.wim, Index : 1]============================
    -------------------------------------------------------------------------------
    Removing Microsoft-Windows-PowerShell-ISE-FOD-Package~31bf3856ad364e35~amd64 Package...
    -------------------------------------------------------------------------------
    
    Deployment Image Servicing and Management tool
    Version: 10.0.22598.1
    
    Image Version: 10.0.19044.1741
    
    Processing 1 of 1 - Removing package Microsoft-Windows-PowerShell-ISE-FOD-Package~31bf3856ad364e35~amd64~~10.0.19041.1
    [==========================100.0%==========================]
    The operation completed successfully.
    
    -------------------------------------------------------------------------------
    Removing Microsoft-Windows-PowerShell-ISE-FOD-Package~31bf3856ad364e35~wow64 Package...
    -------------------------------------------------------------------------------
    
    The specified package has already been removed...
    
    -------------------------------------------------------------------------------
    Removing Microsoft-Windows-PowerShell-V2-Client-Package~31bf3856ad364e35~amd64 Package...
    -------------------------------------------------------------------------------
    
    Deployment Image Servicing and Management tool
    Version: 10.0.22598.1
    
    Image Version: 10.0.19044.1741
    
    Processing 1 of 1 - Removing package Microsoft-Windows-PowerShell-V2-Client-Package~31bf3856ad364e35~amd64~~10.0.19041.1023
    [==========================100.0%==========================]
    The operation completed successfully.
    
    -------------------------------------------------------------------------------
    ####Finished Removing Windows Components Using Package List####################
    -------------------------------------------------------------------------------
    
    ===============================================================================
    
    Для продолжения нажмите любую клавишу . . .
    

    ~wow64 Package - obviously is a dependent package, and is removed automatically along with ~amd64 Package, so you can make a list easier:
    Code:
    ; PowerShell-ISE-FOD
    Microsoft-Windows-PowerShell-ISE-FOD-Package
    
    ; PowerShell-V2 (older version)
    Microsoft-Windows-PowerShell-V2-Client-Package
     
  3. bala1

    bala1 MDL Member

    May 2, 2015
    179
    150
    10
    I made a mistake, sorry, now it works! Thanks
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. Garry Korep

    Garry Korep MDL Novice

    Jan 20, 2022
    3
    2
    0
    #22784 Garry Korep, Jun 5, 2022
    Last edited: Jun 5, 2022
    I'm having an issue with Cumulative Windows Update (KB5013942) - it fails to install (getting an error during installation). Regular updates were installing fine

    Windows 10 21H2 stock installation image was customized with MSMG 12.1 - all Windows components were removed except this

    OfflineFiles
    OpenSSH
    RemoteDesktopClient
    RemoteDifferentialCompression
    SimpleTCPIPServices
    TelnetClient
    TFTPClient
    RemoteDesktopServer
    RemoteRegistry
    WorkFoldersClient
    ProjFS
    StorageSpaces

    MSMG ToolKit

    During troubleshooting - I found report that this issue could be due to missing Windows Store Apps. So I tried creating a second image that had all of the Windows Store Apps preserved. However Cumulative Update still fails.

    Any ideas?
     
  5. bala1

    bala1 MDL Member

    May 2, 2015
    179
    150
    10
    Does anyone know how to remove through the Toolkit the "mip.exe" "Math Input Panel" is in Windows Accessories, appeared here in iso 19044.1739
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. graver.x

    graver.x MDL Senior Member

    Jan 18, 2020
    347
    484
    10
  7. graver.x

    graver.x MDL Senior Member

    Jan 18, 2020
    347
    484
    10
    You can remove it using the DISM method by adding to RemovePkgsList.txt the following packages:
    Code:
    ; TabletPCMath
    Microsoft-Windows-TabletPCMath-Package
    microsoft-windows-tabletpcmath-package-Wrapper
     
  8. inTerActionVRI

    inTerActionVRI MDL Expert

    Sep 23, 2009
    1,748
    3,575
    60
    My assumption was wrong.

    So I think MSMG put an appropriate name, so there was no confusion.
    That NET3 was renamed NETCore31.

    And new Toolkit.cmd to support this integration.

    @MSMG,
    In today's Toolkit.cmd.

    In :IntWindowsSetupMediaUpdates
    from
    set "ImageDefaultLanguage=%ImageDefaultLanguage:~1,-10%"
    to
    set "ImageDefaultLanguage=!ImageDefaultLanguage:~1!"
     
  9. sergey130270

    sergey130270 MDL Senior Member

    May 15, 2014
    275
    295
    10
  10. graver.x

    graver.x MDL Senior Member

    Jan 18, 2020
    347
    484
    10
    #22791 graver.x, Jun 6, 2022
    Last edited: Jun 6, 2022
    The main thing is that before removing components, you first need to update the image to the CU version that the specific version of ToolkitHelper supports. Otherwise, you will get the same Windows Update errors when trying to install CU, as well as possible SFC errors, and just because the ToolkitHelper is "new", there will be little use.. :)

    But also need to remember that in Win10 v1903-v1909-v2004-v20H2-v21H1-21H2 and in Win11 v21H2-v22H2, after installing CU, previously removed components (except WindowsApps) are returned, this is due to the new update format. Therefore, it is worth considering whether it makes sense to update the system using an online CU installation after removing the components...

    If you really, really want to, you can try to create an updated image using the same presets, and then perform an "in-place update" of the Upgrade type with the preservation of user programs, files and settings. But I don't practice this option, so I can't give you a guarantee that with your list of components to be removed, such an update will be successful.
    Users who have such experience may tell you how successful it is.
     
  11. graver.x

    graver.x MDL Senior Member

    Jan 18, 2020
    347
    484
    10
    #22792 graver.x, Jun 6, 2022
    Last edited: Jun 6, 2022
    I think adding the NETCore 3.1 package is very good and right. Since some programs require a fixed version of NETCore v3.1 LTS. Those who need this version have to install it later, or look for alternative options for integration into ISO.
    By the way, "NETCore 3.1" - is the right name.
     
  12. inTerActionVRI

    inTerActionVRI MDL Expert

    Sep 23, 2009
    1,748
    3,575
    60
    #22793 inTerActionVRI, Jun 6, 2022
    Last edited: Jun 7, 2022
    @MSMG,

    When I was doing the tests to use Wimlib-Imagex to convert to ESD, I went on suffering by waiting for conversion to finish in this mode below.

    Code:
    echo.
    echo.-------------------------------------------------------------------------------
    echo.####Converting WIM Image to ESD Image##########################################
    echo.-------------------------------------------------------------------------------
    
    :: Exporting Source Image to ESD Image
    for %%i in (%ImageIndexNo%) do (
       rem call :ExportImageIndex "%InstallWim%", %%i, "%InstallEsd%", "ESD", "No"
       echo.
       %WimlibImagex% export "%InstallWim%" %%i "%InstallEsd%" --compress=LZMS --solid
       echo.
    )
    

    I found it better and faster, compress exported indexes with (--compress=LZX), creating a install.WIM in the Temp folder and then create the ESD with the "All" argument.
    Code:
    echo.
    echo.-------------------------------------------------------------------------------
    echo.####Converting WIM Image to ESD Image##########################################
    echo.-------------------------------------------------------------------------------
    
    :: Exporting Source Image to ESD Image
    for %%i in (%ImageIndexNo%) do (
       rem call :ExportImageIndex "%InstallWim%", %%i, "%InstallEsd%", "ESD", "No"
       echo.
       %WimlibImagex% export "%InstallWim%" %%i "%Temp%\install.wim" --compress=LZX
       echo.
    )
    move /y "%Temp%\install.wim" "%InstallWim%" >nul
    %WimlibImagex% export "%InstallWim%" all "%InstallEsd%" --compress=LZMS --solid
    echo.
    if exist "%InstallEsd%" call :RemoveFile "%InstallWim%"
    
    But it will be interesting for you to test and check if this is plusible. Maybe in your machine it happens different. Faster than in mine, I may have tested so that something went wrong.

    I only know that exporting the indexes directly to install.ESD, crashed everything here.
     
  13. Garry Korep

    Garry Korep MDL Novice

    Jan 20, 2022
    3
    2
    0
    Thank you! This saved me from more frustrating experimentation, as I was going to remove components from stock 21H2 Win 10 Pro and then try to update using Windows Update. I see now that getting Windows Update to work would be more involved.

    For the background - I'm trying to trim down deployed windows size as much as possible to run on a Chromebook with only 16GB eMMC drive (that is soldered on to the motherboard). Without MSMG tool - I trimmed regular windows installation to about 10GB after all the updates (disable hibernation, disable swap, turn on OS compression, run dism cleanup after updates), which left 5GB for data and programs.
    Sounds like it would be best to disable Update if I want to trim windows more by removing components (which is probably fine for that Chromebook use case, can just periodically reinstall OS with new feature updates).
     
  14. sergey130270

    sergey130270 MDL Senior Member

    May 15, 2014
    275
    295
    10
    Hello! People Kind help me please, is it possible to remake the code in this script so that the WA-Addons from abbodi1406 are in a folder called addon and unpacked there, into the addon folder? Help me please.
    Code:
    cd /d "%~dp0"
    set /a _t=0
    set /a _c=0
    if exist "*.WA" for /f "delims=" %%# in ('dir /b /os *.WA') do call set /a _t+=1
    if %_t% equ 0 exit /b
    for /f "delims=" %%# in ('dir /b /os *.WA') do (set "addon=%%#"&set "dest=%%~n#"&call :prepare)
    echo.
    echo Done.
    echo Press any key to exit.
    pause >nul
    exit /b

    :prepare
    if exist "%dest%" (
    if exist "%dest%\Registry\NSudoC.exe" (exit /b) else (rd /s /q "%dest%")
    )
    set /a _c+=1
    echo %_c%/%_t%: %addon%
    echo.
    bin\7zr x "%addon%" -o"%dest%" * -r >nul
    if not exist "%dest%\Tasks.txt" rd /s /q "%dest%"&exit /b
    md "%dest%\Registry\"
    copy /y bin\NSudoC.exe "%dest%\Registry\" >nul
    copy /y bin\Integrator.cmd "%dest%\" >nul
    copy /y bin\Reg2Wim.cmd "%dest%\" >nul
    pushd "%dest%\"
    findstr /i ".dll" Tasks.txt >nul && for /f "tokens=1,2 delims=:" %%a in ('findstr /i ".dll" Tasks.txt') do (
    if not exist "Files\%%b" md "Files\%%b"
    move /y "%%a" "Files\%%b\" >nul
    )
    for /f "tokens=1,2 delims=:" %%a in ('findstr /i ":" Tasks.txt ^|findstr /i /v ".dll"') do (
    if not exist "Files\%%b" md "Files\%%b"
    move /y "%%a" "Files\%%b\" >nul
    )
    for /f "delims=" %%# in ('dir /b *.reg') do call Reg2Wim.cmd %%#
    move /y *.reg Registry\ >nul
    del /f /q Reg2Wim.cmd Tasks.txt
    popd
    exit /b
     
  15. inTerActionVRI

    inTerActionVRI MDL Expert

    Sep 23, 2009
    1,748
    3,575
    60
    Where the code should work in the addons folder start the code using:

    Maybe
    set "addons=%~dp0addons"

    cd /d "%addons%"

    At the end of the block return to the script root folder with:
    cd /d "%~dp0"

    or use pushd
    popd

    Or I did not understand it right, what would be your question.
     
  16. sergey130270

    sergey130270 MDL Senior Member

    May 15, 2014
    275
    295
    10
  17. mhussain

    mhussain MDL Senior Member

    Oct 1, 2012
    368
    144
    10
    hi,
    it is sed that you should not use dism and tk ways to remove packages one after another, only one
    could someone explain why?
    also is it possible to use dism and tk and a thurd party tool for the components that are not as yet supported by the toolkit?
    tk stands for toolkit. least for me.
    thanks for your answers in advanse
     
  18. inTerActionVRI

    inTerActionVRI MDL Expert

    Sep 23, 2009
    1,748
    3,575
    60
    #22800 inTerActionVRI, Jun 6, 2022
    Last edited: Jun 6, 2022
    @MSMG,
    There is an optimization command to avoid the need to export to the Temp folder and move back.
    With the "Wimlib-Imagex optimize" command, there is the display of size info, from before and after optimization.
    But with the "Wimlib-Imagex export" command, the display of this information does not occur.
    Code:
    echo.-------------------------------------------------------------------------------
    echo.####Optimizing Source WIM Image################################################
    echo.-------------------------------------------------------------------------------
    rem call :ExportImage "%InstallWim%", "%Temp%\rebuild.wim", "WIM", "No"
    echo.
    %WimlibImagex% export "%InstallWim%" all "%Temp%\rebuild.wim" --compress=LZX
    echo.
    move /y "%Temp%\rebuild.wim" "%InstallWim%" >nul
    echo.-------------------------------------------------------------------------------
    echo.####Finished Optimizing Source WIM Image#######################################
    echo.-------------------------------------------------------------------------------
    
    I put the "optimize" command because I prefer to see this image size information. Then, as a curiosity, follows the "optimize" command block:
    Code:
    echo.-------------------------------------------------------------------------------
    echo.####Optimizing Source WIM Image################################################
    echo.-------------------------------------------------------------------------------
    rem call :ExportImage "%InstallWim%", "%_TMP%\rebuildinstall.wim", "WIM", "No", %CompressParam%
    echo.
    if exist "%InstallWim%" %WimLibImagex% optimize "%InstallWim%"
    echo.
    echo.-------------------------------------------------------------------------------
    echo.####Finished Optimizing Source WIM Image#######################################
    echo.-------------------------------------------------------------------------------
    
    Optimize may be interesting to use in "boot.wim" and "winre.wim" and if "%TrimEditions%" equ "No" for "install.wim".
    But it will be with image size information before and after optimization.

    Code:
    -------------------------------------------------------------------------------
    Optimizing Source [install.wim Image] with Maximum Compression...
    -------------------------------------------------------------------------------
    
    Using LZX compression with 8 threads
    Archiving file data: 11 GiB of 11 GiB (100%) done
    
    -------------------------------------------------------------------------------
    ####Finished Optimizing Source WIM Image#######################################
    -------------------------------------------------------------------------------
    
    Code:
    -------------------------------------------------------------------------------
    Optimizing Source [boot.wim] Image with Maximum Compression...
    -------------------------------------------------------------------------------
    "C:\TK\InstallMedia\sources\boot.wim" original size: 562343 KiB
    Using LZX compression with 8 threads
    Archiving file data: 1303 MiB of 1303 MiB (100%) done
    Calculating integrity table for WIM: 548 MiB of 548 MiB (100%) done
    "C:\TK\InstallMedia\sources\boot.wim" optimized size: 561684 KiB
    Space saved: 659 KiB
    
    -------------------------------------------------------------------------------
    Optimizing Source [install.wim Image] with Maximum Compression...
    -------------------------------------------------------------------------------
    
    "C:\TK\InstallMedia\sources\install.wim" original size: 5876661 KiB
    Using LZX compression with 8 threads
    Archiving file data: 11 GiB of 11 GiB (100%) done
    Calculating integrity table for WIM: 5731 MiB of 5731 MiB (100%) done
    "C:\TK\InstallMedia\sources\install.wim" optimized size: 5869185 KiB
    Space saved: 7475 KiB
    
    -------------------------------------------------------------------------------
    ####Finished Optimizing Source WIM Image#######################################
    -------------------------------------------------------------------------------
    



    In :ExtractSourceStoreESD label
    In this case of "boot.wim", for Capture Image, should the argument to "call :CaptureImage" be "Yes"?
    from:
    Code:
    call :CaptureImage "%BootWim%", "%Temp%\ESD", "BootWim", "BootWim", "No" >nul
    
    to:
    Code:
    call :CaptureImage "%BootWim%", "%Temp%\ESD", "BootWim", "BootWim", "Yes" >nul
    
    And, you did not implement Wimlib-Imagex commands.




    As friend @mhussain said, it would be interesting to be able to use a list to RemovePkgsList for DISM and another for ToolkitHelper, without having to exclude one to use the other.

    I think it is simpler to add to DISM because just add a line and change the use code for the list.

    add:
    Code:
    set "RemovePkgsList_DISM=%Lists%\RemovePkgsList_DISM.txt"
    
    change from:
    Code:
           if "%RemovalMethod%" equ "DISM" (
               for /f %%z IN ('"type %RemovePkgsList%" 2^>nul') do (
                   call :RemoveLockedPackage "%InstallMount%\%%i", %%z, %%z
               )
           )
    
           if "%RemovalMethod%" equ "ToolKitHelper" (
               echo.
               %ToolKitHelper% "%InstallMount%\%%i" "%RemovePkgsList%"
               echo.
           )
    
    to:
    Code:
           if "%RemovalMethod%" equ "DISM" (
               for /f "eol=# tokens=*" %%z in ('type "%RemovePkgsList_DISM%" 2^>nul') do (
                   call :RemoveLockedPackage "%InstallMount%\%%i", %%z, %%z
               )
           )
    
           if "%RemovalMethod%" equ "ToolkitHelper" (
               set Components=
               for /f "eol=# tokens=*" %%z in ('type "%RemovePkgsList%" 2^>nul') do (
                   set "Components=!Components!,%%z"
               )
               set "Components=!Components:~1!"
               echo.
               echo.
               %ToolKitHelper% "%InstallMount%\%%i" "!Components!"
               set Components=
           )
    
    And, put a for loop with eol=#, in RemovalMethod=ToolkitHelper, so that the guys can comment (mark with # at the beginning of the line the components that must remain) on the list instead of excluding components from it. This makes it easier to edit the Custom Lists.

    EDITED