Published by Marius on 20 Jul 2008
Windows Preinstallation Environment - Vista Live CD (part 1)
In this tutorial you will learn how to build your own Windows Vista Live CD/DVD (known as Windows PE 2.0). This is the basic tutorial, I will write an advanced version later.
All you will need is the Windows Automated Installation Kit (WAIK), which is available here. Download and install it.
1. Go to Start -> All Programs -> Microsoft Windows AIK -> Windows PE Tools Command Prompt
2. Type copype.cmd <architecture> <destination> where architecture can be x86 or amd64; destination is a directory on your local drive. Initially the directory must not exist. Example:
copype.cmd x86 C:\WinPEx86
This script will copy all the necessary files and creates the basic structure for Windows PE. You will have the following directory structure:
C:\WinPEx86
C:\WinPEx86\ISO
C:\WinPEx86\mount
3. Mount the Windows PE image so you can add or remove files. Type the following command:
imagex /mountrw C:\WinPEx86\winpe.wim 1 C:\WinPEx86\mount
Now you can go to C:\WinPEx86\mount and you will see the basic Windows directory structure. You can add files here, so you can access them when you’re running the Live CD. For the purpose of this demo, I will add CPU-Z.
4. Extract the downloaded CPU-Z zip archive to C:\WinPEx86\mount\CPU-Z
If you can’t see ProgramData directory, no problem, my system is set to display hidden files. For this, you can go to Tools -> Folder Options… -> View tab -> check “Show hidden files and folders”.
5. Prepare the image:
peimg /prep C:\WinPEx86\mount\Windows
This command will reduce the overall image size.
6. Unmount the image and commit changes:
imagex /unmount C:\WinPEx86\mount /commit
7. Replace the original boot image file with your custom image. It must be named boot.wim also! Type the following command:
copy C:\WinPEx86\winpe.wim C:\WinPEx86\ISO\sources\boot.wim
8. Create the final bootable ISO:
oscdimg -n -bC:\WinPEx86\etfsboot.com C:\WinPEx86\ISO C:\WinPEx86\WinPEx86Live.iso
Yes, there is no space between -b and C:\…
Now you can test your ISO in VirtualPC or burn it on a CD.
Final result:
After the live system boots (can take a while) you’ll end up with a command prompt (CMD).
To access CPU-Z (or any other program you added), just go to X:\. That’s the root of the live CD.
Example:
Make your programs start automatically:
If you want to start CPU-Z (or any other program) with the live CD, before you unmount the image (step 6) edit C:\WinPEx86\mount\Windows\System32\startnet.cmd and after wpeinit, on a new line, type \CPU-Z\cpuz.exe and save the file.
It is good to use the relative path (without X:\) rather than the absolute path (with X:\)
Then, continue to step 6.
Replace the desktop background:
Before you unmount the image (step 6), replace C:\WinPEx86\mount\Windows\System32\winpe.bmp with your own bitmap file.
Then, continue to step 6.
Stay tuned for a more advanced (as in “still easy but improved”
) tutorial on this topic.