Windows 8 Preview - Howto - Creating a WinPE boot image with .NET Framework and PowerShell
Sep
14
Written by:
9/14/2011 9:39 AM
Here is a step-by-step guide to create a x64 bootimage with support for Scripting, WMI, HTA, ADO, .NET Framework 4.0, PowerShell and the DISM cmdlets for PowerShell.
Create the boot image
In this sample you will create a x64 boot image.
-
Download the Assessment and Deployment Kit (ADK) from MSDN subscribers download
-
Install ADK by running adksetup.exe, and make sure that Windows Preinstallation Environment is selected (selected by default)

-
Create the C:\WinPE_x64 folder
-
Copy the winpe.wim file from C:\Program Files (x86)\Windows Kits\8.0\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64 to C:\WinPE_x64
-
Create the C:\Mount folder
-
Start the Deployment Tools and Imaging Environment, and mount the boot image using the following command:
Imagex /mountrw C:\WinPE_x64\winpe.wim 1 C:\Mount
-
Add the various optional components to the boot image by running the following commands:
cd /d "C:\Program Files (x86)\Windows Kits\8.0\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs"
dism /image:C:\Mount /add-package /packagepath:"WinPE-Scripting.cab"
dism /image:C:\Mount /add-package /packagepath:"en-us\WinPE-Scripting_en-us.cab"
dism /image:C:\Mount /add-package /packagepath:"WinPE-WMI.cab"
dism /image:C:\Mount /add-package /packagepath:"en-us\WinPE-WMI_en-us.cab"
dism /image:C:\Mount /add-package /packagepath:"WinPE-MDAC.cab"
dism /image:C:\Mount /add-package /packagepath:"en-us\WinPE-MDAC_en-us.cab"
dism /image:C:\Mount /add-package /packagepath:"WinPE-HTA.cab"
dism /image:C:\Mount /add-package /packagepath:"en-us\WinPE-HTA_en-us.cab"
dism /image:C:\Mount /add-package /packagepath:"WinPE-NetFx4.cab"
dism /image:C:\Mount /add-package /packagepath:"en-us\WinPE-NetFx4_en-us.cab"
dism /image:C:\Mount /add-package /packagepath:"WinPE-PowerShell3.cab"
dism /image:C:\Mount /add-package /packagepath:"en-us\WinPE-PowerShell3_en-us.cab"
dism /image:C:\Mount /add-package /packagepath:"WinPE-DismCmdlets.cab"
dism /image:C:\Mount /add-package /packagepath:"en-us\WinPE-DismCmdlets_en-us.cab"
-
Commit the changes to the boot image by running the following command:
Imagex /unmount /commit C:\Mount
-
Done, you now have 280 MB or so boot image, that you can add to your WDS (PXE) server.
Optional step - create a bootable ISO image.
If you don't have a PXE server or just want to mount an ISO for test, here you find the additional steps to create a bootable ISO.
-
Create the C:\WinPE_x64\ISO folder
-
Copy the contents of the C:\Program Files (x86)\Windows Kits\8.0\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\Media folder to C:\WinPE_x64\ISO
-
Create the C:\WinPE_x64\ISO\Sources folder

-
copy (or move) the winpe.wim file in C:\WinPE_x64 to C:\WinPE_x64\ISO\Sources
-
Rename the winpe.wim file in C:\WinPE_x64\ISO\Sources to boot.wim
-
Copy the etfsboot.com file from C:\Program Files (x86)\Windows Kits\8.0\Assessment and Deployment Kit\Deployment and Imaging Tools\amd64\Oscdimg to C:\WinPE_x64
-
Create the bootable ISO by running the following command:
oscdimg -b"c:\WinPE_X64\etfsboot.com" -n C:\WinPE_X64\ISO C:\WinPE_X64\WinPE_X64.iso
-
Done, you now have a 330 MB or so ISO.
The PowerShell command window in WinPE - Listing some hardware info using WMI.
/ Johan
15 comment(s) so far...
Re: Windows 8 Preview - Howto - Creating a WinPE boot image with .NET Framework and PowerShell
When will this be available for technet subscribers? Or more widely available for that matter?
By dot45 on
9/15/2011 1:19 PM
|
Re: Windows 8 Preview - Howto - Creating a WinPE boot image with .NET Framework and PowerShell
I have asked the setup team at Microsoft but no info yet, sorry.
/ Johan
By Arwidmark on
9/15/2011 8:43 PM
|
Re: Windows 8 Preview - Howto - Creating a WinPE boot image with .NET Framework and PowerShell
I'm excited about the .Net framework support here. Do you know if this can be used used to deploy Win7? My guess is yes. Also, do you know if the WinPE-NetFx4_en-us.cab file would work on a WAIK 3.0 WinPE setup? Just curious. I don't know if we would start using the ADK if it hasn't been through the ringer fully yet.
Thanks for posting this. I haven't found this information any where else yet.
By yarbizzle on
9/16/2011 11:01 AM
|
Re: Windows 8 Preview - Howto - Creating a WinPE boot image with .NET Framework and PowerShell
Ehhh Cannot find it in my MSDN subscription either MSDN AA or technet :( I'm so keen to do some testing using powershell in Windows PE. It would open so many new abilities of deploying OS and customizing them :)
By rpieniaz on
9/16/2011 12:42 PM
|
Re: Windows 8 Preview - Howto - Creating a WinPE boot image with .NET Framework and PowerShell
Hi Johan! Thank you for the infomation sharing, I really need .Net support in WinPE, I will check it out soon :)
By Naveed on
9/17/2011 1:02 AM
|
Re: Windows 8 Preview - Howto - Creating a WinPE boot image with .NET Framework and PowerShell
I made a x86 version of the above - booting from cd is fine and runs my .net4 apps woohoo - but i tried adding the boot.wim to a WDS server (on a win server 2003 box) - it broke WDS and you could no longer network boot.. had to re-store E:\RemoteInstall\Boot from last backup to get WDS to run again... - I really want this running from WDS!
By h3mp on
10/3/2011 6:05 AM
|
Re: Windows 8 Preview - Howto - Creating a WinPE boot image with .NET Framework and PowerShell
Wow, I have never tested WinPE 4.0 on Windows Server 2003... I stopped using 2003 as WDS servers almost four years ago...
/ Johan
By Arwidmark on
10/3/2011 12:28 PM
|
Re: Windows 8 Preview - Howto - Creating a WinPE boot image with .NET Framework and PowerShell
I followed the (excellent) instructions for configuring WinPE with all the packages indicated. WinPE runs fine and executes Win32 programs, but not a simple ("Hello world") .NET 4.0 GUI app. Did I do something wrong in configuration or is there some kind of limit on the kind of .NET 4.0 support?
By Kevin King on
1/13/2012 5:39 PM
|
Re: Windows 8 Preview - Howto - Creating a WinPE boot image with .NET Framework and PowerShell
Hi Kevin,
I tested to write a small Windows Forms Application in C$ (.NET Framework 4 client profile), and that worked fine in WinPE. I have uploaded my sample to this link if you want to try it in your boot image. www.deploymentresearch.com/DRFiles/DotNetSampleAppWinPE40Demo.zip (Please note it's a x86 app).
If you want me to test your code, please zip the project and upload your code somewhere and post the link.
/ Johan
By Arwidmark on
1/17/2012 4:32 AM
|
Re: Windows 8 Preview - Howto - Creating a WinPE boot image with .NET Framework and PowerShell
Thanks. I executed the procedure again and it works, so I did something wrong the first time. The 32-bit sample didn't run, maybe because WinPE still doesn't support WOW64, but an x64 app .NET app worked fine.
By Servant on
1/18/2012 12:58 PM
|
Re: Windows 8 Preview - Howto - Creating a WinPE boot image with .NET Framework and PowerShell
What's the different between WAIK and ADK?
I expect that Microsoft will release a new WAIK for handling Windows Server 8 automated installation. Is that a realistic expectation? ;-) or ADK is the NEW way to go.
By NicholasAdrian on
5/1/2012 6:01 AM
|
Re: Windows 8 Preview - Howto - Creating a WinPE boot image with .NET Framework and PowerShell
ADK is the next release of WAIK. ADK will be used for both Windows 8 and Windows Server 2012 deployments, and will be released at the same time.
/ Johan
By Arwidmark on
5/4/2012 10:47 AM
|
Re: Windows 8 Preview - Howto - Creating a WinPE boot image with .NET Framework and PowerShell
Hi All,
Does anyone knows if SRT package is available for Winpe 4.0 /ADK? I couldn't found it. Is the recovery package has been moved or renamed or not present at all?
By Naveed on
6/17/2012 12:01 AM
|
Re: Windows 8 Preview - Howto - Creating a WinPE boot image with .NET Framework and PowerShell
ADK is simply the next version of WAIK. ADK is not required for Windows 8 or Windows Server 2012 deployments, you can still use WAIK, but does include additional features that are useful.
/ Johan
By Arwidmark on
6/17/2012 9:39 PM
|
Re: Windows 8 Preview - Howto - Creating a WinPE boot image with .NET Framework and PowerShell
I don't now for sure about the SRT package, but I expect Microsoft to continue to only include it in the setup boot.wim, and not in the generally available ADK. Like it is for WinPE 3.0
/ Johan
By Arwidmark on
6/17/2012 9:50 PM
|