1] Create the Windows PE 3.0 image file and burn it to a CD
2] Boot the computer with the Windows PE 3.0 CD
3] Remove the Windows PE 3.0 CD and insert the Windows 7 32 bit DVD.
4] Issue the following commands from the Windows PE 3.0 envinronment :
X:\Windows\System32\wpeinit
X:\Windows\System32\c:
c:\> md win7
d:
d:\> xcopy *.* /s c:\win7
c:
c:\> md 7
c:\imagex /mountrw c:\win7\sources\install.wim 5 c:\7
X:
X:\Windows\System32\notepad
and edit files located on c:\7\Windows\inf :
usb.inf
CODE
;[SignatureAttributes]
;usbccgp.sys=SignatureAttributes.DRM
;usbhub.sys=SignatureAttributes.DRM
[StandardHub.AddService]
DisplayName = %StandardHub.SvcDesc%
ServiceType = 1 ; SERVICE_KERNEL_DRIVER
;StartType = 3 ; SERVICE_DEMAND_START
StartType = 0 ; SERVICE_BOOT_START
ErrorControl = 1 ; SERVICE_ERROR_NORMAL
ServiceBinary = %12%\usbhub.sys
;LoadOrderGroup = Base
LoadOrderGroup = System Bus Extender
usbport.inf
CODE
[ControlFlags]
;BasicDriverOk = *
;ExcludeFromSelect = *
;[SignatureAttributes]
;usbehci.sys=SignatureAttributes.DRM
;usbhub.sys=SignatureAttributes.DRM
;usbohci.sys=SignatureAttributes.DRM
;usbport.sys=SignatureAttributes.DRM
;usbuhci.sys=SignatureAttributes.DRM
;[SignatureAttributes.DRM]
;DRMLevel=1300
[EHCI.AddReg.NT]
HKR,,EnumPropPages32,,"usbui.dll,USBControllerPropPageProvider"
HKR,,Controller,1,01
;HKLM,System\CurrentControlSet\Services\usbehci,BootFlags,0x00010003,4
[EHCI.AddService]
DisplayName = %EHCIMP.SvcDesc%
ServiceType = 1 ; SERVICE_KERNEL_DRIVER
;StartType = 3 ; SERVICE_DEMAND_START
StartType = 0 ; SERVICE_BOOT_START
ErrorControl = 1 ; SERVICE_ERROR_NORMAL
ServiceBinary = %12%\usbehci.sys
;LoadOrderGroup = Base
LoadOrderGroup = Boot Bus Extender
[OHCI.AddReg.NT]
HKR,,EnumPropPages32,,"usbui.dll,USBControllerPropPageProvider"
HKR,,Controller,1,01
;HKLM,System\CurrentControlSet\Services\usbohci,BootFlags,0x00010003,4
[OHCI.AddService]
DisplayName = %OHCIMP.SvcDesc%
ServiceType = 1 ; SERVICE_KERNEL_DRIVER
;StartType = 3 ; SERVICE_DEMAND_START
StartType = 0 ; SERVICE_BOOT_START
ErrorControl = 1 ; SERVICE_ERROR_NORMAL
ServiceBinary = %12%\usbohci.sys
;LoadOrderGroup = Base
LoadOrderGroup = Boot Bus Extender
[UHCI.AddReg.NT]
HKR,,EnumPropPages32,,"usbui.dll,USBControllerPropPageProvider"
HKR,,Controller,1,01
;HKLM,System\CurrentControlSet\Services\usbuhci,BootFlags,0x00010003,4
[UHCI.AddService]
DisplayName = %UHCIMP.SvcDesc%
ServiceType = 1 ; SERVICE_KERNEL_DRIVER
;StartType = 3 ; SERVICE_DEMAND_START
StartType = 0 ; SERVICE_BOOT_START
ErrorControl = 1 ; SERVICE_ERROR_NORMAL
ServiceBinary = %12%\usbuhci.sys
;LoadOrderGroup = Base
LoadOrderGroup = Boot Bus Extender
[ROOTHUB.AddReg.NT]
HKR,,EnumPropPages32,,"usbui.dll,USBHubPropPageProvider"
;HKLM,System\CurrentControlSet\Services\usbhub,BootFlags,0x00010003,4
[ROOTHUB.AddService]
DisplayName = %ROOTHUB.SvcDesc%
ServiceType = 1 ; SERVICE_KERNEL_DRIVER
;StartType = 3 ; SERVICE_DEMAND_START
StartType = 0 ; SERVICE_BOOT_START
ErrorControl = 1 ; SERVICE_ERROR_NORMAL
ServiceBinary = %12%\usbhub.sys
;LoadOrderGroup = Base
LoadOrderGroup = System Bus Extender
usbstor.inf
CODE
[USBSTOR.AddService]
DisplayName = %USBSTOR.SvcDesc%
ServiceType = 1
;StartType = 3
StartType = 0
ErrorControl = 1
ServiceBinary = %12%\USBSTOR.SYS
;AddReg=DeviceSpecific
LoadOrderGroup = System Bus Extender
X:\Windows\System32\imagex /unmount /commit C:\7
5] Shutdown the computer running Windows PE 3.0,run a working version of Windows 7 and burn the whole content of the folder C:\win7 to a CD.
6] Install Windows 7 (with the modified files) on a SATA disk.
7] Once it has been installed,copy UsbBootWatcher.conf and UsbBootWatcher.exe to \Windows\System32
8] Import this file into the registry :
REGEDIT4
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\UsbBootWatcherService]
"Type"=dword:00000010
"Start"=dword:00000002
"ErrorControl"=dword:00000000
"ImagePath"=hex(2):25,53,79,73,74,65,6d,52,6f,6f,74,25,5c,73,79,73,74,65,6d,33,\
32,5c,55,73,62,42,6f,6f,74,57,61,74,63,68,65,72,2e,65,78,65,00
"DisplayName"="Usb Boot Watcher Service"
"ObjectName"="LocalSystem"
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\UsbBootWatcherService]
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SafeBoot\Network\UsbBootWatcherService]
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\pciide]
"Start"=dword:00000000
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\intelide]
"Start"=dword:00000000
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\viaide]
"Start"=dword:00000000
Now you have installed Windows 7 on a SATA disk. If you want to install it on a USB disk,it is enough to clone eveything there. If you want to install it on a VHD image file too,continue to read.
9] Shut down your computer and boot it again with the Windows PE 3.0 CD
10] Issue the following commands to create a 16GB VHD image file :
a) diskpart
b) create vdisk file=C:\win7.vhd type=fixed maximum=16000
c) select vdisk file=C:\win7.vhd
d) attach vdisk
e) exit
11] Install Windows 7 on the Unallocated Space.
12] When your computer reboots,remove the Windows 7 DVD and let the installation of Windows 7 (running from the VHD image file),completes.
13] When it is completed,boot it and when it is fully loaded,copy UsbBootWatcher.conf and UsbBootWatcher.exe to \Windows\System32
14] Import this file into the registry :
REGEDIT4
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\UsbBootWatcherService]
"Type"=dword:00000010
"Start"=dword:00000002
"ErrorControl"=dword:00000000
"ImagePath"=hex(2):25,53,79,73,74,65,6d,52,6f,6f,74,25,5c,73,79,73,74,65,6d,33,\
32,5c,55,73,62,42,6f,6f,74,57,61,74,63,68,65,72,2e,65,78,65,00
"DisplayName"="Usb Boot Watcher Service"
"ObjectName"="LocalSystem"
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\UsbBootWatcherService]
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SafeBoot\Network\UsbBootWatcherService]
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\pciide]
"Start"=dword:00000000
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\intelide]
"Start"=dword:00000000
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\viaide]
"Start"=dword:00000000
15] Clone everything to a USB disk.
OLD VERSION :
This is what I did :
1] Created the Windows PE 3.0 image file :
a) imagex /mountrw c:\winpe\winpe.wim 1 c:\winpe\mount
b) xcopy "c:\Program Files\Windows AIK\Tools\Servicing" c:\winpe\mount\Windows /s
c) xcopy "c:\Program Files\Windows AIK\Tools\x86" c:\winpe\mount\Windows /s /y
d) imagex /unmount c:\winpe\mount /commit
e) copy c:\winpe\winpe.wim c:\winpe\ISO\sources\boot.wim /y
f) oscdimg -n -bc:\winpe\etfsboot.com c:\winpe\ISO c:\winpe\winpe.iso
2] Copied Windows 7 files from DVD source to "(hd0,0)\Win7" directory
3] Booted into WinPE and identified (hd0,0) as C: drive
3.1] imagex /mountrw C:\win7\sources\install.wim 5 C:\7
3.2] gone into C:\7\windows\inf and edited files :
usb.inf
[codebox];[SignatureAttributes] ;usbccgp.sys=SignatureAttributes.DRM ;usbhub.sys=SignatureAttributes.DRM [StandardHub.AddService] DisplayName = %StandardHub.SvcDesc% ServiceType = 1 ; SERVICE_KERNEL_DRIVER ;StartType = 3 ; SERVICE_DEMAND_START StartType = 0 ; SERVICE_BOOT_START ErrorControl = 1 ; SERVICE_ERROR_NORMAL ServiceBinary = %12%\usbhub.sys ;LoadOrderGroup = Base LoadOrderGroup = System Bus Extender[/codebox] usbport.inf [codebox] [ControlFlags] ;BasicDriverOk = * ;ExcludeFromSelect = * ;[SignatureAttributes] ;usbehci.sys=SignatureAttributes.DRM ;usbhub.sys=SignatureAttributes.DRM ;usbohci.sys=SignatureAttributes.DRM ;usbport.sys=SignatureAttributes.DRM ;usbuhci.sys=SignatureAttributes.DRM ;[SignatureAttributes.DRM] ;DRMLevel=1300 [EHCI.AddReg.NT] HKR,,EnumPropPages32,,"usbui.dll,USBControllerPropPageProvider" HKR,,Controller,1,01 ;HKLM,System\CurrentControlSet\Services\usbehci,BootFlags,0x00010003,4 [EHCI.AddService] DisplayName = %EHCIMP.SvcDesc% ServiceType = 1 ; SERVICE_KERNEL_DRIVER ;StartType = 3 ; SERVICE_DEMAND_START StartType = 0 ; SERVICE_BOOT_START ErrorControl = 1 ; SERVICE_ERROR_NORMAL ServiceBinary = %12%\usbehci.sys ;LoadOrderGroup = Base LoadOrderGroup = Boot Bus Extender [OHCI.AddReg.NT] HKR,,EnumPropPages32,,"usbui.dll,USBControllerPropPageProvider" HKR,,Controller,1,01 ;HKLM,System\CurrentControlSet\Services\usbohci,BootFlags,0x00010003,4 [OHCI.AddService] DisplayName = %OHCIMP.SvcDesc% ServiceType = 1 ; SERVICE_KERNEL_DRIVER ;StartType = 3 ; SERVICE_DEMAND_START StartType = 0 ; SERVICE_BOOT_START ErrorControl = 1 ; SERVICE_ERROR_NORMAL ServiceBinary = %12%\usbohci.sys ;LoadOrderGroup = Base LoadOrderGroup = Boot Bus Extender [UHCI.AddReg.NT] HKR,,EnumPropPages32,,"usbui.dll,USBControllerPropPageProvider" HKR,,Controller,1,01 ;HKLM,System\CurrentControlSet\Services\usbuhci,BootFlags,0x00010003,4 [UHCI.AddService] DisplayName = %UHCIMP.SvcDesc% ServiceType = 1 ; SERVICE_KERNEL_DRIVER ;StartType = 3 ; SERVICE_DEMAND_START StartType = 0 ; SERVICE_BOOT_START ErrorControl = 1 ; SERVICE_ERROR_NORMAL ServiceBinary = %12%\usbuhci.sys ;LoadOrderGroup = Base LoadOrderGroup = Boot Bus Extender [ROOTHUB.AddReg.NT] HKR,,EnumPropPages32,,"usbui.dll,USBHubPropPageProvider" ;HKLM,System\CurrentControlSet\Services\usbhub,BootFlags,0x00010003,4 [ROOTHUB.AddService] DisplayName = %ROOTHUB.SvcDesc% ServiceType = 1 ; SERVICE_KERNEL_DRIVER ;StartType = 3 ; SERVICE_DEMAND_START StartType = 0 ; SERVICE_BOOT_START ErrorControl = 1 ; SERVICE_ERROR_NORMAL ServiceBinary = %12%\usbhub.sys ;LoadOrderGroup = Base LoadOrderGroup = System Bus Extender [/codebox] usbstor.inf [codebox][USBSTOR.AddService] DisplayName = %USBSTOR.SvcDesc% ServiceType = 1 ;StartType = 3 StartType = 0 ErrorControl = 1 ServiceBinary = %12%\USBSTOR.SYS LoadOrderGroup = System Bus Extender[/codebox] 3.3] imagex /unmount /commit C:\7 4] Started diskpart and entered the following commands to create a 16GB .vhd file : a) create vdisk file=C:\win7.vhd type=fixed maximum=16000 b) select vdisk file=C:\win7.vhd c) attach vdisk d) exit 5] Ran the Windows 7 setup file on "C:\Win7\setup.exe" (from directory Win7 on disk (hd0,0)). 6] Installed Windows on the Unallocated Space until first reboot. 7] During the installation,the BCD store has been automatically created on the active partition on (hd0,0). I booted Windows 7 from it and the installation has been completed. 8] Booted the VHD image file from Sata disk and imported this file into registry : [code]REGEDIT4 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\UsbBootWatcherService] "Type"=dword:00000010 "Start"=dword:00000002 "ErrorControl"=dword:00000000 "ImagePath"=hex(2):25,53,79,73,74,65,6d,52,6f,6f,74,25,5c,73,79,73,74,65,6d,33,\ 32,5c,55,73,62,42,6f,6f,74,57,61,74,63,68,65,72,2e,65,78,65,00 "DisplayName"="Usb Boot Watcher Service" "ObjectName"="LocalSystem" [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\UsbBootWatcherService] [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SafeBoot\Network\UsbBootWatcherService] [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\pciide] "Start"=dword:00000000 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\intelide] "Start"=dword:00000000[/code]
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\viaide]
"Start"=dword:00000000
9] Enabled Auto Reboot On System Crash
10] Booted WIndows 7 from Sata disk and copied win7.VHD into USB disk
11] Booted Windows 7 on USB disk and created entries to boot the VHD image file :
c:\windows\system32>bcdedit /copy {current} /d "Boot From VHD"
The entry was succesfully copied to {d1c322bc-0f4e-11de-a271-8c2cd1e4be0a}
c:\windows\system32>bcdedit /set {d1c322bc-0f4e-11de-a271-8c2cd1e4be0a} device vhd=[C:]\win7.vhd
c:\windows\system32>bcdedit /set {d1c322bc-0f4e-11de-a271-8c2cd1e4be0a} osdevice vhd=[C:]\win7.vhd
c:\windows\system32>bcdedit /set {d1c322bc-0f4e-11de-a271-8c2cd1e4be0a} detecthal on
c:\windows\system32>bcdedit /set {d1c322bc-0f4e-11de-a271-8c2cd1e4be0a} description "VHD Boot"
Edited by Marietto2009, 13 October 2010 - 08:35 AM.