Create WIM from installed system

Discussion in 'Windows 10' started by tavrez, Apr 11, 2018.

  1. tavrez

    tavrez MDL Senior Member

    Joined:
    Sep 28, 2015
    Messages:
    423
    Likes Received:
    287
    Trophy Points:
    10
    Hello guys,
    My sister usually broke his Windows and she ask me to re-install Windows for her, so I decided to create an image with everything(update, drivers, apps) pre installed on it, I know I can use DISM to integrate updates and drivers. But for installing apps, all I know is that I should install Windows and after installing programs create another WIM from it, I have two question here:
    1. Is this right order and all I need to do? Or there is a better alternate solution?
      • Install Windows.
      • Go into Audit Mode.
      • Install everything I want.
      • sysprep(with or without generalize?).
      • Boot into Windows Recovery and create image.
    2. How should I do last step(create image from installed Windows) ?

    As an extra question, can I do all of this for Windows 7?
     
  2. LatinMcG

    LatinMcG Bios Borker

    Joined:
    Feb 27, 2011
    Messages:
    5,710
    Likes Received:
    1,594
    Trophy Points:
    180
  3. 2cmp

    2cmp MDL Junior Member

    Joined:
    Apr 2, 2018
    Messages:
    66
    Likes Received:
    34
    Trophy Points:
    0
  4. Enthousiast

    Enthousiast MDL Tester

    Joined:
    Oct 30, 2009
    Messages:
    35,561
    Likes Received:
    59,622
    Trophy Points:
    450
    After sysprep is finished, boot from a winpe image with imagex onboard and capture the sysprepped install to an install.wim.
     
  5. dhjohns

    dhjohns MDL Guru

    Joined:
    Sep 5, 2013
    Messages:
    3,275
    Likes Received:
    1,735
    Trophy Points:
    120
    Here is how I do it after sysprep is finished. Change paths to your own.
    Code:
    dism /capture-image /imagefile:D:\install.wim /capturedir:K:\ /name:"AnyName" /compress:maximum /checkintegrity /verify /bootable
     
  6. Enthousiast

    Enthousiast MDL Tester

    Joined:
    Oct 30, 2009
    Messages:
    35,561
    Likes Received:
    59,622
    Trophy Points:
    450
  7. GodHand

    GodHand MDL Addicted

    Joined:
    Jul 15, 2016
    Messages:
    534
    Likes Received:
    880
    Trophy Points:
    30
    Do not update or install apps during Sysprep if you're using the Generalize/Copy-Profile options (which undoubtedly you will be).

    You can boot into Sysprep, set everything up like you need, and to re-capture the image you have a few options:

    1) Create a generic WinPE with ImageX on it and load command-prompt, then capture it.
    2) There are quite a few free imaging software programs out there like Macrium Reflect Home free edition where it gives you an option to add its WinPE to the boot menu. Then when you run Sysprep.exe with /shutdown /oobe /generalize, you can reboot the system into its WinPE environment, and make a full disk image.

    From there you can either restore that disk image again using the WinPE environment, or what I prefer, mount the Macrium image on a working system, where it will assign itself a drive letter like a regular disk/VHD, and then use whatever capture tool you want to capture that image into a .WIM file.
     
  8. GodHand

    GodHand MDL Addicted

    Joined:
    Jul 15, 2016
    Messages:
    534
    Likes Received:
    880
    Trophy Points:
    30
    Do not use the bootable flag. That is reserved for WinPE only.
     
  9. kuroda

    kuroda MDL Senior Member

    Joined:
    Aug 25, 2012
    Messages:
    445
    Likes Received:
    32
    Trophy Points:
    10
    ....
    once time ago abbodi and Enthousiat showed the wimscript.ini exclusion file to use in the imagex i not remember anymore.... ,anyone have this file for use in rs4?
     
  10. abbodi1406

    abbodi1406 MDL KB0000001

    Joined:
    Feb 19, 2011
    Messages:
    12,067
    Likes Received:
    55,424
    Trophy Points:
    340
    Code:
    [ExclusionList]
    \hiberfil.sys
    \pagefile.sys
    \swapfile.sys
    \System Volume Information
    \$Recycle.Bin\*
    \Recycler
    \Recycled
    \Windows\CSC
    \winpepge.sys
    \$windows.~ls
    \$windows.~bt
    \Boot
    \Recovery
    \Recovery.txt
    \bootsect.bak
    \ProgramData\Microsoft\Diagnosis\ETLLogs\*
    \ProgramData\Microsoft\Network\Downloader\*
    \ProgramData\Microsoft\Windows\SQM
    \Users\Administrator
    \Users\*\NTUSER.DAT*.TM.blf
    \Users\*\NTUSER.DAT*.regtrans-ms
    \Users\*\NTUSER.DAT*.log*
    \Users\*\AppData\Local\Microsoft\Windows\Explorer\*.etl
    \Users\*\AppData\Local\Microsoft\Windows\INetCache\IE\*
    \Users\*\AppData\Local\Microsoft\Windows\WebCache\*
    \Users\*\AppData\Local\Microsoft\Terminal Server Client\Cache\*
    \Windows\AppCompat\Programs\Amcache.hve*.TM.blf
    \Windows\AppCompat\Programs\Amcache.hve*.regtrans-ms
    \Windows\AppCompat\Programs\Amcache.hve*.log*
    \Windows\CSC
    \Windows\Debug\*
    \Windows\inf\*.etl
    \Windows\inf\*.ev*
    \Windows\inf\*.log
    \Windows\Logs\CBS\*
    \Windows\Logs\DISM
    \Windows\Logs\DPX
    \Windows\Logs\dosvc\*
    \Windows\Logs\WindowsUpdate\*
    \Windows\Logs\PBR
    \Windows\Logs\*.log
    \Windows\Microsoft.NET\Framework\v2.0.50727\*.log
    \Windows\Microsoft.NET\Framework\v4.0.30319\*.log
    \Windows\Microsoft.NET\Framework64\v2.0.50727\*.log
    \Windows\Microsoft.NET\Framework64\v4.0.30319\*.log
    \Windows\Panther\*.etl
    \Windows\Panther\*.log
    \Windows\Panther\FastCleanup
    \Windows\Panther\img
    \Windows\Panther\Licenses
    \Windows\Panther\MigLog*.xml
    \Windows\Panther\Resources
    \Windows\Panther\Rollback
    \Windows\Panther\Setup*
    \Windows\Panther\UnattendGC
    \Windows\Panther\upgradematrix
    \Windows\Prefetch\*
    \Windows\security\database\*.chk
    \Windows\security\database\*.log
    \Windows\security\database\*.jrs
    \Windows\ServiceProfiles\LocalService\AppData\Local\FontCache-S-1-5-21-*.dat
    \Windows\ServiceProfiles\LocalService\NTUSER.DAT*.TM.blf
    \Windows\ServiceProfiles\LocalService\NTUSER.DAT*.regtrans-ms
    \Windows\ServiceProfiles\LocalService\NTUSER.DAT*.log*
    \Windows\ServiceProfiles\NetworkService\NTUSER.DAT*.TM.blf
    \Windows\ServiceProfiles\NetworkService\NTUSER.DAT*.regtrans-ms
    \Windows\ServiceProfiles\NetworkService\NTUSER.DAT*.log*
    \Windows\servicing\Packages\wuindex.xml
    \Windows\servicing\Sessions\*_*.xml
    \Windows\servicing\Sessions\Sessions.back.xml
    \Windows\SoftwareDistribution
    \Windows\System32\catroot2\*.txt
    \Windows\System32\catroot2\*.chk
    \Windows\System32\catroot2\*.log
    \Windows\System32\catroot2\*.jrs
    \Windows\System32\config\*.TM.blf
    \Windows\System32\config\*.regtrans-ms
    \Windows\System32\config\*.log*
    \Windows\System32\config\RegBack\*
    \Windows\System32\config\systemprofile\*.TM.blf
    \Windows\System32\config\systemprofile\*.regtrans-ms
    \Windows\System32\config\systemprofile\*.log*
    \Windows\System32\config\TxR\*.blf
    \Windows\System32\config\TxR\*.regtrans-ms
    \Windows\System32\CodeIntegrity\bootcat.cache
    \Windows\System32\LogFiles\AIT\*
    \Windows\System32\LogFiles\SQM\*
    \Windows\System32\LogFiles\WMI\RtBackup\*.etl
    \Windows\System32\SMI\Store\Machine\SCHEMA.DAT*.TM.blf
    \Windows\System32\SMI\Store\Machine\SCHEMA.DAT*.regtrans-ms
    \Windows\System32\SMI\Store\Machine\SCHEMA.DAT*.log*
    \Windows\System32\Sysprep\Panther
    \Windows\System32\Sysprep\Sysprep_succeeded.tag
    \Windows\System32\wdi\LogFiles\*
    \Windows\System32\wfp\*.etl
    \Windows\System32\winevt\Logs\*
    \Windows\System32\winevt\TraceFormat\*
    \Windows\Temp\*
    \Windows\WinSxS\ManifestCache\*
    \Windows\WinSxS\Temp\*
    \Windows\*.log
    
    [CompressionExclusionList]
    *.mp3
    *.zip
    *.cab
    *.wmv
    *.wma
    *.wim
    *.swm
    *.dvr-ms
    \windows\inf\*.pnf
    *.rar
    *.7z
     
  11. Enthousiast

    Enthousiast MDL Tester

    Joined:
    Oct 30, 2009
    Messages:
    35,561
    Likes Received:
    59,622
    Trophy Points:
    450
    Is it still the same as i posted in the Sysprep thread?
     
  12. abbodi1406

    abbodi1406 MDL KB0000001

    Joined:
    Feb 19, 2011
    Messages:
    12,067
    Likes Received:
    55,424
    Trophy Points:
    340
    No, this one have more exclusions
     
  13. Enthousiast

    Enthousiast MDL Tester

    Joined:
    Oct 30, 2009
    Messages:
    35,561
    Likes Received:
    59,622
    Trophy Points:
    450
    Thanks, saves me a line by line comparison :hug2:
     
  14. tavrez

    tavrez MDL Senior Member

    Joined:
    Sep 28, 2015
    Messages:
    423
    Likes Received:
    287
    Trophy Points:
    10
    Thank you guys, I have little stupid question now :D
    All references are talking about WinPE, I don't know what it is :D
    Is this the windows setup process we get from booting Windows setup flash? Or it's something else?

    And please, tell me about generalize option in sysprep, is it needed and why
     
  15. why you are not using backup option to restore whole os with all the files and apps? it is more perfect and less time taking for your needs.
    just download and use sergei stelec winpe and you will find tons of backup tools.
     
  16. tavrez

    tavrez MDL Senior Member

    Joined:
    Sep 28, 2015
    Messages:
    423
    Likes Received:
    287
    Trophy Points:
    10
    Because that was the only way I knew.
    If it's easier, I'll do this, thanks
     
  17. BlueScoop

    BlueScoop MDL Novice

    Joined:
    Apr 7, 2018
    Messages:
    31
    Likes Received:
    5
    Trophy Points:
    0
    On another forum, the author used the "/bootable" flag in his tutorial on capturing a custom Windows 10 image w/ pre-installed apps. But according to the Microsoft docs, the /bootable flag is reserved for WinPE images only.

    So please could you provide an example of when it would be appropriate to use the "/bootable" flag?

    Thnx

    DISM_Capture_Img.jpg
     
  18. Atari800XL

    Atari800XL MDL Addicted

    Joined:
    Apr 3, 2011
    Messages:
    899
    Likes Received:
    1,587
    Trophy Points:
    30
    Nowadays I use Wimlib-imageX to service PE files (boot.wim), but the usage is the same:
    - If you make changes to a wim file (in this case boot.wim) the changed files are not really "replaced" in the wim, but in fact just "added" (the original files are just tagged as "deleted"), this is done to save time.
    If you want to make a new wim after you "serviced" it, you can export the serviced wim to a new file, in this case the tagged files are not copied over to the new "clean" wim, resulting in a smaller and "clean" file.
    During this "export" command, you have to use the "bootable" option, or else the new wim will not have this special option set.

    Examples from my notes:
    Code:
    dism /export-image /sourceimagefile:d:\boot.wim /sourceindex:1 /destinationimagefile:smallpe.wim /bootable /compress:max
    wim export lala.esd 3 pe.wim --boot --compress=maximum
    
     
  19. TrustMe

    TrustMe MDL Member

    Joined:
    May 2, 2013
    Messages:
    187
    Likes Received:
    65
    Trophy Points:
    10
    What is the advantage of going through all this? Why not just install Windows, install programs, and capture the image with Macrium Reflect or some other free imaging tool?
     
  20. Atari800XL

    Atari800XL MDL Addicted

    Joined:
    Apr 3, 2011
    Messages:
    899
    Likes Received:
    1,587
    Trophy Points:
    30
    Trustme, I guess you're right, the OP did not know what PE is, so creating a sysprepped wim might not be the best solution in this case.
    I only reacted to the /bootable issue...

    On the other hand, I believe there's at least one MDL member that uses wim capture as an "imaging" solution...