MSFN Forum: MSBuild Windows PE 2.0 Project - MSFN Forum

Jump to content



Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

MSBuild Windows PE 2.0 Project How to automate Windows PE 2.0 image compilation using MSBuild Rate Topic: -----

#1 User is offline   twitchy 

  • Group: Members
  • Posts: 1
  • Joined: 19-May 05

Posted 05 May 2007 - 05:39 PM

I thought I would share with the community a process for automating Windows PE builds using Microsoft's MSBuild.exe utility. I have used this approach very successfully on several recent projects over the past couple years and thought it may be of interest to this community.

I have created an open source project with several sample projects to illustrate how the approach works. You can download the MSBuild Windows PE Tasks project (6KB) here: http://www.codeplex.com/msbuildwinpe

MSBuild is an extremely powerful batch processing utility that is installed as part of the .NET Framework versions 2.0 and higher, so it is likely that it is already installed and available on most people's systems. MSBuild projects are simply XML files that describe batch processing properties, items and tasks. You can learn more about MSBuild here: http://msdn2.microso...y/0k6kkbsd.aspx

The MSBuild Windows PE Tasks project includes a re-usable MSBuild.WindowsPE.targets file that contains MSBuild tasks that correspond to the various command lines that must be called to build a customized Windows PE 2.0 image using the Windows AIK. Once you have installed the Windows AIK (you can download it here: http://www.microsoft.com/downloads/details...3-679830d629f2), simply copy the MSBuild.WindowsPE.targets file to your %ProgramFiles%\MSBuild folder and you are ready to start building Windows PE 2.0 images using MSBuild.

To create a new Windows PE MSBuild project that builds a basic Windows PE 2.0 image, create a folder for the project, for example C:\WinPeProj. Next, create a new MSBuild project file within the project folder, for example C:\WinPeProj\Basic.peproj. Add the following content to the project file:

 
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="BuildWinPe">  
  <Import Project="$(MSBuildExtensionsPath)\MSBuild.WindowsPE.targets"/>  
</Project>
 


Finally, from a command prompt, navigate to this folder and enter the command %windir%\Microsoft.NET\Framework\v2.0.50727\MSBuild.exe. In about 3 minutes, you will have a brand new Windows PE image ready to use.

If you wish to add PnP drivers to this image, simply create a folder called Drivers at the root of your project folder, copy in all of your custom driver folders and run the MSBuild.exe command.

Similarly, if you wish to add custom file content to this image, create a folder called Custom at the root of your project folder. Within this folder create a folder called ISO for adding content that does not need to be resident in RAM, and a folder called mount for content that needs to be loaded into the RAM disk. Re-run the MSBuild.exe command to inject your custom content into the image.

There are several sample projects included in the MSBuild Windows PE Tasks including a project that illustrates how to add software such as the ImageX tool and a project that illustrates how to initiate an unattended operating system install.

The MSBuild.WindowsPE.targets currently supports the following features:
  • Building x86 and amd64 images that load using a RAM disk
  • Injecting Windows Packages
  • Injecting Out-of-box PnP drivers
  • Injecting custom file content
  • Burning CD's (requires installation of the Windows Server 2003 resource kit)
I hope the community finds this useful. Enjoy!

Chris


#2 User is offline   Br4tt3 

  • World famous sausage eater...
  • PipPipPipPip
  • Group: Members
  • Posts: 566
  • Joined: 20-April 04

Posted 14 May 2007 - 12:27 AM

Thanks man.... I will take a look at it, looks helpful to me.....

#3 User is offline   p4ntb0y 

  • Member
  • PipPip
  • Group: Members
  • Posts: 237
  • Joined: 14-February 06

Posted 14 May 2007 - 10:39 AM

looks very intresting many Thanks!

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2011 msfn.org
Privacy Policy