bishooman

Install Windows from ISO after booting to WinPE 3.0 from USB HDD

35 posts in this topic

Dear all

i have been reading alot in the last few days and i want to share my findings with you all.

this will be a small project and it will be updated frequently so please show support by testing it and give advices\corrections

Untitled.png

Requirements:

1- Windows AIK from HERE

2- FileDisk 1.7 from HERE

3- PStart Application Lancher from HERE

Part 1: Preparing your Windows PE Enviroment

1. Install the Windows AIK using default options.

2. Create Winpe 3.0 environment using the Windows AIK by excuting this command :

D:\ Program Files\Windows AIK\Tools\PETools\copype.cmd x86 D:\winpe_x86

this will create the Windows PE output in the directory D:\winpe_x86.

3. mount the winoe image so that we can edit it

D:\ Program Files\Windows AIKTools\x86\imagex" /mountrw D:\winpe_x86\winpe.wim 1 %D:\winpe_x86\mount

4. now will will install FileDisk to our WinPE Enviroment, installing FileDisk involved to setps

a. Copy the Driver "filedisk.sys" to Windows\System32\drivers directory

b. add some registry values

this can be done by using the below commands

reg load HKLM\Winpe D:\winpe_x86\mount\Windows\System32\config\System
regedit /s D:\Winpe3.0\Tools\FileDisk\Filedisk.reg filedisk.reg is in attachments
reg unload HKLM\Winpe

5.now we will copy the STARTNET.CMD to Windows\Syatem32

and we will add the rest of our files and folder to D:winpe_x86\ISO folder

xcopy D:\Winpe3.0\Tools\Start D:\winpe_x86\ISO\Start\ /s /e
copy D:\Winpe3.0\Tools\Scripts\STARTNET.CMD D:\winpe_x86\mount\Windows\System32\

6. now we have to unmout the image and commit changes

D:\ Program Files\Windows AIKTools\Tools\x86\imagex /unmount /commit D:\winpe_x86\mount

7. now will copy the winpe.wim image to sources folder and name it boot.wim

copy D:\winpe_x86\winpe.wim D:\winpe_x86\ISO\sources\boot.wim

and now our Windows PE Enviroment is ready.

Part 2: Preparing PStart and our Windows Setup Command

The windows PE image we just did will boot from USB Flash or Hardisk in 30sec and load PStart.exe so we have to prepare our Setup.cmd file that will partition, format then start winnt32.exe.

installing XP from Windows PE will require some special registry entries and format style in our Windows PE Enviroment for more details check this thread

for that i already added all the needed files in D:\Winpe3.0\Tools\Start\Setup folder

the command i am using here to do the job is XP2003.cmd that will do the folowing

1. Set ISO files root

2. Set Unattned files root

3. will the needed registry entries needed to correctly partion your harddisk for Windows XP usage check this (
)

4. will partition and format usr hardisk using diskpart.exe and diskpart.ini the holds the format script NOTE: the included diskpart.ini will format your drive C:

5. you need also to fix the boot sector after you format your hardisk to be compatibale with Windows XP

6. Finaly it will mount you Windows XP iso file and Start the Setup Proccess.

SET ISO_PATH=%~d0\Start\ISO

SET UNATTEND_PATH=%~d0\Start\Unattend

regedit /s fixbootxp2003.reg

diskpart /s diskpart.ini

bootsect /nt52 c:

filedisk /mount 0 %ISO_PATH%\%1 /cd V:

V:\i386\winnt32 /syspart:c: /tempdrive:c: /makelocalsource /unattend:%UNATTEND_PATH%\%2

7. Now you have to add a new entry to PStart to launch XP2003.cmd with 2 command parameters

1. ISO file name

2.Unattended file name

XP2003.cmd XPSP3.iso Unattended.txt

Part 3: Preparing Your USB Flash or HDD and BOOT IT !

1. format your usb drive from windows vista/7 open cmd windows and type

#first excute this command to check your drive number


list disk


#then use it as below mine was 2


diskpart

select disk 2

clean

create partition primary

select partition 1

active

format fs=ntfs

exit

2. copy all the files\folders in D:\winppe_x86\ISO to the root of your drive

3.copy your XP ISO file to you usb drive in U:\Start\ISO

4. boot your USB

you will find in the attachment all the files needed and Setup.cmd the will do all that job for you, to run it correcttly you need to do the folowing:

1. extract winpe3.0 some where in c: or d: drive

2. open Setup.cmd and edit the first 3 lines

SET WINPETOOLS_DIR=L:\Winpe3.0\Tools <-- path for the tools you downloaded here

SET WINPE_ENV=L:\winpe_x86 <-- path where Winpe Enviroment working directory

SET WAIK_DIR=C:\Program Files\Windows AIK <-- path to Windows AIK

@ECHO OFF
SET WINPETOOLS_DIR=L:\Winpe3.0\Tools
SET WINPE_ENV=L:\winpe_x86
SET WAIK_DIR=C:\Program Files\Windows AIK


ECHO.
ECHO Creating Winpe 3.0 Enviroment ...
CALL "%WAIK_DIR%\Tools\PETools\copype.cmd" x86 %WINPE_ENV%
CLS

ECHO.
ECHO Mounting Winpe Image ...
"%WAIK_DIR%\Tools\x86\imagex" /mountrw %WINPE_ENV%\winpe.wim 1 %WINPE_ENV%\mount
CLS

ECHO.
ECHO Installing FileDisk Driver...
copy %WINPETOOLS_DIR%\FileDisk\filedisk.sys %WINPE_ENV%\mount\Windows\System32\Drivers
CLS

ECHO.
ECHO Installing FileDisk Registry Values...
reg load HKLM\Winpe %WINPE_ENV%\mount\Windows\System32\config\System
regedit /s %WINPETOOLS_DIR%\FileDisk\Filedisk.reg
reg unload HKLM\Winpe
CLS

ECHO.
ECHO Coping Other Tools..
xcopy %WINPETOOLS_DIR%\Start %WINPE_ENV%\ISO\Start\ /s /e
copy %WINPETOOLS_DIR%\Scripts\STARTNET.CMD %WINPE_ENV%\mount\Windows\System32\
CLS

ECHO.
ECHO Unmounting Winpe Image ...
"%WAIK_DIR%\Tools\x86\imagex" /unmount /commit %WINPE_ENV%\mount
CLS

ECHO.
ECHO Coping Winpe Image to ISO\Sources..
copy %WINPE_ENV%\winpe.wim %WINPE_ENV%\ISO\sources\boot.wim
CLS

::OSCDIMG -N -M -O -B%WINPE_ENV%\ETFSBOOT.COM %WINPE_ENV%\ISO %WINPE_ENV%\WINPE.ISO

@pause

you can uncomment the last line to build the project in iso format so you can test it in Virtual PC or Virtual Box

Download ver0.1 Windows Vista\7 Users should right click and run as administrator Setup.cmd file

THINGS I WANT TO ADD\UPDATE your Suggestions is more than welcome

1- Using a GUI Disk Managment Tool that is Free and easy to use (for XP/2003 instlations)

2- Replacing PStart with more advanced specific application (maybe i will code it my self)

3- adding on the fly unattented file generator

4- Give the Project a Name :)

THINGS I AM WORKING ON RIGHT NOW

1- Integration of Raid Drivers WITHOUT CHANGING THE ISO

2- GUI Tool for the Project

3- 64bit setup.exe will not run from 32bit Winpe i am looking for a solution

Edited by bishooman
0

Share this post


Link to post
Share on other sites

Thanks for sharing this, it definitely will help many :thumbup

0

Share this post


Link to post
Share on other sites

Nice. :thumbup

Stickied. :)

jaclaz

0

Share this post


Link to post
Share on other sites
Thanks for sharing this, it definitely will help many :thumbup

you are more than welcome, i learnd alot from your topicts keep up the good job

0

Share this post


Link to post
Share on other sites
Nice. :thumbup

Stickied. :)

jaclaz

wow!! thanks alot for the stiky man, this will give me extra push to make this better and easier for all

0

Share this post


Link to post
Share on other sites

Hi,

first thanks for your great work, Secondly I've got a Question:

I am an IT-Professional and want to use the system to install every individual PC. Problem is, that in your diskpart.ini is written, that every data on first partition of disk 0 will be deleted. Some PC have 2 physical disks, one for the Data and the other for the system. How can I specify on wich disk and wich partition windows xp will be installed?

You will probably notice that there are more than one question but you may can help me.

Thank you

0

Share this post


Link to post
Share on other sites
I am an IT-Professional

Well, if I were an IT professional :whistle: , I would look here:

V:\i386\winnt32 /syspart:c: /tempdrive:c: /makelocalsource /unattend:%UNATTEND_PATH%\%2

and here:

#first excute this command to check your drive number

list disk

#then use it as below mine was 2

diskpart

select disk 2

clean

create partition primary

select partition 1

active

format fs=ntfs

exit

jaclaz

0

Share this post


Link to post
Share on other sites
Hi,

first thanks for your great work, Secondly I've got a Question:

I am an IT-Professional and want to use the system to install every individual PC. Problem is, that in your diskpart.ini is written, that every data on first partition of disk 0 will be deleted. Some PC have 2 physical disks, one for the Data and the other for the system. How can I specify on wich disk and wich partition windows xp will be installed?

You will probably notice that there are more than one question but you may can help me.

Thank you

in XP2003.cmd file you can comment the line

diskpart /s diskpart.ini

then you can do your own custom partitioning and format using diskpart tool to read more about diskpart tool you can chack here

after that you can run xp2003.cmd to applay the rest of fix and then install

also you may need to change the drive letter in /syspart:c: /tempdrive:c:

as jaclaz mensioned if you are installing do a drive other than c:

please note that the clean command will delete all the partition on the selected drive s skip this step if you have more than one partition in one single phisical drive

Good Luck :thumbup

Edited by bishooman
0

Share this post


Link to post
Share on other sites

@Bishooman

Thank you for your good IDEA.

Unfortunately, failed to install windows XPSP3 to any drive other than C: (with or without updating the diskpart.ini). only success with C: drive.

here is my problem with D: drive

1- I updated diskpart as following but (active) command wouldn't work and when restart after WINNT32 PC is not booting and giving HALL error:

sel disk 0

sel par 2

active

format fs=ntfs quick

assign letter=d

2- Even i didn't use diskpart, the same result.

3- There might be some files missing that should be in root of D or C drive before booting.

4- Also, Fixboot.reg failed to be mapped to registry, i found the same key in another place in registry but not under (winpe)

[HKEY_LOCAL_MACHINE\Winpe\ControlSet001\Services\vds\Alignment]

and even updated that key manually, still failed after reboot.

please help.

Edited by robekia
0

Share this post


Link to post
Share on other sites

Dear robekia

if you succeeded to instal to c: then 1,2,3,4 you are doing correctly.

now for installing to D: you have to change this line

V:\i386\winnt32 /syspart:D: /tempdrive:D: /makelocalsource /unattend:%UNATTEND_PATH%\%2

changes is in bold

you will find this in xp2003.cmd

please report if this worked for you

regards

Edited by bishooman
0

Share this post


Link to post
Share on other sites
Dear robekia

if you succeeded to instal to c: then 1,2,3,4 you are doing correctly.

now for installing to D: you have to change this line

V:\i386\winnt32 /syspart:D: /tempdrive:D: /makelocalsource /unattend:%UNATTEND_PATH%\%2

changes is in bold

you will find this in xp2003.cmd

please report if this worked for you

regards

I already tried this before reporting, still failed, windows wouldn't even boot with HALL Error

As i mentioned already, there are some steps missing in this particular case.

If any member success in this case, please report here with procedure.

May be we need to copy some files to the ROOT of drive C even we are installing into any other drive...

0

Share this post


Link to post
Share on other sites

Which on is the active partition? Setup expects to find its boot files on the first partition, which is active, said for simplicity, details:

http://www.msfn.org/board/usb-multiboot-se...ck-t129454.html

http://www.msfn.org/board/xp-source-2nd-pa...pid-837621.html

What prevents you to start Setup from the first partition, but once on the partitioning screen to select the second one as destination?

You'd have to remove completely the unattended section in the answer file, or it will start installing right away in the partition where the temporary folders (~BT and ~LS) are, without getting you to the partition selection screen. Exception is if there is not enough space on that partition as per values in txtsetup.sif, in this case Setup will throw an error for not enough space and let you choose another partition, sending you back to the partitioning screen.

I recall a few other switches in winnt32.exe, which may allow source files to be elsewhere, not tested, use winnt32.exe /?.

0

Share this post


Link to post
Share on other sites
I already tried this before reporting, still failed, windows wouldn't even boot with HALL Error

As i mentioned already, there are some steps missing in this particular case.

If any member success in this case, please report here with procedure.

May be we need to copy some files to the ROOT of drive C even we are installing into any other drive...

can you please check if your seconed partion is primaty partition ?

are you getting hal.dll error when you are going to GUI Setup or directly after you restart WINPE to get to TXT Setup??

Edited by bishooman
0

Share this post


Link to post
Share on other sites
are you getting hal.dll error when you are going to GUI Setup or directly after you restart WINPE to get to TXT Setup??

Directly after I finish with Winnt32.exe and restart WINPE to get to TXT Setup

Also, i tried to format C: and D: then using winnt32.exe from PE to setup XP onto D:

I got the error when computer restarts.

I Load PE again to check the partitions and i found the following:

1- ( C ) drive is totaly empty, no files found even hidden..

2- (D) drive has $WIN_NT$.~BT and $WIN_NT$.~LS along with some files on the root.

BTW, in PStart, what the command line for installing VISTA will be and how you'll organize the files on USB?

Edited by robekia
0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.