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.