共用方式為


Create a Data Image

To add applications, files, and other resources to Windows during an installation, you must create a data image. By using ImageX, you can create additional .wim files that contain only files and applications that you intend to copy to the Windows installation.

Data images enable you to add:

  • Applications, files, scripts, and other resources to Windows during an installation.
  • Files, resources, and other data to a partition other than the operating system partition.

Note

Data images must be used only to add new files to a Windows installation. Do not use data images to replace existing Windows files. Overwriting operating system data is unsupported.

Previous methods of transferring data to a Windows installation required the use of $OEM$ folders. These folder structures are still supported, but data images provide an easier and more efficient means of transferring additional data to Windows.

In unattended installations, the Windows image to install is specified by the OSImage setting in the Microsoft-Windows-Setup component. You can add one or more DataImage settings in the Microsoft-Windows-Setup component that represent additional data images that you add to the system. For more information, see the Unattended Windows Setup Reference.

To create a data image

  1. Locate the data that you will create a data image for.

  2. Use ImageX to compress your data files to a .wim file. For example:

    imagex /capture C:\Data\DataFiles C:\Data\MyData.wim "MyData"
    

    In this example, everything under the C:\Data\DataFiles directory is added to the .wim file. All files and folders under C:\Data\DataFiles are extracted to the root of the drive specified in the answer file.
    For more information about using ImageX, see the ImageX Technical Reference.

  3. Copy the data image to an accessible location during Windows Setup. This can be on another partition or on a network share.

To add a data image path to an answer file

  1. Use Windows System Image Manager (Windows SIM) to create an answer file that contains the path to the data image to install and the location to install that data image.

  2. Add the Microsoft-Windows-Setup ImageInstall setting to the windowsPE pass. Configure the DataImage settings as appropriate for your environment.

  3. Save the answer file and close Windows SIM.
    The answer file must look similar to the following example:

       <settings pass="windowsPE">
          <component name="Microsoft-Windows-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="https://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
             <ImageInstall>
                <DataImage wcm:action="add">
                   <InstallTo>
                      <DiskID>0</DiskID>
                      <PartitionID>1</PartitionID>
                   </InstallTo>
                   <InstallFrom>
                      <Credentials>
                         <Domain>Fabrikam</Domain>
                         <Username>MyUsername</Username>
                         <Password>MyPassword</Password>
                      </Credentials>
                   <Path>\\networkshare\share\MyData.wim</Path>
                   </InstallFrom>
                      <Order>1</Order>
                </DataImage>
             </ImageInstall>
          </component>
       </settings>
    
  4. Run Setup.exe, specifying the location of the answer file. For example:

    setup.exe /unattend:C:\unattend.xml
    

All the files and folders specified in the data image are extracted to the root of the drive during installation.