Filename extension | .wim .swm |
---|---|
Magic number | MSWIM\0\0 |
Developed by | Microsoft |
Type of format | Disk image |
The Windows Imaging Format (WIM) is a file-based disk image format. It was developed by Microsoft to deploy Windows Vista and all later Windows operating system releases, which use it as part of their standard installation procedure. It works equally well with older versions of Windows however, and is used as part of Windows Fundamentals for Legacy PCs.
Contents |
Like other disk image formats, a WIM file contains a set of files and associated filesystem metadata. However, unlike sector-based formats (such as .ISO, .CUE/.BIN used for CD and DVD images), WIM is file-based, which means that the smallest unit of information is a file. The primary advantages of it being file-based include hardware independence and single-instance storage of a file referenced multiple times in the filesystem tree.
Although the architecture is file-based, the files are stored inside a single WIM database, reducing the SMB overhead of opening and closing many individual files at that end of the data transfer. The cost of reading or writing many thousands of individual files on the local disk is negated by hardware and software-based disk caching as well as sequential reading and writing of the data.
WIM images need to be deployed to an existing volume or partition as the toolset does not create low-level disk structures such as partitions, nor does it format them. Microsoft provides a command-line tool called diskpart for creating and formatting new volumes.
WIM files can contain multiple disk images, which are referenced either by their numerical index or by their unique name. Due to the use of single instance storage, the more each successive disk image has in common with previous images added to the WIM file, the less new data will be added. A WIM can also be split (spanned) into multiple parts, which have the .swm extension.
ImageX is the command-line tool used to create, edit and deploy Windows disk images in the Windows Imaging Format. It is distributed as part of the free Windows Automated Installation Kit (WAIK). Starting with Windows Vista, Windows Setup uses the WAIK API to install fresh as well as cloned installation of Windows.
The first developed prototype of ImageX was build 6.0.4007.0 (main.030212-2037). It allowed Microsoft OEM Partners to experiment with the imaging technology and was developed in parallel with Longhorn alpha prototypes. It was first introduced in Milestone 4 into the Longhorn project, and used in later builds of Longhorn. Build 6.0.5384.4 added significant advantages over previous versions, like read-only and read/write folder mounting capabilities, splitting to multiple image files (SWM), a WIM filter driver and the latest LZX compression algorithms. It has been used since pre-RC (release candidates) of Windows Vista.
The Deployment Image Service and Management Tool is used to retrieve or modify information within an image.
Example usage:
mount image
dism /mount-wim /wimfile:c:\win7\sources\boot.wim /index:1 /mountDir:c:\temp2
which drivers are included?
dism /image:c:\temp2 /get-Drivers
add drivers
dism /image:c:\temp2 /add-driver /driver:C:\dell\drivers\r191214\nvdm.inf
unmount image
dism /unmount-wim /mountdir:c:\temp2 /commit
OTHER DISM COMMANDS
/mount-wim
/set-edition
/set-productKey
/apply-unattend
/cleanup-wim
/add-driver
/remove-driver
/set-uilang
/set-setupuilang
/add-package
/remove-package
/enable-feature
/disable-feature
A WIM image can also be mounted as a new volume under Windows with a drive letter associated in order to facilitate easier extraction or updating of its contents. (For example, a WIM image can be converted into an ISO image using this approach). A device driver named WimFltr.sys needs to be loaded before a WIM image can be mounted using ImageX however.
A set of public APIs for manipulating WIMs has also been released, with the required functionality contained in WIMGAPI.DLL, thereby allowing developers to write their own tools too. A number of third party applications have therefore included the capability to read or write WIM files.
WIM images can be made bootable, as is the case with Windows Vista's setup DVD. In this case, BOOT.WIM contains a bootable version of Windows PE from which the installation is performed. Other setup files are contained in the file INSTALL.WIM.
|