Sorry, image hosting website has deleted all the pictures.
Description:
Description:
This guide is for Windows 7 x64, but you can apply the same principles to the installation of Windows 7, 8 and 10 (x86 or x64).
Installation takes place in a WinPE environment and it's almost completely automated, but it leaves the user the ability to choose what to install (e.g. Windows HomePremium or Ultimate) and where to install (hdd or partition).
This is only an example; later, I will show you how to change commands, paths and everything else.
I install Windows from my home server (\\192.168.1.2), but you are free to install it from any other support or location:
Internal HDD --> fast
External HDD, USB --> portable
Shared folder --> flexible
DvD --> slow
1) When WinPE is loaded, type "install" and press ENTER.
2) Select volume number and press ENTER.
3) Select image number and press ENTER.
4) ImageX is applying the image...
5) ImageX has successfully applied image and boot files are created.
Press any key to reboot...
(Setup will continue after reboot...)
Easy, don’t you think?
Yes, but it needs a bit of work...
Files:
To automate the Windows system installation we need to give to our PC some instructions.
I set these instructions in a batch file inside WinPE iso:
Windows\System32\install.bat
To automate Diskpart tasks I use text files:
Windows\SysWOW64\0.txt
Windows\SysWOW64\1.txt
...
Download links:
install.bat --> http://www69.zippyshare.com/v/UBAQxaFM/file.html
0.txt --> http://www69.zippyshare.com/v/kR6iYTIO/file.html
1.txt --> http://www69.zippyshare.com/v/yodzlt41/file.html
Download links:
install.bat --> http://www69.zippyshare.com/v/UBAQxaFM/file.html
0.txt --> http://www69.zippyshare.com/v/kR6iYTIO/file.html
1.txt --> http://www69.zippyshare.com/v/yodzlt41/file.html
The install.bat file is divided into four sections: start, diskpart, image, boot.
:Start (preliminary operations):
----------------------------------------------
----------------------------------------------
wpeinit --> It stands for WinPE initialization (usually executed by startnet.cmd)
net use --> It connects the network resource (directory where Windows images are)
cd --> Go to SysWOW64 folder (to install x64 systems you have to use ImageX x64)
:Diskpart (HDD preparation):
----------------------------------------------
----------------------------------------------
echo list volume --> It lists all volumes
set /p choice --> It asks where we want to install Windows (usually, the system is on the first hdd or partition; but, if you have a CD-ROM drive, Microsoft will assign the first slot to it).
If, for example, Volume 1 is selected, Diskpart will execute text file 1.txt:
Spoiler :
select volume 1
format fs=NTFS quick label="Winsys"
assign letter=c
active
exitVolume 1 is selected and formatted.
C letter is assigned and the volume is set to active (this will be the boot partition).
Note.
The System Reserved partition (100MB) is completely useless; delete it.
Note.
The System Reserved partition (100MB) is completely useless; delete it.
:Image (system installation):
----------------------------------------------
----------------------------------------------
set /p choice --> We choose which image to install from available.
:Boot (boot files copy and reboot):
----------------------------------------------
----------------------------------------------
bcdboot --> Boot files are copied to C:\
pause --> Optional
pause --> Optional
Exit --> Installation will continue after restart
Detailed procedure:
1) How to create WinPE iso:
https://technet.microsoft.com/en-us/library/cc709665%28v=ws.10%29.aspx
-If you want to install your system over lan you need to integrate network drivers:
https://technet.microsoft.com/en-us/library/dn613857.aspx
-It is highly recommended to integrate ImageX (x86 and x64) in WinPE\sources\boot.wim.
-Also, we need to integrate into boot.wim our batch and text files.
-Also, we need to integrate into boot.wim our batch and text files.
Example.
Press Shift and right-click mouse in the folder where "boot.wim" is (e.g. C:\WinPE\sources), then select "Open Command window here".Create mount folder into C :
mkdir c:\mount
Mount boot.wim :
imagex /mountrw boot.wim 1 c:\mount
Now,
copy imagex.exe (x86) and install.bat in --> C:\mount\Windows\System32.
copy imagex.exe (x64), 0.txt and 1.txt in --> C:\mount\Windows\SysWOW64.
Save image and unmount :
imagex /commit /unmount c:\mount
2) How to boot in WinPE
You can use CD or USB support, but you can also install WinPE on your hard drive:
How to create a dual boot system :
Boot WinPE from CD or USB.
Enter Diskpart.
Partitioning disk (example):
C:\Windows
------------------------------------------
create partition primary size=20480
format fs=ntfs quick label="Winsys"
active
assign letter=c
------------------------------------------
D:\WinPE
------------------------------------------
create partition primary size=1024
format fs=ntfs quick label="WinPE"
active
assign letter=d
------------------------------------------
(Optional) Create a logical partition (e.g. for swap, database, downloads, temp, etc.).
Apply install.wim (Windows image) to C:\ and boot.wim (WinPE image) to D:\ using ImageX.
Copy boot files into C:\Windows:
bcdboot C:\Windows
Restart PC and boot from C:\Windows.
Generate GUID:
----------------------------------------
Run Command prompt and type:
bcdedit /create /d winpe /application osloader
In this script, replace "GUID" with your generated code:
--------------------------------------------------------------------------
bcdedit /set {GUID} osdevice partition=d:
bcdedit /set {GUID} device partition=d:
bcdedit /set {GUID} path \windows\system32\winload.exe
bcdedit /set {GUID} systemroot \windows
bcdedit /set {GUID} winpe yes
bcdedit /set {GUID} detecthal yes
bcdedit /displayorder {GUID} /addlast
copy c:\windows\system32\winload.exe d:\windows\system32
--------------------------------------------------------------------------
Save the script as .bat and apply.
Now, when you start your PC, you can choose to boot in Windows or in WinPE.
Enter Diskpart.
Partitioning disk (example):
C:\Windows
------------------------------------------
create partition primary size=20480
format fs=ntfs quick label="Winsys"
active
assign letter=c
------------------------------------------
D:\WinPE
------------------------------------------
create partition primary size=1024
format fs=ntfs quick label="WinPE"
active
assign letter=d
------------------------------------------
(Optional) Create a logical partition (e.g. for swap, database, downloads, temp, etc.).
Apply install.wim (Windows image) to C:\ and boot.wim (WinPE image) to D:\ using ImageX.
Copy boot files into C:\Windows:
bcdboot C:\Windows
Restart PC and boot from C:\Windows.
Generate GUID:
----------------------------------------
Run Command prompt and type:
bcdedit /create /d winpe /application osloader
In this script, replace "GUID" with your generated code:
--------------------------------------------------------------------------
bcdedit /set {GUID} osdevice partition=d:
bcdedit /set {GUID} device partition=d:
bcdedit /set {GUID} path \windows\system32\winload.exe
bcdedit /set {GUID} systemroot \windows
bcdedit /set {GUID} winpe yes
bcdedit /set {GUID} detecthal yes
bcdedit /displayorder {GUID} /addlast
copy c:\windows\system32\winload.exe d:\windows\system32
--------------------------------------------------------------------------
Save the script as .bat and apply.
Now, when you start your PC, you can choose to boot in Windows or in WinPE.
3) Installation procedure
This is the easy part:
Type "install" and press ENTER.
Select Volume number # and press ENTER.
Select Image number # and press ENTER.
Press any key to continue...
The installation will continue after the reboot...
How to personalize install.bat:
In the Start section, you may delete line 4 (this is only for network installation) and line 5 (if you install a 32-bit image).
In the Diskpart section, you may add more volumes after line 12...
For example, volume 2:
if "%choice%"=="2" diskpart / 2.txt
Naturally, you need to add the correspondent text file in WinPE\Windows\System32 or WinPE\Windows\SysWOW64.
In the Image section you can create your systems list and set the relative paths:
Example.
You have a default install.wim on your hard drive (E:\).
You decide to use the default Microsoft index to list all Windows Edition:
### Image
--- ----------------------------
1 Windows 7 HomeBasic
2 Windows 7 HomePremium
3 Windows 7 Professional
4 Windows 7 Ultimate
If, for example, you want to install the Ultimate edition, the only thing you have to do is indicating to ImageX the image path and its index number:
if "%choice%"=="4" imagex apply E:\install.wim 4 C:\
In the Boot section you may want to change C:\Windows path (if you install on a different partition e.g. F:\) or remove the "pause" command (if you want to restart automatically).
Conclusions:
It is not the state of the art, but it is simple and effective.
1) The installation is faster than the default one:
-no graphics... slightly faster
-WinPE loads... much faster
-you can install from internal drive... much more faster
2) You can have a complete control of the disk partitioning.
Advice.
Use AutoUnattend.xml or Unattend.xml files to automate the second part of setup:
https://technet.microsoft.com/en-us/library/cc749415%28v=ws.10%29.aspx
Mvp77