Deployment Image Servicing and Management (DISM) for Windows IoT
Understand and leverage DISM for effective image management and deployment of Windows IoT devices.
Introduction to DISM
Deployment Image Servicing and Management (DISM) is a command-line tool that you can use to service and prepare Windows images, including those for Windows IoT. It can be used to install, uninstall, configure, and update features, packages, drivers, and operating system files within a Windows image. DISM is an essential tool for customizing and deploying Windows IoT operating systems.
Key DISM Commands for IoT Deployment
Here are some of the most frequently used DISM commands relevant to Windows IoT:
Mounting a Windows Image
To service an image, you first need to mount it to a local directory.
DISM /Mount-Image /ImageFile:C:\path\to\your\iot_image.wim /Index:1 /MountDir:C:\mount\windows
Explanation:
/Mount-Image: Specifies the operation to mount an image./ImageFile: Points to the WIM (Windows Imaging Format) or VHD (Virtual Hard Disk) file containing the Windows image./Index: Identifies the specific image within a multi-image file (e.g., index 1 for the first image in a WIM)./MountDir: Specifies the empty folder where the image will be mounted.
Unmounting and Committing Changes
After making changes, unmount the image. Use /Commit to save your changes or /Discard to revert them.
DISM /Unmount-Image /MountDir:C:\mount\windows /Commit
Explanation:
/Unmount-Image: Specifies the operation to unmount an image./MountDir: The directory where the image was mounted./Commit: Saves the modifications made to the image.
Adding Packages (e.g., Updates, Drivers)
You can add updates, drivers, or language packs to a mounted image.
DISM /Image:C:\mount\windows /Add-Package /PackagePath:C:\path\to\update.msu
For drivers:
DISM /Image:C:\mount\windows /Add-Driver /Driver:C:\path\to\driver.inf /Recurse
Explanation:
/Image: The path to the mounted image directory./Add-Package: Adds a Windows Update, language pack, or feature pack./PackagePath: The path to the package file (.msuor.cab)./Add-Driver: Adds a device driver./Driver: The path to the driver folder or INF file./Recurse: Searches subfolders for drivers.
Enabling or Disabling Windows Features
Customize the image by enabling or disabling features.
DISM /Image:C:\mount\windows /Enable-Feature /FeatureName:NetFx3 /All
To disable:
DISM /Image:C:\mount\windows /Disable-Feature /FeatureName:Print-PrintToPDFServices-Features
Explanation:
/Enable-Featureor/Disable-Feature: Controls the state of a Windows feature./FeatureName: The name of the feature to enable or disable. UseDISM /Image:C:\mount\windows /Get-Featuresto list available features./All: Enables all parent features for the specified feature.
Working with Windows IoT Core Images
While DISM is a powerful tool for general Windows deployment, Windows IoT Core images often utilize specific packaging and provisioning mechanisms. However, DISM can still be used to service the underlying OS components or apply updates if the image is provided in a standard WIM format.
Tip: For many IoT Core scenarios, you'll use the IoT Dashboard or custom provisioning packages. DISM is more relevant when dealing with customized WIM images or for lower-level servicing.
Advanced DISM Scenarios
DISM can also be used for:
- Capturing custom images from a deployed system.
- Splitting large WIM files.
- Managing provisioning packages.
- Applying updates to an online Windows installation.
Important: Always ensure you are working with a backup of your original image file before making any modifications with DISM.
Troubleshooting
If you encounter issues, check the DISM log file, typically located at C:\Windows\Logs\DISM\dism.log, for detailed error information. Ensure you are running DISM with administrator privileges.