Deployment Solution

 View Only

Script to patch Install.wim 

Oct 01, 2015 07:17 AM

In order to leave a sustainable OS image I like to fully automate the image creation process, starting with a known untouched OS DVD image and ending with a fully formed sysprepped image at the end. That way it's easy to tell exactly what's gone into the image and to update any element.

However, to install all the patches and updates each time can be a time consuming process so I prefer to slipstream these into the install.wim, however, I still want to be able to trace back to a known untouched install.wim.

So I start by manually copying the DVD image to a custom folder ('aaa') in the eXpress share, make it Read Only and then create a Scripted OS install job from that source. I then create a Job with a "Run Script" task run locally on the DS that will copy the untouched install.wim from the source to the WINOSnnn directory, mount it, patch it and unmount it. The scripted OS install will then be using a patched Install.wim. I copied the DISM folder from the relevant Windows ADK and created an empty d:\mount directory. Download any patches as extracted CAB files to an OfflineCAB directory under your OS directory in your folder.

REM Run on DS

set myco=aaa
set os=win10x64
set dvd=SW_DVD5_WIN_ENT_10_64BIT_Eng_Intl_MLF_X20-26306
set dism=%os%\DISM
set Winos=WinOS008
set wim=.\deploy\%winos%\sources\sources\install.wim 
set mount=d:\mount

copy /Y .\%myco%\%os%\%dvd%\sources\install.wim  %wim%

".\%myco%\%dism%\dism.exe" /mount-wim /wimfile:%wim% /mountdir:%mount% /index:1

FOR /F "delims=" %%A IN ('dir ".\%myco%\%os%\OfflineCab\*.cab" /s /b') DO (".\%myco%\%dism%\dism.exe" /image:%mount% /Add-Package /PackagePath:"%%A" /NoRestart /quiet)

".\%myco%\%dism%\dism.exe" /unmount-wim /mountdir:%mount% /commit

Statistics
0 Favorited
0 Views
0 Files
0 Shares
0 Downloads

Tags and Keywords

Related Entries and Links

No Related Resource entered.