MSFN Forum: Poor Man's RIS using PE - MSFN Forum

Jump to content



Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Poor Man's RIS using PE Setup 2K/XP/2003 via a LAN Rate Topic: -----

#1 User is offline   bender127 

  • Newbie
  • Group: Members
  • Posts: 26
  • Joined: 04-November 03

Posted 08 January 2004 - 05:44 AM

-Sorry this is so long winded...-

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….


#2 User is offline   un4given1 

  • Elaborate Dreamer
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 1,796
  • Joined: 25-September 03

Posted 08 January 2004 - 07:40 AM

Nice method... but I think you are a little off comparing it in any way to a RIS installation. I have the ability to walk through the client installation wizard at the beginning of a build with RIS, choosing the computername, pctype (desktop, laptop), state, store location, office version as well as about 4 other softwares (my CIW is custom created by me). Your method does not offer this, so it is truely nothing like RIS. RIS also adds your PC to the domain using a secure login that you enter to gain access to the RIS CIW. It's possible to add a PC to a domain through a SIF file in your method, but it's not secure in any way. Your method is just a glorified network installation... Nice, but certainly lacks the many features RIS offers.

#3 User is offline   bender127 

  • Newbie
  • Group: Members
  • Posts: 26
  • Joined: 04-November 03

Posted 08 January 2004 - 11:20 AM

I'm not sure I was ever comparing it to RIS, other than to say it doen't need Active Directory.

If you are concerned about security, password protect the share with a local account on the file server. "net use" will prompt for a username and password.

#4 User is offline   un4given1 

  • Elaborate Dreamer
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 1,796
  • Joined: 25-September 03

Posted 08 January 2004 - 11:24 AM

You compared it to RIS when you said "Poor Man's RIS..."

Like I said.. good idea.

#5 User is offline   edeichinger 

  • computerguywannabe
  • Group: Members
  • Posts: 20
  • Joined: 01-January 04

Posted 08 January 2004 - 12:48 PM

Poor MAn is waht Got my attention! heheheh
hope you dont mind but I got that text on my resources now..
if you object I'll go back and delete it but I figured you put it
out there and there's no way I can remember all those darn steps.
Plus I may never see it again and you know what thay say..
"When you see the flower you better pick it", cause after you
crest the mountain range all the flora changes, and a storm will surely come
and then you got to move on till next spring..[] :)
Any how Looks like a handy thing to know, hope you dont' mind

if I "keep it"? :D :rolleyes:
thanks
ED

#6 User is offline   gosh 

  • gosh 2.0
  • Group: Patrons
  • Posts: 2,347
  • Joined: 03-October 03
  • OS:none specified
  • Country: Country Flag

Posted 08 January 2004 - 07:28 PM

What's described is the same as what i put in my Install XP on WinPE thread - http://www.MSFN.org/...showtopic=10181

Although this approach is more detailed. One thing i noticed is you didn't use the /tempdrive switch i used. I used that switch to make the drive bootable, otherwise setup won't boot from the hard drive. I'm not sure if /makelocalsource makes the drive bootable, if it doesn't this won't work.

Taken from http://teched2003downloads.mymsevents.com/...Ed/WINHOL05.doc

Quote

Type winnt32 /syspart:C: /tempdrive:C: /dudisable /unattend:unattend.txt /makelocalsource and click Enter

Note the switches above. /syspart: and /tempdrive: followed by the drive letter of the partition you created in step 4 tell Windows where to put the temporary files, and where to install to (without these switches setup will fail to find partitions to install to on a newly partitioned system)


-gosh

#7 User is offline   bender127 

  • Newbie
  • Group: Members
  • Posts: 26
  • Joined: 04-November 03

Posted 08 January 2004 - 08:54 PM

gosh:

You're absolutely right with ref. to /tempdrive, but it is /syspart that actually sets up the drive to be bootable. Here is the quote from the OPK on the switches:

Quote

/syspart:driveletter:

On an x86-based computer, specifies that you can copy Setup startup files to a hard disk, mark the disk as active, and then install the disk into another computer. When you start that computer, it automatically starts with the next phase of Setup. You must always use the /tempdrive parameter with the /syspart parameter. You can start winnt32 with the /syspart option on an x86-based computer running Windows NT 4.0, Windows 2000, or Windows XP. The computer cannot be running Windows 95, Windows 98, or Windows Millennium Edition.


What is bizarre is that it works fine without the /tempdrive switch, and OPK reference on /tempdrive seems to contradict the above info:

Quote

/tempdrive:driveletter:

Directs Setup to place temporary files on the specified partition. For a new installation, Windows will also be installed on the specified partition. For an upgrade, the /tempdrive option affects the placement of temporary files only; the operating system will be upgraded in the partition from which you run winnt32.


Since I'm not running winnt32.exe from C: drive- and using PE ensures that this is true - /tempdrive must default to whatever /syspart is using.

In any case, it's all good.

[EDIT] Maybe it is because when I run the AutoPartion script, it marks the partition active....

#8 User is offline   Thanatos 

  • GGTW
  • PipPip
  • Group: Members
  • Posts: 235
  • Joined: 31-August 03

Posted 17 January 2004 - 11:06 AM

I can't find choice.com, any chance you could upload it somewhere or send it to me, thanatos0@i12.com and I'll put it on my ftp

#9 User is offline   bender127 

  • Newbie
  • Group: Members
  • Posts: 26
  • Joined: 04-November 03

Posted 18 January 2004 - 01:03 AM

I found a copy of it here:

http://www.microscop..._gen/CHOICE.COM

#10 User is offline   Aaron 

  • The MSFN Banana
  • Group: Patrons
  • Posts: 5,767
  • Joined: 17-August 01

Posted 04 February 2004 - 05:10 PM

I'd thought I would try this out tonight, but came to a halt when CHOICE.COM couldn't be loaded in WinPE, because its not a valid Win32 Application.

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2011 msfn.org
Privacy Policy