We'll start out with building our base PE that we will work with. You will need to open the Windows PE Tools Command Prompt, and open it as the Administrator.
copype.cmd amd64 c:\winpe_amd64
xcopy c:\winpe_amd64\winpe.wim c:\winpe_amd64\ISO\sources\boot.wim
Dism /Mount-Wim /WinFile:c:\winpe_amd64\ISO\sources\boot.wim /index:1 /MountDir:c:\winpe_amd64\mount
Dism /image:c:\winpe_amd64\mount /Add-Package /PackagePath:"C:\Program Files\Windows AIK\tools\PETools\amd64\WinPE_FPs\winpe-hta.cab"
Dism /image:c:\winpe_amd64\mount /Add-Package /PackagePath:"C:\Program Files\Windows AIK\tools\PETools\amd64\WinPE_FPs\winpe-mdac.cab"
Dism /image:c:\winpe_amd64\mount /Add-Package /PackagePath:"C:\Program Files\Windows AIK\tools\PETools\amd64\WinPE_FPs\winpe-scripting.cab"
Dism /image:c:\winpe_amd64\mount /Add-Package /PackagePath:"C:\Program Files\Windows AIK\tools\PETools\amd64\WinPE_FPs\winpe-wmi.cab"
Dism /unmount-Wim /MountDir:c:\winpe_amd64\mount /commit
This adds the HTA, MDAC, Scripting and WMI packages. The MDAC may or may not be required for you, but not having it only can limit future development. Check out the Windows PE User's Guide (in the Start Menu) for more information on each package and how to add them.
At this point, you should test your new PE that you made to make sure it works. You may skip this step if you feel sure about it. You will need these steps when you are finished with your PE anyways. The following also assumes a currently active WDS, and these steps will imply that.
Update 10-05-09: It seems there was a step left out of the MS instructions. You need to take the files from C:\Program Files\Windows AIK\Tools\amd64 and put them in c:\winpe_amd64\mount\Windows\System32 if you want to have access to Imagex.exe!
1. Open Windows Deployment Services as Administrator (runas)
2. Expand your server you want to use until you see the containers inside.
3. Right-click on the Boot Images container and click Add Boot Image.
4. Browse to your PE location (look above if you forgot) choose it.
5. CLick next to the Name and Description page. I try to make things easy for my directed audience, so I will rename each line to "Imagex (x64)"
6. Keep clicking Next until it loads it and then Finish.
Last step, boot a client to the network and choose the new Imagex (x64) if you have a menu, if not it should boot right in.
Next we will put the HTA into the image. I've already gone through the liberty of figuring out how to get this working before writing up this post.
First, make a folder to extract (or copy to) the files from the v7.1 zip file. If you have a customized one like I do, that's fine, or you can customize it ahead of time too, or leave it at stock. Up to you. There are a few things we need to make or get before we can put this in the Boot.wim.
In order for this to work in x64, we need the new GimageX COM files. Not only is there one for x64 but also it is updated to handle Windows 7. Download the full package here:
http://www.autoitscript.com/gimagex/
After you get this, you need to extract it out. You will find a COM folder and an x64 folder with the gimagex_com.dll inside. Copy this one and replace the one in the v71 folder.
The second thing we need to take care of is the BROWSE.EXE program. You may choose to skip this step if you want to test to see if it works anyways. For me, it did not work until I decompiled it and recompiled it for x64. In order to do this, you need to download (or have installed) AutoIT v3.
http://www.autoitscript.com/autoit3/
Once installed, in the start menu in the AutoIT folder you will find a program called "Decompile .exe to Script". Open this up and point it to the BROWSE.EXE in the v71 folder. In the second box you need to pick a name to save it as, which should be BROWSE.AU3. After it does this, go back into the AutoIT Start Menu and find a program called "Compile Script to .exe". Same concept, first line you choose the BROWSE.AU3 and second you choose the BROWSE.EXE that was already there. Make sure to choose the x64 radio button. In this step you will be overwriting the original BROWSE.EXE (the 32bit one) from the zip file. This is fine because if you want the original one back, just get it out of the Zip again!
A little note about the Decompile .exe to Script program. It is used to decompile .EXE files compiled with AutoIT. This does not mean you can decompile any AutoIT based .EXE, just ones that have no password on them. Fortunately, Geezery did not put a password on his EXE so we can decompile it to make it 64bit.
Now we are ready to make the Startnet.cmd file. This is what mine looks like on my test server:
wpeinit
wpeutil initializenetwork
ping 127.0.0.1 -n 16 -w 1000>null
net use z: \\7SERVER\images ZarleyZalapski33 /user:kdineen
regsvr32 /s misc/gimagex_com.dll
mshta.exe x:\windows\system32\imagex.hta
The ping command are in there to delay mapping of the network drive for systems with NICs on an initialization delay. NICs on boards such as the Intel DG45ID and DG45FC (among others) require this in order to be able to be able to map the drive properly. The command after is mapping to the network share where the WIMs are kept.
As you can tell, we are going to put all the files from inside the v71 folder into C:\Windows\System32. This includes the MISC folder and the Startnet.cmd! So here are your steps for updating the image with new files:
1. Mount the wim using the following command:
Dism /mount-wim /wimfile:c:\winpe_amd64\iso\sources\boot.wim /index:1 /mountdir:c:\winpe_amd64\mount
2. Next, copy all files from the v71 folder, including the startnet.cmd and paste into c:\winpe_amd64\mount\windows\system32. You may need to provide Admin Rights for replacing the startnet.cmd. After you do this, we are ready to save the image with the following:
dism /unmount-wim /mountdir:c:\winpe_amd64\mount /commit
3. Lastly we need to refresh the Boot image in WDS. From the WDS CPL, find your image under Boot Images, if named as in the tutorial it will be called Imagex (x64). Right-click on it and choose replace image. When you use the browse box, it will look at the last path (directory) you imported or replaced from the last time you used that option. So if you did nothing in WDS since adding the original Boot.wim, the one that appears when you hit browse will be the file we want. Select that, and go through the screens as you did the first time. It will default the Image name and Description, so you will have to change that again. After it is done and the Finish button lights up, you are good to go. You do not need to restart the WDS service, or refresh the window at all. Boot your client and see how it looks.
At this point in the tutorial, you should be able to capture XP, Vista, 2003 and 2008 images just fine. Windows 7 instructions will be added to this thread later.
This post has been edited by Tripredacus: 27 January 2011 - 11:06 AM