BDD 2007 - Tips and Tricks - Integrating WinRE into Vista with BDD
Windows Recovery Environment (Windows RE) is a recovery platform based on Windows Preinstallation Environment (Windows PE). Windows RE provides two main functionalities, Automatic diagnosis and repair of boot problems using a tool called Startup Repair and a centralized platform for advanced recovery tools.
based on this functionality I think it makes a lot of sense to integrate WinRE into all of your Vista deployments. From the number of questions I have received on the topic it seems like I am not the only one!
So how do we integrate WinRE into the Vista deployment process using BDD 2007?
The first thing I do is I create my WinRE source. There is a good article on the WinRE team blog that explains how to create a WinRE source using the WAIK. Unfortunately adding the Mass storage and network drivers for all the models you want to support can be quite laborious. The obvious question here is “why can’t we just use the BDD driver library?” to do this for us, after all it is used to create the Lite touch WIM. Well thanks to Dave Hornbaker a fellow Microsoft Services consultant you can.
Dave has developed a PowerShell script that automatically creates a WinRE WIM and then injects the drivers that you have already imported into BDD, NICE!
The script must be run on a machine with both BDD and the WAIK installed. The script is attached to this blog and is usage is detailed below:
Powershell .\CreateWinRE.ps1 [Arch] [Group] [–ISO] [–MassStorageDrivers] [–Net] [–system] [–Display]
Arch - “x86” or “x64” (“x64” has not been tested) Default is “x86”
Group - BDD Driver group name. Driver group to be injected into the image. Default is “All Drivers”
-ISO - Create an ISO image Default is to just create a WIM
-MassStorageDrivers - Inject Mass Storage Drivers (default)
-Net - Inject network drivers (default)
-System - Inject system drivers
-Display - Inject display drivers
Now we have this fantastic script, run it to create the WinRE WIM the and inject the drivers as required:
Powershell .\CreateWinRE.ps1 –MassStorageDrivers –Net
Now that we have out WIM we can integrate into the BDD deployment process:
Copy the following files to the specified locations:
- Copy SetAutoFailover.cmd to the distribution\scripts folder and rename it to Z-SetAutoFailover.cmd - This script is provided by the Windows AIK - under: C:\Program Files\Windows AIK\Recovery.
- Copy the script Z-INSTALL-WinRE.wsf to the distribution\scripts folder – Attached to this blog
Now create an application with the following settings:
- Open the Deployment Workbench
- Right click on Distribution Share \ Applications and click New
- Select Application without source files or elsewhere on the network and click Next
- Set Application Name to INSTALL-WinRE and click Next
- Set the Command Line to cscript " %SCRIPTROOT%\Z-INSTALL-WinRE.wsf"
- Set the Working Directory to %SCRIPTROOT% and click Add
Next add the application to task scheduler, it is important to note that you should add this to your deployment build not your master image as WinRE will be disabled by sysprep :
- Open the Deployment Workbench
- Right click on Builds \ <Build ID> and click Properties
- Select the Task Sequence tab
- Navigate to the State Restore group
- Select the Enable Bitlocker task
- Click the Add button and select Application \ INSTALL-WinRE
- Click Ok to confirm
NOTE: <Build ID> is the name of the build to edit i.e. DEPLOY-VISTA
The sample script I have provided simply copies the WinRE.wim file to the C drive and enables WinRE. You may want to look at other options such as locating it on a partition with Bitlocker or creating a seperate partition just for WinRE. For more information about the possible configuration options please refer to the WinRE team blog.
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 .
Comments
Anonymous
January 01, 2003
Hi Bill, Can you post the errors here then I should be able to help you. Thanks, BenAnonymous
January 01, 2003
Hi Johnnie, Unfortunately I have not had a chance to test this with MDT. It may be a while before I get a chance. If you do find a solution then please post a comment. Thanks, BenAnonymous
January 01, 2003
PingBack from http://desktopfeedbag.wordpress.com/2007/05/22/integrating-winre-into-vista-with-bdd/Anonymous
January 01, 2003
If you are new to Powershell (like me) and need some help enabling Powershell scripting support check this site: http://www.tech-recipes.com/rx/2513/powershell_enable_script_support Script ran fine after I followed the easy instructions and I now have a nice WinRE.wim Thanks to Ben and Dave for their efforts! ;-)Anonymous
January 01, 2003
Hi Stefan, I have not tried to install it on a hidden partition. One suggestion I would have is to install it on a artition that is not hidden then hide the partition once you have installed WinRE. I beleive that thetre is some good information on this on the WinRe team blog. Thanks, BenAnonymous
June 11, 2007
This powershell script rocks! I am going to incorporate this into my BDD installs along with the ability to build WinRE onto a hidden partition into all of my Windows Vista builds.Anonymous
October 01, 2007
Ok, I suppose I am missing something obvious, I am early in my Powershell knowledge curve, so I just don't have the skills to debug this yet. Anyway every time I run this I get errors. Perhaps it assuming something that isn't true about my machine? For example bdd 2007 is installed on the d: and not c: while the wiak is on c:...Anonymous
October 23, 2007
Bill, you will likely need to change the security rights within powershell. How would you go about modifying this script to install WinRE onto a hidden partition? So far I've not been sucessfull at it via my BDD deployments.Anonymous
February 13, 2008
Ben, How would I change the script over to apply WinRe to a Bitlocker partition?Anonymous
March 10, 2008
I'm using the latest version of Microsoft Deloylment... the script errors out in a few different places. I modified the path to reference "Microsoft Deployemtn Toolkit" instead of "BDD 2007" but it errors creating the wim. Specificially: Exception calling "Run" with "2" argument(s): "The image file %1 is valid, but is for a machine type other than the cur rent machine" At F:DistributionCreateWinRE-MDS.ps1:109 char:24
- $Result = $Manager::Run( <<<< $Imagex, "/export /boot """ + $BootWim + """ 2 " + $tmpWinRE + " ""Windows Recovery Env ironment""") You cannot call a method on a null-valued expression. At F:DistributionCreateWinRE-MDS.ps1:110 char:43
- Write-Debug ("Result: " + $Result.ToString( <<<< )) You cannot call a method on a null-valued expression. At F:DistributionCreateWinRE-MDS.ps1:111 char:98
- if ($Result -ne 0){Write-Host ("Unable to create WinRE WIM file: Result was: " + $Result.ToString( <<<< ));Exit $Resu lt}
- Anonymous
April 03, 2008
The comment has been removed