Part 2:  Making an All In One (AIO) CD

Introduction

In my part 1 I showed how to easily reduce the source and make the cd bootable.  Part 1 was meant to be as straight forward and easy as possible.  In this second part I will show you how to take that bootable cd we just made and turn it into an All In One (AIO) CD.  Part 2 is intended for novices, not newbies.  If you already haven't, please read part 1 before continuing.

Prerequisites

Followed part 1
XP Home and XP Pro CD (preferrably slipstreamed with SP1 or higher)
An NTFS partition with about 4 gigs free
cdimage.exe - save it to %windir%\system32.  (Note:  cdimage.exe only works on NT4/2000/XP/2003)
make.bat - save to your desktop
cdburn.exe - save to %windir%\system32 (optional - only needed if you want to burn the image to CD)
dvdburn.exe - save to %windir%\system32 (optional - only needed if you want to burn the image to DVD)

Target audience

Advanced users

The CD so far...

You should have followed Part 1 of this guide.  In part 1 we made a bootable cd that has XP Pro.  The root should look like this:

Adding XP Home

To make an All In One (AIO) CD we're going to add XP Home to the install.  You might be thinking, "why add xp home when xp pro has all the features of home?".  It's true that pro has all the features of Home.  The advantages of adding XP home are many - you might not want advanced features like encryption and domain support;  you can use XP Home to reinstall XP Home on a friends computer; adding xp home to the cd will only add about 50 megs.  Follow the steps below to add XP Home to your install.

1 - slipstream your local copy of XP Home.  I won't go into how to slipstream XP, there's plenty of existing guides on the internet.

2 - Run <path to xp home source>\i386\winnt32.exe /noreboot.  This will be the same process as Part 1.  If you get the message below you can safely ignore it.

When setup closes, you should have the following folders on the root of your C drive:

C:\$WIN_NT$.~BT - > rename this to C:\HOM1
C:\$WIN_NT$.~LS - > rename this to C:\XPHome

If for some reason you don't see a ~LS folder, look at %windir%\winnt32.log, it'll say where it copied the files to, as such:

Winnt32.log

Drive C: acceptable for local source.
DUInfo: Winnt32DuWriteParams: disabled because DU did not succeed
Source 0: copy c:\I386\usetup.exe to C:\$WIN_NT$.~LS\I386\system32\smss.exe [OK]
Source 0: copy c:\I386\ntdll.dll to C:\$WIN_NT$.~LS\I386\system32\ntdll.dll [OK]

3 - Make sure you edit your boot.ini located in your boot partition (the file is hidden and read-only).  In your boot.ini remove this line and save changes:

C:\$WIN_NT$.~BT\BOOTSECT.DAT="Microsoft Windows XP Setup"

4 - Copy HOM1 and XPHome to c:\xpcd

5 - In HOM1 delete the following files:  BOOTSECT.DAT, migrate.inf, winnt.sif

6 - In HOM1 hex setupldr.bin and replace i386 with HOM1.  You should do this 4 times.

7 - In HOM1 edit txtsetup.sif and replace SetupSourcePath with this:

SetupSourcePath = "\XPHome\"

8 - In XPHome delete size.sif

9 - Copy the following files from the root of the cd (c:\xpcd) to the XPHome folder (c:\xpcd\XPHome):

WIN51
WIN51IC.SP1
WIN51IP.SP1
WIN51IP
WIN51IC
SPNotes.htm

Tip
If you want the "press any key to boot from CD" message add BOOTFIX.BIN to your boot folder (HOM1 or VOL1)

Tip
If you want to be able to use chkdsk and format from recovery console add autochk.exe, autofmt.exe, expand.exe to your BOOT folder (HOM1 or VOL1)

Tip
To avoid any confusion, delete txtsetup.sif from c:\xpcd\XPHome.  Txtsetup.sif is only used from the BOOT folder (in this case, HOM1).  Any other txtsetup.sif is ignored.  Delete the unneeded txtsetup.sif to avoid accidentally editing the wrong file.

Fixing XP Pro

In Part 1 we put the XP source as i386 on the root of the cd, and named the boot folder BOOT.  For this guide we're going to rename these files to make the cd easy to follow.

1 - Rename c:\xpcd\BOOT to VOL1

2 - Make a folder called XPPro and put it into c:\xpcd

3 - Move the i386 folder into XPPro

4 - In VOL1 hex setupldr.bin, replace BOOT with VOL1.  You should do this 4 times.  If you find BOOT more than 4 times, you might want to get a fresh setupldr.bin and replace i386 with VOL1.

5 - In VOL1 edit txtsetup.sif and replace SetupSourcePath with this:

SetupSourcePath = "\XPPro\"

6 - Copy the following files from the root of the cd (c:\xpcd) to the XPPro folder (c:\xpcd\XPPro):

WIN51
WIN51IC.SP1
WIN51IP.SP1
WIN51IP
WIN51IC
SPNotes.htm

Making the boot sector

Delete the BOOT.DAT file we made in Part 1.  Download my boot sectors and extract them to c:\xpcd\.   The root of the CD should now look like this:

Your XPHome and XPPro folders should look like this:

Tip
If you want to use an $OEM$ folder put it in the XPHome and XPPro folders.  You can use the same $OEM$ folder for both folders to save space.  Or in your unattend file you can use the parameter OEMFilesPath= to use one $OEM$ folder.

Automating the process

DEVIL270975 was kind enough to make batch files to automate this process.  You can try his method here.  The only thing you need to do is put your product key in diskemu.cmd if you want to.

Adding an unattend option

So far we have created an AIO cd that has XP Home and XP Pro on it.  If you want, you can make the CD unattended by putting your unattend file into one of the BOOT folders as winnt.sif.  What I recommend is making 2 new BOOT folders for the unattend option.

1 - Copy HOM1 to HOM2

2 - Copy VOL1 to VOL2

3 - In HOM2 hex setupldr.bin and replace HOM1 with HOM2.  You should do this 4 times.

4 - In VOL2 hex setupldr.bin and replace VOL1 with VOL2.  You should do this 4 times.

5 - Rename your unattend file to winnt.sif and put it into the HOM2 and VOL2 folders.

6 - You do NOT need to touch txtsetup.sif since the source will be the same.

Using this method you can create several BOOT folders for different unattend files.  For example on my CD, i have HOM1 and VOL1 as regular installs.  This let's me using recovery console or repair XP.  In my HOM2 and VOL2 folders i have an unattend file that has UnattendMode=ProvideDefault.  This means the user will be prompted for each input, but in the input it'll have my unattend settings.  In HOM3 and VOL3 I have UnattendMode=FullUnattended.  This means the install will be totally unattended and won't prompt for anything.  You can see how useful this could be.  And each HOMX or VOLX folder you make only adds about 300k to the CD size, since cdimage.exe will optimize the layout.

Tip
If you want to use recovery console from your unattended cd make another BOOT folder (HOM2, VOL2...), and don't put a winnt.sif file in it.  Add this new folder to your cd menu.  For txtsetup.sif, use the same SetupSourcePath that you used for the other BOOT folder (HOM1, VOL1...).  This way when you select this second option, you will be able to use recovery console or repair windows.  It will only add less than a meg to your CD.

Creating the CD Menu

In Part 1 I showed how to make a bootable CD menu using diskemu.cmd.  Below is a sample of a modified diskemu.cmd that shows 3 options for each XP version.

Sample of diskemu.cmd

print ------------------------------------------------------------------------------
print F1=Help
print 0) WINXP PRO Volume License SP1 Regular
print 1) WINXP PRO Volume License SP1 Unattended
print 2) WINXP PRO Volume License SP1 OEMPreinstall
print 3) WINXP HOME SP1 Regular
print 4) WINXP HOME SP1 Unattended
print 5) WINXP HOME SP1 OEMPreinstall
print 6) Windows PE SP1
print 7) Windows PE SP1 /inram
print
print a) Windows 95b Bootdisk
print b) Windows 98 Bootdisk
print c) Windows ME Bootdisk
print
print x) More Options...
print q) Quit to command prompt
print r) Reboot
print Esc) Boot first harddisk
print
print Hit the key of choice:
:mainkey
; timeout is 30 seconds, default key is escape
getkey 30 esc
onkey 0 run VOL1.DAT
onkey 1 run VOL2.DAT
onkey 2 run VOL3.DAT
onkey 3 run HOM1.DAT
onkey 4 run HOM2.DAT
onkey 5 run HOM3.DAT
onkey 6 run WNPE.DAT
onkey 7 run WNP2.DAT
onkey a run win95.ima
onkey b run Win98.ima
onkey c run winme.ima
onkey q quit
onkey r reboot
onkey x goto dev
onkey f1 goto help
onkey esc boot 80
; When no key found...

Everything is case sensitive.  So make sure VOL1.DAT in diskemu.cmd is the same case as VOL1.DAT in the CD root.  Also make sure nothing has spaces on the end.  Also everything has to be in the root of the CD.  You cannot put the menu, cd idents, or boot files in sub folders.

Tip
CDShell let's you put images (*.ima) files into a sub folder, although the boot sectors (VOL1.DAT) still have to be into the root.  To learn more about CDShell see www.cdshell.org.

Making the CD

Download cdimage.exe above and save it to your system32 folder.  Download make.bat to your desktop.  Edit make.bat to make sure the paths are correct.  Double click on make.bat, this will make c:\xpsp1.iso.  Depending on the size of your cd, this process could take a long time.  Some cd's I've made took 20 mins for cdimage.exe to make them.  You can only run cdimage.exe on NT based systems (NT4/2000/XP/2003/+).  Below is a screen shot of what you'll see.  It's ok if you get messages telling you files are the same.

Burning the CD

If you have a cd burner put in a blank cd and type cdburn c:\xpsp1.iso

If you have a dvd burner put in a blank dvd and type dvdburn c:\xpsp1.iso

 

Continue to Part 3