twitchy Posted May 5, 2007 Posted May 5, 2007 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/msbuildwinpeMSBuild 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.microsoft.com/en-us/library/0k6kkbsd.aspxThe 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 diskInjecting Windows PackagesInjecting Out-of-box PnP driversInjecting custom file contentBurning CD's (requires installation of the Windows Server 2003 resource kit)I hope the community finds this useful. Enjoy!Chris
Br4tt3 Posted May 14, 2007 Posted May 14, 2007 Thanks man.... I will take a look at it, looks helpful to me.....
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now