How to clean the Component Store in an offline image

Discussion in 'Scripting' started by ceo54, May 16, 2020.

  1. ceo54

    ceo54 MDL Senior Member

    Aug 13, 2015
    341
    61
    10
    Hi,

    I only update my image offline. With a CU every month, it's a hassle to audit, sysprep and capture the image. It would be quite easy if I can just mount the image, integrate the updates, cleanup the component store and be done with it.

    The problem is whenever I try to cleanup the component store after integrating monthly rollups, it complains about pending.xml in WinSxS and skips. System requires a restart.

    So, does anyone know a workaround ? any scripts, utilities that could do this ?

    Any help will be greatly appreciated.
    Thank you for reading.
     
  2. Enthousiast

    Enthousiast MDL Tester

    Oct 30, 2009
    32,276
    51,236
    450
    Why don't you just use a smart updates integration solution like W8UI/W10UI (you didn't specify for what windows you ask) for that?

    It does a smart /resetbase.

    Manually it's (8/10 only and no pending flags):

    Code:
    Dism /Image:x:\Mount /Cleanup-Image /StartComponentCleanup /ResetBase
    
    For this to do a full /resetbase, you will have to enable /resetbase in the registry, it's disabled by default.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. ceo54

    ceo54 MDL Senior Member

    Aug 13, 2015
    341
    61
    10
    Hi Enthousiast,

    Thank you for the response bud. Could you point me any such projects I can learn and grab. BTW, I'm asking for both 8.1 and Win 10

    Also, this registry key that you mentioned, could you please point out the location so I can toggle it ?
     
  4. Enthousiast

    Enthousiast MDL Tester

    Oct 30, 2009
    32,276
    51,236
    450
    Most of the tools by @abbodi1406 can be found here:
    abbodi1406's Batch Scripts Repo

    Resetbase disabled:
    Code:
    Windows Registry Editor Version 5.00
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\SideBySide\Configuration]
    "DisableResetbase"=dword:00000001
    set to:

    Resetbase enabled:
    Code:
    Windows Registry Editor Version 5.00
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\SideBySide\Configuration]
    "DisableResetbase"=dword:00000000
    The mentioned Windows Update Installer cmds do this automated and know when it has to skip it for the LCU (1903/9 and up), to avoid future problems with it.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. ceo54

    ceo54 MDL Senior Member

    Aug 13, 2015
    341
    61
    10
    Thank you for the help bud. Apparently restart is a mandatory step which has no workarounds.

    This is from the @abbodi1406 script
    Code:
    # Perform pending cleanup operation for online OS after restarting
    Thanks for the help anyways.
     
  6. Enthousiast

    Enthousiast MDL Tester

    Oct 30, 2009
    32,276
    51,236
    450
    That's for online usage, you asked for offline images:thinking:
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. MARKZ1ON

    MARKZ1ON MDL Junior Member

    May 22, 2020
    51
    2
    0
    @Enthousiast i also do Sysprep to customize my OS install. i usually start from scratch of capturing the image whenver there's a new update. Does W10UI support it? Let's say I currently have an image with LTSC 1809 (1294). Can I use that customized image for W10UI to integrate future updates?
     
  8. Enthousiast

    Enthousiast MDL Tester

    Oct 30, 2009
    32,276
    51,236
    450
    I would not reccomend that but it should work.

    What i always did is:

    - Update the clean base wim (Home index) with W10UI and the most current updates
    - Install in audit mode in vmware
    - Install dx9c
    - Sysprep/generalize/show oobe/shutdown
    - Capture it and use the exclusion list by @abbodi1406
    - Set-edition Home to all higher SKUs
    - Compress install.wim to install.esd (or swm if the esd is getting over 4GB)
    - Replace the original wim with the install.esd/swm
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  9. MARKZ1ON

    MARKZ1ON MDL Junior Member

    May 22, 2020
    51
    2
    0
    Thanks for sharing your route for capturing an image. Though I only use LTSC, is there a reason behind using Home as base image? Also Dx9?
     
  10. Enthousiast

    Enthousiast MDL Tester

    Oct 30, 2009
    32,276
    51,236
    450
    No, for LTSC you need LTSC, can't be made from home, overlooked that line :)

    But the procedure will be the same for audit install and sysprep/capture. Dx9c is sometimes needed for older games.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  11. MARKZ1ON

    MARKZ1ON MDL Junior Member

    May 22, 2020
    51
    2
    0
    thanks. i have not tried an ESD, my WIM results are usually around 6.35 GB. Is there a tool to convert?
     
  12. Enthousiast

    Enthousiast MDL Tester

    Oct 30, 2009
    32,276
    51,236
    450
    Not an ESD but an install.esd, something different.

    WIM <> ESD

    Although the tool is called WIM <> ESD but it means: install.wim <> install.esd :D
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  13. MARKZ1ON

    MARKZ1ON MDL Junior Member

    May 22, 2020
    51
    2
    0
    Got it! I will give it a try since there a new update for 1809. Thanks,