Build a Windows 11 ISO

Fixing a curious oversight in the Windows ISO for Microsoft Surface devices.

Build a Windows 11 ISO
Photo by Windows / Unsplash

Recently while organising a clean upgrade from Windows 10 to Windows 11 for the company I work for, I noticed that oddly the Windows 11 ISO that you can download from Microsoft (see https://www.microsoft.com/software-download/windows11) does not contain drivers for the keyboard or trackpad on Microsoft Surface devices - which seems crazy!

via GIPHY

Because we wanted to do clean installs rather than in place upgrades using Windows Update, we've had to build our own custom ISO that we could then either download to the device and install from via script, or write to a bootable USB.

These instructions can be used to install drivers for any other devices you want to have ready to go at install time, however I recommend keeping to just the minimum for your environment to keep the size of the ISO down.

For example, only include the drivers needed to get the keyboard, mouse/trackpad, and network working. Most other drivers will auto download and install from Windows Update after the network connection has been established.

  1. Download the Windows 11 ADK from https://learn.microsoft.com/en-us/windows-hardware/get-started/adk-install
  2. Start the installer, and ensure only "Deployment Tools" is selected
  3. Download the Windows 11 ISO from https://www.microsoft.com/software-download/windows11
  4. Mount the ISO by double clicking it
  5. Copy the contents of the mounted ISO to a directory on your disk. For example: C:\Windows11\ISO
  6. Start an elevated PowerShell
  7. Get the available Windows install images by entering the command:
Get-WindowsImage -ImagePath C:\Windows11\ISO\sources\install.wim
  1. Take note of the available install images
  2. Remove any images you won't be using by entering the following command, substituting the index value x for the image to be removed:
Remove-WindowsImage -ImagePath C:\Windows11\ISO\sources\install.wim -Index x
  1. Repeat step 9 until all unwanted images are gone
  2. Mount the image
Mount-WindowsImage -ImagePath C:\Windows11\ISO\sources\install.wim -Path C:\Windows11\Mount -Index x
  1. The mount image process will take some time to complete
  2. Download the drivers to be integrated into the image, and extract them to a directory. For example: C:\Windows11\Drivers
  3. Add the drivers to the mounted image:
Add-WindowsDriver -Path C:\Windows11\Mount -Driver C:\Windows11\Drivers -Recurse
  1. Repeat step 14 for all drivers to be added
  2. Dismount and save the Windows 11 image:
Dismount-WindowsImage -Path C:\Windows11\Mount -Save
  1. Create your ISO:
& 'C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools\amd64\Oscdimg\oscdimg.exe' -m -o -u2 -udfver102 -bootdata:2#p0,ebC:\Windows11\ISO\boot\etfsboot.com#pEF,e,bC:\Windows11\ISO\efi\microsoft\boot\efisys.bin C:\Windows11\ISO C:\Windows11\Windows11.iso