Jump to content

Install Windows 7 x86 / Windows 7 x64 / Server 2008 from ISO images in


Recommended Posts

Install Windows 7 x86/Windows 7 x64/Server 2008 from ISO files in USB HD

Summary:

All your Windows 7 / 2008 Install DVDs with independent options and configurations in one USB HD, selectable with a simple Grub4Dos menu.

No complicated procedures or methods, no opening command prompts, no replacing setup.exe, no loaders. The install process is exactly the same as using a DVD.

Each ISO is independent of each other, with its own optional embedded autounattend.xml

Easy to implement and maintain.

Ingredients:

USB Hard Drive

Windows 7 x86 DVD/ISO/install files

Windows 7 x64 DVD/ISO/install files

Windows Server 2008 DVD/ISO/install files

Dism.exe from Windows Automated Installation Kit (WAIK)

Oscdimg.exe from Windows Automated Installation Kit (WAIK)

Firadisk version 0.0.1.30

Grub4Dos version 0.4.5b-2011-11-03

BootIce version 0.9.2011.0501

PC with Windows 7

Procedure:

Create the following folder structure

C:\USBHD

C:\USBHD\TOOLS

C:\USBHD\TOOLS\BOOTICE

C:\USBHD\TOOLS\GRUB4DOS

C:\USBHD\W7SP1X86

C:\USBHD\W7SP1X86\BIN

C:\USBHD\W7SP1X86\BIN\DRIVERS

C:\USBHD\W7SP1X86\BIN\DRIVERS\FIRADISK

Create additional folder structures for each install DVD, for example C:\USBHD\W7SP1X64, etc.

Copy BootIce files to C:\USBHD\TOOLS\BOOTICE

Copy Grub4Dos files to C:\USBHD\TOOLS\GRUB4DOS

Install WAIK, you will then have:

C:\Program Files\Windows AIK\Tools\x86\oscdimg.exe

C:\Program Files\Windows AIK\Tools\x86\Servicing\Dism.exe

Copy all the DVD files from each DVD to its folder: W7SP1X86, etc.

If you have ISO files, you can use WINRAR to extract the files from the ISOs

Copy the Firadisk driver files to each BIN\DRIVERS\FIRADISK folder

Create a file C:\USBHD\W7SP1X86\BIN\DRIVERS\FIRADISK\FIRADISK.REG

Edit FIRADISK.REG:


Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\target\ControlSet001\services\FiraDisk]
"Type"=dword:00000001
"Start"=dword:00000000
"ErrorControl"=dword:00000001
"ImagePath"=hex(2):73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,44,00,\
52,00,49,00,56,00,45,00,52,00,53,00,5c,00,66,00,69,00,72,00,61,00,64,00,69,\
00,73,00,6b,00,2e,00,73,00,79,00,73,00,00,00
"DisplayName"="FiraDisk Driver"
"Group"="Boot Bus Extender"

[HKEY_LOCAL_MACHINE\target\ControlSet001\services\FiraDisk\Parameters]
"PnP"=dword:00000001

[HKEY_LOCAL_MACHINE\target\ControlSet001\services\FiraDisk\Enum]
"Count"=dword:00000001
"NextInstance"=dword:00000001
"0"="ROOT\\FiraDisk\\0000"

[HKEY_LOCAL_MACHINE\target\ControlSet001\Enum\Root\FiraDisk\0000]
"ClassGUID"="{4d36e97b-e325-11ce-bfc1-08002be10318}"
"Class"="SCSIAdapter"
"HardwareID"=hex(7):72,00,6f,00,6f,00,74,00,5c,00,66,00,69,00,72,00,61,00,64,\
00,69,00,73,00,6b,00,00,00,00,00
"CompatibleIDs"=hex(7):64,00,65,00,74,00,65,00,63,00,74,00,65,00,64,00,5c,00,\
66,00,69,00,72,00,61,00,64,00,69,00,73,00,6b,00,00,00,00,00
"Service"="FiraDisk"
"ConfigFlags"=dword:00000000
"Capabilities"=dword:00000000
"ContainerID"="{00000000-0000-0000-FFFF-FFFFFFFFFFFF}"

Create two files:

C:\USBHD\W7SP1X86\BIN\01.PROCESS.WIMS.CMD

C:\USBHD\W7SP1X86\BIN\02.BUILD.ISO.CMD

Edit 01.PROCESS.WIMS.CMD, edit the line

"SET MOUNTDRIVE=D:"

change drive letter to a drive that exists in your system.


@ECHO off

REM THIS BATCH FILE IS DVDROOT\BIN\01.PROCESS.WIMS.CMD
REM DRIVERS FOLDER IS BIN\DRIVERS
REM IMAGE INDEX 1 OF boot.wim IS Microsoft Windows PE (x86)
REM IMAGE INDEX 2 OF boot.wim IS Microsoft Windows Setup (x86)

MD "%PROGRAMFILES%\ELEVATEMYASS"

IF EXIST "%PROGRAMFILES%\ELEVATEMYASS\" GOTO ELEVATED

ECHO This batch file must be run as Administrator.

PAUSE

GOTO :EOF

:ELEVATED

RD "%PROGRAMFILES%\ELEVATEMYASS"

ECHO Set variables

REM SET MOUNTDRIVE TO A WRITABLE FAST DRIVE IN YOUR PC

SET MOUNTDRIVE=D:

CD /d %~dp0
CD ..
SET TARGET=%cd%

SET DISM="C:\Program Files\Windows AIK\Tools\x86\Servicing\dism.exe"

ECHO Delete some files in TARGET

DEL "%TARGET%\sources\ei.cfg" /Q

REM CREATE BACKUP OR COPY FROM BACKUP IF FOUND

IF NOT EXIST "%TARGET%.BACKUP\" MD "%TARGET%.BACKUP\"
IF NOT EXIST "%TARGET%.BACKUP\sources" MD "%TARGET%.BACKUP\sources"

IF NOT EXIST "%TARGET%.BACKUP\sources\boot.wim" (
ECHO Making backup of boot.wim ...
COPY "%TARGET%\sources\boot.wim" "%TARGET%.BACKUP\sources\boot.wim"
) ELSE (
ECHO Copying boot.wim from backup...
COPY "%TARGET%.BACKUP\sources\boot.wim" "%TARGET%\sources\boot.wim"
)

SET INDEX=2
SET MOUNTDIR=%MOUNTDRIVE%\BOOT.WIM.2
SET WIMFILE=%TARGET%\sources\boot.wim

IF NOT EXIST %MOUNTDIR%\ MD "%MOUNTDIR%"

ECHO Load image %INDEX% of %WIMFILE% into %MOUNTDIR%

%DISM% /mount-wim /wimfile:"%WIMFILE%" /index:%INDEX% /mountdir:"%MOUNTDIR%"

REM COPY autounattend.xml INTO SETUP IMAGE SO SETUP ALLWAYS FINDS IT (USB REMOVABLE VS FIXED)

IF EXIST "%TARGET%\autounattend.xml" COPY "%TARGET%\autounattend.xml" "%MOUNTDIR%\autounattend.xml"

ECHO Add drivers to loaded image

Dism /image:"%MOUNTDIR%" /Add-Driver /driver:"%~dp0DRIVERS" /recurse /forceunsigned

REG unload HKLM\target
REG load HKLM\target "%MOUNTDIR%\Windows\system32\config\SYSTEM"
REG import "%~dp0DRIVERS\FIRADISK\firadisk.reg"
REG unload HKLM\target

%DISM% /unmount-wim /mountdir:"%MOUNTDIR%" /commit

RD "%MOUNTDIR%"

PAUSE

Now edit 02.BUILD.ISO.CMD:


@ECHO OFF

REM THIS BATCH FILE IS DVDROOT\BIN\01.BUILD.ISO.CMD

:oscdimg [options] SourceLocation TargetFile

:http://technet.microsoft.com/en-us/library/cc749036%28WS.10%29.aspx

ECHO Create ISO...

SET oscdimg="C:\Program Files\Windows AIK\Tools\x86\oscdimg.exe"

SET bootfile="%~dp0..\boot\etfsboot.com"

CD /d %~dp0
CD ..
SET sourcedir=%cd%
SET isofile=%cd%.ISO
CD ..
CALL SET "isolabel=%%sourcedir:%cd%\=%%"

CD /d %~dp0

ECHO Source=%sourcedir%
ECHO Target=%isofile%
ECHO Label=%isolabel%

%oscdimg% -u1 -d -h -m -o -l%isolabel% -b%bootfile% "%sourcedir%" "%isofile%"

PAUSE

If you have an autounattend.xml file, copy it to the root of the install folder:

C:\USBHD\W7SP1X86\autounattend.xml

Add any other files you need to customize the install process, for example

C:\USBHD\W7SP1X86\sources/$OEM$\$$\Setup\Scripts\setupcomplete.cmd etc.

Now we are ready to build the ISO. Run 01.PROCESS.WIMS.CMD as administrator (right click). Once the process is finished, run 02.BUILD.ISO.CMD

Now you should have a C:\USBHD\W7SP1X86.BACKUP folder, that contains a backup of the boot.wim file, and a C:\USBHD\W7SP1X86.ISO file.

Repeat the process for each version, for example W7SP1X64, W2008R2X64, etc.

Your USB HD must have ONE formatted NTFS partition. Use Disk Management to create/format. We will assume the USB HD has the letter “X” assigned.

Start BootIce

Select the USB HD as Destination Disk, click “Process MBR”, select “GRUB4DOS” as MBR type, click “Install/Config”, click “Save to disk”, click Close.

Now click “Parts Manage”, verify that the partition is set as active, in column “Act” there should be an “A”, if not click “Activate”. Click “Close”, click “Exit”

Copy C:\USBHD\TOOLS\GRUB4DOS\grldr and grldr.mbr to X:\ (the root of the USB HD)

Create a folder in the USB HD X:\ISOS

Copy all the iso files from C:\USBHD to X:\ISOS

Create a X:\menu.lst file, edit it:


color white/blue black/light-gray
timeout 15
default 0

title Boot from HD
map --unmap=0:0xff
map --unhook
map (hd1) (hd0)
map (hd0) (hd1)
map --hook
chainloader (hd0)+1

title Install Windows 7 Ultimate x86
set ISOFILE=/ISOS/W7SP1X86.ISO
map %ISOFILE% (0xff)
map (hd1) (hd0)
map (hd0) (hd1)
map --mem (md)0x800+4 (0x55)
map --hook
write (0x55) [FiraDisk]\nStartOptions=cdrom,vmem=find:%ISOFILE%\n\0
chainloader (0xff)

title Install Windows 7 Ultimate x64
set ISOFILE=/ISOS/W7SP1X64.ISO
map %ISOFILE% (0xff)
map (hd1) (hd0)
map (hd0) (hd1)
map --mem (md)0x800+4 (0x55)
map --hook
write (0x55) [FiraDisk]\nStartOptions=cdrom,vmem=find:%ISOFILE%\n\0
chainloader (0xff)

title Install Windows 2008 R2 x64
set ISOFILE=/ISOS/W2008R2X64.ISO
map %ISOFILE% (0xff)
map (hd1) (hd0)
map (hd0) (hd1)
map --harddrives=2
map --mem (md)0x800+4 (0x55)
map --hook
write (0x55) [FiraDisk]\nStartOptions=cdrom,vmem=find:%ISOFILE%\n\0
chainloader (0xff)

Edit the menu according to your ISO names and quantity.

Notes:

The autounattend.xml file is inserted into the boot.wim file so Windows Setup will be able to find it under all circumstances.

References:

The Windows® Automated Installation Kit (AIK) for Windows® 7

http://www.microsoft.com/download/en/details.aspx?id=5753

Firadisk

http://reboot.pro/8804/

Grub4Dos

http://code.google.com/p/grub4dos-chenall/downloads/list

BootIce

http://bbs.wuyou.com/viewthread.php?tid=57675

Download Windows Server 2008 R2 with Service Pack 1 (Trial)

http://technet.microsoft.com/en-us/evalcenter/dd459137.aspx

Install Windows 7 from ISO on USB hard disk to SATA hard disk

http://reboot.pro/13968/page__p__123736#entry123736

Edited by Carlos Alloatti
Link to comment
Share on other sites


In the approach of BOOT_USB.exe you don't need to unpack the ISO files and the Grub4dos Menu is build automatically.

http://www.911cd.net/forums//index.php?showtopic=24424

Yes, but if I understand correctly your link, the install process of Windows 7 is very different as when installing from DVD right?

My goals where:

1 Not to have many DVDs/CDs for each OS, but have everything in one USB Hard Drive.

2 The install process should be the same as using the DVD, so there is not need to explain anything, just "choose option 3 and do the same things you do when installing from DVD/CD"

I did not find this anywhere, but did find diferent methods involving doing non standard things during the install, or be able to only have one install set in the USB HD.

This way, you have many independent install ISOs, and the maintenance/updating is just copying over a new version of an ISO to the USB HD.

Link to comment
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.
×
×
  • Create New...