Adding tools to Windows PE in an mixed x86 x64 environment

When creating both x86 and x64 Windows PE images, provide both x86 and x64 version of any tools that will be used.  MDT 2008 provides a method to add additional file to the Windows PE image using the Extras folder which is configured on the Windows PE tab of the deployment point properties dialog

image 

There is only one folder that can be specified.  64 bit Windows PE has no 32 Bit WOW subsystem, tool executables for each architecture must be provided.

Here is a one line batch file that solves the problem:

@%SystemDrive%\tools\%PROCESSOR_ARCHITECTURE%\%~n0.exe

Here are the steps to make makecab.exe available in Windows PE:

  1. Create an Extras folder add the path to the deploy point configuration.  i.e. e:\Extras
  2. Create the e:\Extras\tools folder
  3. Create e:\Extras\tools\amd64 and e:\tools\x86
  4. Obtain 32 and 64 bit copies of makecab and place then in the correct folder.
  5. Create e:\Extras\Windows and e:\Extras\Windows\System32
  6. Create e:\Extras\Windows\System32\makecab.cmd and add the single line @%SystemDrive%\tools\%PROCESSOR_ARCHITECTURE%\%~n0.exe
  7. Use the MDT console and update the deployment point to create a new WIM and ISO

How it works

Anything added to the Extras folder goes into the root of the WIM and thus the root of X: when the WIM is booted.  The Processor_Architecture variable will contain the value amd64, x86, or IA64 (Note:  MDT does not support IA64). In a batch file the variable  %0 is the name of the batch file.  the prefix ~n modifies the variable %0 to by dropping the extension.  So in the example, the line in the batch file expands to x:\tools\amd64\makecab.exe in 64 bit Windows PE and  x:\tools\x86\makecab.exe in 32 bit Windows PE.

Notes

  1. When copying executables into tools\amd64 or tools\x86 make sure you copy all the required support files including any required MUI folders.
  2. Make sure that the tool is referenced by its basename i.e. makecab not makecab.exe
  3. Make sure the 64 bit tools folder is named amd64 not x64.

 

Disclaimer: The information on this site is provided "AS IS" with no warranties, confers no rights, and is not supported by the authors or Microsoft Corporation. Use of included script samples are subject to the terms specified in the Terms of Use .

This post was contributed by Dave Hornbaker a senior consultant with Microsoft Services - U.S. East Region.