Using a PE disc (like Bart’s PE) to perform an XP installation via network is a little bit like upgrading W2K to XP, but without ‘upgrade’ hassles. While i386\winnt.exe does a DOS based Setup, i386\winnt32.exe requires a Win32 GUI to run. This is where PE comes in.
There are 3 phases to winnt32.exe – the first is (I like to call) the hard drive prep phase, and the other two are as per normal (i.e. Text Mode, then GUI based Setup) when trying to install XP. Hard drive prep is the main problem, as winnt32.exe does no drive partitioning or formatting, but demands an NTFS partition to work with before it will run sucessfully. This post desscribes how to deal with this.
The cool part about PE is that full 32 bit network support during setup becomes a reality. Windows Setup does not care about where the \i386 directory exists, so you can also run Setup from a network file server, and treat a network file share like a local hard drive.
The main benefits of this are as follows:
- I don’t need to try and cram everything I want to install on a single CD - the size of my installs and customizations become virtually unlimited, because they are on a hard drive via the network.
- I enjoy the fact that I don’t need to burn CDs anymore – just the PE CD, which itself can be generic.
- I can use long file names in my setups now (except for slipstreaming hotfixes) without worries. PE provides the support for this.
- Unlike RIS, I don’t need Active Directory.
- Unlike PXE, I don’t need a DHCP server, special NICs, boot PROMS, DOS floppy images, menu editors, and all that other crap to support remote booting and its idiosyncrasies
- I have maximum flexibility by having one copy of \i386 and can have multiple different unattended setups, which all use the same XP source
- Probably some others I haven’t thought of…
The only disadvantage is that you need an external data source to do an install – this being a file server. If anyone has used PE with an external USB drive, the same rules below can apply.
So, here is what I have done to run XP Setup via network using PE. (Note that these instructions are relatively synonymous with Win2K or 2003 – I just reference XP to keep things simple.)
Things you’ll need:
- A computer (file server) with a network shared folder (e.g. \\bender127\NETINST)
- A PE CD with network support. Nothing fancy here - you’ll need networking support for sure, and a command console, which is provided in Bart’s PE already -excluding maybe your NIC drivers - whcih are easy to add.
- A computer you want to install XP to.
PART ONE: THE PREPARATION
From your server:
1. In the NETINST network share, create a new directory called XPCD. Dump the contents of your XP CD (i.e. the necessary files to install XP as you would with an unattended installation CD) to this directory. Your existing unattended CD will work fine.
2. Create another folder in the share called CustomSetup. This is where you can store variations of your XP deployment(s), such as the unattended .txt and $OEM$ folders. Copy your $OEM$ folder and its contents to this directory too.
3. Create a subfolder called AutoPartition – this is where your scripts for partitioning your hard drive will live.
At this point, your network share should look something like this:
\\bender127\NETINST
---\XPCD
------\i386
---\CustomSetup
------\$OEM$
---\AutoPartition
4. Move your winnt.sif file from your \XPCD\I386 directory you used for your unattended installation script, and save it as Unattended.txt in the \CustomSetup folder.
5. Setting up the Autopartition directory:
Obtain the MS-DOS program “choice.com” – this utility can be found on the web, and can also be found in any Win9x install or on a Win9x boot disk. It is important to have choice.com, as it has timer functionality needed for this script. ‘Course, feel free to write your own, but there is a procedure that must be followed, which is explained below in the REMarks for partdisk0NTFS.cmd.
Once you have the utility choice.com, place it in the AutoPartition directory. Then create the following 5 text files using notepad (cut and paste), and place them in the AutoPartition directory as well.
Wait.bat
REM Script for pausing… @CHOICE /T:N,%1% > NUL
PartDisk0.txt
select disk 0 create partition primary active assign letter=c list volume exit
rmdisk0part1.txt
select disk 0 select partition 1 delete partition
rmdrivec.txt
select volume 1 remove
partdisk0NTFS.cmd
@echo off Z: cd Z:\AutoPartition echo WARNING! echo. echo This utility will: echo - delete the primary partition on the first hard drive; echo - create a new primary partition as C: drive; echo - quickformat the drive as an basic NTFS volume. echo. echo All data on the first hard drive will be completely destroyed. REM Prompt to confirm before starting… choice /c:yn Are you sure you want to proceed? if ERRORLEVEL == 2 goto ABORT echo. echo Preparing boot drive, please wait.... echo. REM Run diskpart (NT Disk Partition Utility) 3 times REM REM Call the diskpart script ‘rmdrivec.txt’ to remove any existing drive or REM volume mapping to C: drive. Even though Bart’s PE does a good REM job mapping itself to D: drive consistently, devices like IDE ZIP drives REM might be loaded as C: drive. This eliminates the conflict. REM diskpart /s rmdrivec.txt REM Wait 5 seconds, otherwise the next diskpart command might fail. call WAIT 5 REM REM Call the diskpart script ‘rmdisk0part1’ to remove the first partition on REM drive 0 (primary master in a typical PC). Additional partitions on the REM same drive should remain intact. REM diskpart /s rmdisk0part1.txt REM REM Wait 5 seconds, otherwise the next diskpart command might fail. call WAIT 5 REM REM Call the diskpart script ‘partdisk0.txt’ to create a new, active partition REM on drive 0. If it is the only partition, then the new partition will use the REM entire drive. REM diskpart /s partdisk0.txt REM REM Quick format C: drive using NTFS, with no volume label. The ‘echo y’ REM portion suppresses the ‘press y to continue’ prompt. REM echo y|format c: /q /fs:ntfs /x /v:"" :ABORT
6. Create the following batch file, and place it the root of NETINST:
XPSetup.cmd
@ECHO OFF call Z:\AutoPartition\partdisk0NTFS.cmd ECHO. ECHO Setting up Windows XP... Z:\XPCD\I386\WINNT32.EXE /syspart:C: /makelocalsource /unattend:Z:\CustomSetup\Unattended.txt
7. Edit your XP Unattended.txt, and add the following items to the [Unattended] section of the file, if they do not exist already:
[Unattended] … OemPreinstall = yes OemFilesPath = "Z:\CustomSetup\$OEM$" …
8. Your NETINST share should look something like this now:
\\bender127\NETINST
---XPSetup.cmd
---\XPCD
------\i386
---\CustomSetup
------Unattended.txt <- Your updated answer file
------\$OEM$
---------\$1 <- Your custom stuff
---\AutoPartition
------choice.com
------wait.bat
------partdisk0.txt
------partdisk0NTFS.cmd
------rmdisk0part1.txt
------rmdriveC.txt
PART TWO: HOW IT WORKS
You’ll take your target computer, and boot it using your PE CD. Once network support has been started, open up a command console, and connect Z: drive to your NETINST network share. E.g:
net use z: \\bender127\netinst
Once you are connected to Z: drive, switch to Z: drive, you can run your XPSetup.cmd script at the prompt (which is at the root of your NETINST share), and the XP Setup process will begin – via the network.
XPSetup.cmd is a script that calls the partdisk0NTFS.cmd script in the AutoPartition folder on the NETINST share, which partitions and formats your primary master HDD as an NTFS C: drive.
Winnt32.exe is called from Z:, and the hard drive prep phase begins. At this stage, all XP Setup does is take key files from the \i386 directory and copies them to C: drive, and makes C: drive bootable.
The XPSetup.cmd batch file holds some important switches that winnt32.exe is used with:
/syspart:C: - tells Setup where the system partition is – e.g. C: drive. This is mandatory – winnt32.exe always tries to do an upgrade without this switch– so it try to find an older version of Windows, and will upgrade to XP at “that” location, or otherwise fail.
/makelocalsource – tells Setup to dump everything on the server to your newly created C: drive. This is mandatory and has numerous effects, which include:
- When the hard drive prep (first) phase is complete, Setup will start in Text Mode the next time the computer is booted. Low and behold, you will lose your Z: drive, and Text Mode Setup will fail because it no longer has access to the \i386 directory on the server. This switch will copy your \i386 contents and $OEM$ folder contents to the C: drive, removing the need for network access to \i386 for the remainder of the Setup.
- Any options in your answer file related to formatting and partitioning the system drive are ignored by Setup. Drive partitioning occurs in Text Mode Setup, and Setup will not carry out an answer file setting that it cannot complete successfully.
- Text Mode Setup becomes extremely fast. The other task Text Mode performs is decompression of files in the \i386 directory, which is all performed on the hard drive.
/unattend:Z:\CustomSetup\Unattended.txt – This is mandatory, and tells Setup where the answer file is. This allows you to have multiple versions of the answer file, but only one \i386 source.
After running XPSetup.cmd, winnt32.exe will terminate, and you should be returned back to your PE interface. Another awesome benefit at this point is you can continue to add additional files to C: drive before Setup continues, such as copying the Office source CD from another Z: folder to C: drive – which can be easily scripted as well. The possibilities are endless.
When you are ready, remove your PE CD and restart the computer, and Setup will continue as if you loaded your Unattended CD – the only major difference is Setup now runs completely off of the hard drive.
And finally:
In a way, this info proves the saying “The more things change, the more they stay the same.” Like the good old days of installing DOS, you’d start your old 486 with your DOS boot floppy, partition and format the hard drive using FAT-16, and use DOS Setup to copy system files to C: drive. Same type of install applies here – Win PE lets your boot your computer, you partition and format your C: drive as NTFS, and run Windows Setup to copy system files to the hard drive….



Help
Back to top









