OS Guide: Slipstream Updates Using DISM and OSCDImg

Updated 2021-03-27

OSCDImg is now in the Windows ADK. Install on this Computer and choose Deployment Tools from the features to install.

The Freshen Up step takes a copy of the original Install.WIM file copied from the source installer .ISO file to keep things simple. We do not compound the updates. We always start with a fresh Install.WIM file.

NOTE 1: Microsoft has taken the step to integrate the Servicing Stack Updates (SSUs) into their Cumulative Updates (CUs). So, once that process is complete across all operating systems one need only keep a copy of the most recent Install.WIM and update using the Cumulative Update. We used to need to keep in mind that there were prerequisites for certain SSUs so had to number each 00_SSU-1.msu, 01_SSU-2.msu so that they installed in order.

NOTE 2: Until the above happens, we have seen where the a CU would fail to install after the SSU was successful. As it turned out, we needed to save and dismount then run the process again without the SSU in the Updates folder and the CU would work.

NOTE 3: We use RUFUS to set up all of our OS install flash drives. Note that when creating a flash drive one needs to choose between traditional BIOS (CSM) using an MBR partition or uEFI that uses a GPT partition.

We have found that some desktop boards and Tier 1 laptops require Secure Boot to be disabled before booting the flash drive set up by RUFUS for uEFI.

We tweaked the script and folder to create a new one for Server 2019.

The following is the script used to update the Install.WIM file and create a new .ISO file once the process completes.

We use CTRL+H in NotePad to update the dates. Change the New one first then the Current one.

Setup assumes the folders are structured as per the script. Note that our script points to drive L: in this case.

NOTE:An elevated command prompt is required.

REM **** UPDATE the date in the ISO Name - Current: 2018-10-01 New: 2018-10-09 ****

ECHO Rename the TXT Files
REN L:\USB_Images\_WinServ2019FULL\_WinServe19-2018-10-01.txt _WinServe19-2018-10-09.txt
REN L:\USB_Images\_WinServ2019Bare\_WinServe19-2018-10-01.txt _WinServe19-2018-10-09.txt

ECHO Freshen Up the WIM File!
XCopy L:\WIMWork\WinServ19BareWIM\install.wim L:\WIMWork\WinServ19WIM /Y

ECHO **** MOUNT INDEX 1 ****
DISM /Mount-Wim /WimFile:L:\WIMWork\WinServ19WIM\install.wim /Index:1 /MountDir:L:\WIMWork\Mount_WinServ
ECHO **** UPDATE INDEX 1 ****
DISM /Image:L:\WIMWork\Mount_WinServ /Add-Package /PackagePath:L:\WIMWork\Updates_WinServ
ECHO **** UNMOUNT INDEX 1 ****
DISM /unmount-Wim /MountDir:L:\WIMWork\Mount_WinServ /commit
ECHO **** FINISH INDEX 1 ****
DISM /Cleanup-Wim

ECHO **** MOUNT INDEX 2 ****
DISM /Mount-Wim /WimFile:L:\WIMWork\WinServ19WIM\install.wim /Index:2 /MountDir:L:\WIMWork\Mount_WinServ
ECHO **** UPDATE INDEX 2 ****
DISM /Image:L:\WIMWork\Mount_WinServ /Add-Package /PackagePath:L:\WIMWork\Updates_WinServ
ECHO **** UNMOUNT INDEX 2 ****
DISM /unmount-Wim /MountDir:L:\WIMWork\Mount_WinServ /commit
ECHO **** FINISH INDEX 2 ****
DISM /Cleanup-Wim

ECHO **** MOUNT INDEX 3 ****
DISM /Mount-Wim /WimFile:L:\WIMWork\WinServ19WIM\install.wim /Index:3 /MountDir:L:\WIMWork\Mount_WinServ
ECHO **** UPDATE INDEX 3 ****
DISM /Image:L:\WIMWork\Mount_WinServ /Add-Package /PackagePath:L:\WIMWork\Updates_WinServ
ECHO **** UNMOUNT INDEX 3 ****
DISM /unmount-Wim /MountDir:L:\WIMWork\Mount_WinServ /commit
ECHO **** FINISH INDEX 3 ****
DISM /Cleanup-Wim

ECHO **** MOUNT INDEX 4 ****
DISM /Mount-Wim /WimFile:L:\WIMWork\WinServ19WIM\install.wim /Index:4 /MountDir:L:\WIMWork\Mount_WinServ
ECHO **** UPDATE INDEX 4 ****
DISM /Image:L:\WIMWork\Mount_WinServ /Add-Package /PackagePath:L:\WIMWork\Updates_WinServ
ECHO **** UNMOUNT INDEX 4 ****
DISM /unmount-Wim /MountDir:L:\WIMWork\Mount_WinServ /commit
ECHO **** FINISH INDEX 4 ****
DISM /Cleanup-Wim

ECHO **** COPY WIM FILES ****
XCopy L:\WIMWork\WinServ19WIM\install.wim L:\USB_Images\_WinServ2019FULL\sources\install.wim /Y
XCopy L:\WIMWork\WinServ19WIM\install.wim L:\USB_Images\_WinServ2019Bare\sources\install.wim /Y

ECHO **** CREATE ISO FILE ****
C:
CD \Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools\amd64\Oscdimg
Oscdimg.exe -u2 -bL:\USB_Images\_WinServ2019Bare\efi\microsoft\boot\efisys.bin -h L:\USB_Images\_WinServ2019Bare L:\ISOs\WinServ19B-2018-10-09.ISO
XCopy L:\ISOs\WinServ19B-2018-10-09.ISO L:\USB_Images\_WinServ2019FULL\_ISOs /Y
Oscdimg.exe -u2 -bL:\USB_Images\_WinServ2019Bare\efi\microsoft\boot\efisys.bin -h L:\USB_Images\_WinServ2019FULL L:\ISOs\WinServ19F-2018-10-09.ISO
CD \
Explorer.exe L:\ISOs

ECHO **** DONE ****

SCRIPT NOTES

Our source files, working files, and update files are located on the L: partition. The folder structure is as follows:

  • L:\WIMWork\WinServ19WIM = Source InstallWIM file. Note there are several.
  • L:\WIMWork\Mount_WinServ = Mount point for the extracted Windows Server install files
  • L:\USB_Images\_WinServ2019FULL = All of the contents shown in the second image below. There’s two folders for Windows Server: _WinServ2019FULL for one that has a copy of the completed .ISO file and _WinServBARE for just the updated Install.WIM file.
  • L:\ISOs = The folder the OSCDIMG.EXE process drops the completed .ISO files into.

L:\ISOs File folder contents

The above image shows the folder we have set up for access anywhere. We use the above to keep all of our client’s managed servers flash drives up to date.

Since we still have quite a few smaller Hyper-V settings where StorageCraft ShadowProtect is being used we keep the ShadowProtect WinPE Restore Environment available for those just-in-case moments.

Windows 10 .ISO Contents

As can be seen in the above image, we have several additional folders with contents we keep up to date to make deployment or re-installs as seamless as can be possible.

Note that the script is set up to update the dated .TXT file that tells us what version of Windows 10 we are dealing with and the date the image was created. This is important because we may keep up to three different image iterations based on client needs.