Creating a WinPE 3.0

Veröffentlicht von

This script is based of Michael Khanins WinPE 3.0 Script and extended with automatic driver integration, an explorer like shell, autostart entries, modified languages for the PE environment and useful programs.

Pre-Requirements

Microsoft Windows AIK for Windows 7
This script needs to be run from an administrative Deployment Tools Command Prompt.
You should have the following folder structure:

Mine does look like this:

All Programs in the Programs Folder will be included in the WinPE under Program Files.

Script

@echo off<br />
%SYSTEMDRIVE%</p>
<p>CD &quot;C:Program FilesWindows AIKToolsPETools&quot;</p>
<p>Set Architecture=x86<br />
Set PEDest=d:WinPE30Image<br />
Set ISOName=winpe_x86.iso<br />
Set removeboot=true<br />
Set SourceDir=d:WinPE30</p>
<p>pushd %cd%</p>
<p>call copype.cmd %Architecture% %PEDest%</p>
<p>Dism /Mount-Wim /WimFile:%PEDest%winpe.wim /index:1 /MountDir:%PEDest%mount<br />
Dism /image:%PEDest%mount /Set-InputLocale:0407:00000407<br />
Dism /image:%PEDest%mount /Get-Packages</p>
<p>Dism /image:%PEDest%mount /Add-Package /PackagePath:&quot;C:Program FilesWindows AIKToolsPETools%Architecture%WinPE_FPswinpe-hta.cab&quot;<br />
Dism /image:%PEDest%mount /Add-Package /PackagePath:&quot;C:Program FilesWindows AIKToolsPETools%Architecture%WinPE_FPsen-uswinpe-hta_en-us.cab&quot;</p>
<p>Dism /image:%PEDest%mount /Add-Package /PackagePath:&quot;C:Program FilesWindows AIKToolsPETools%Architecture%WinPE_FPswinpe-legacysetup.cab&quot;<br />
Dism /image:%PEDest%mount /Add-Package /PackagePath:&quot;C:Program FilesWindows AIKToolsPETools%Architecture%WinPE_FPsen-uswinpe-legacysetup_en-us.cab&quot;</p>
<p>Dism /image:%PEDest%mount /Add-Package /PackagePath:&quot;C:Program FilesWindows AIKToolsPETools%Architecture%WinPE_FPswinpe-mdac.cab&quot;<br />
Dism /image:%PEDest%mount /Add-Package /PackagePath:&quot;C:Program FilesWindows AIKToolsPETools%Architecture%WinPE_FPsen-uswinpe-mdac_en-us.cab&quot;</p>
<p>Dism /image:%PEDest%mount /Add-Package /PackagePath:&quot;C:Program FilesWindows AIKToolsPETools%Architecture%WinPE_FPswinpe-pppoe.cab&quot;<br />
Dism /image:%PEDest%mount /Add-Package /PackagePath:&quot;C:Program FilesWindows AIKToolsPETools%Architecture%WinPE_FPsen-uswinpe-PPPOE_en-us.cab&quot;</p>
<p>Dism /image:%PEDest%mount /Add-Package /PackagePath:&quot;C:Program FilesWindows AIKToolsPETools%Architecture%WinPE_FPswinpe-scripting.cab&quot;<br />
Dism /image:%PEDest%mount /Add-Package /PackagePath:&quot;C:Program FilesWindows AIKToolsPETools%Architecture%WinPE_FPsen-uswinpe-scripting_en-us.cab&quot;</p>
<p>Dism /image:%PEDest%mount /Add-Package /PackagePath:&quot;C:Program FilesWindows AIKToolsPETools%Architecture%WinPE_FPswinpe-wmi.cab&quot;<br />
Dism /image:%PEDest%mount /Add-Package /PackagePath:&quot;C:Program FilesWindows AIKToolsPETools%Architecture%WinPE_FPsen-uswinpe-wmi_en-us.cab&quot;</p>
<p>copy &quot;C:Program FilesWindows AIKTools%Architecture%imagex.exe&quot; %PEDest%mountWindowsSystem32</p>
<p>REM Copy NIC and Mass Storage Drivers into PE-Image<br />
echo.<br />
echo Including Network Interface Card drivers...<br />
REM Dism /image:%PEDest%mount /Add-Driver /driver:%SourceDir%NICSubfoldermydriver.inf<br />
echo.<br />
echo Including Mass Storage drivers...<br />
REM Dism /image:%PEDest%mount /Add-Driver /driver:%SourceDir%MassStorageSubfoldermydriver.inf<br />
echo.<br />
REM Copy Programfiles into PE-Image<br />
echo Including Programs...<br />
xcopy %SourceDir%Programs* &quot;%PEDest%mountProgram Files&quot; /e /i /h<br />
echo.<br />
echo Configuring Autostart entrys...<br />
copy %SourceDir%winpeshl.ini %PEDest%mountWindowsSystem32<br />
echo.</p>
<p>Dism /Unmount-Wim /MountDir:%PEDest%mount /Commit<br />
Copy %PEDest%winpe.wim %PEDest%ISOsourcesboot.wim</p>
<p>IF &quot;%removeboot%&quot;==&quot;true&quot; del /q %pedest%isobootbootfix.bin</p>
<p>oscdimg -n -b%PEDest%etfsboot.com -lWinPE_30 %PEDest%ISO %PEDest%%ISOName%</p>
<p>Dism /cleanup-wim</p>
<p>popd<br />
pause

Explanations

/Set-InputLocale sets the input locales and keyboard layouts to use in the offline Windows image.
For a list of the default input locale values, see here and here.
You need the hex values to define your locales. If you want to include drivers uncomment the following lines (remove REM to uncomment):
REM Dism /image:%PEDest%mount /Add-Driver /driver:%SourceDir%NICSubfoldermydriver.inf
REM Dism /image:%PEDest%mount /Add-Driver /driver:%SourceDir%MassStorageSubfoldermydriver.inf

You need one line per inf file. You can also change the folder structure. The folders were just added to differ between the drivers.

With winpeshl.ini you configure your autostart entries.
winpeshl.ini has the following content:
[LaunchApps] %SYSTEMDRIVE%Windowssystem32startnet.cmd
%ProgramFiles%bginfobginfo.cmd
%ProgramFiles%bsexplorerBsLogon.exe

startnet.cmd does general initialization for the PE environment.
bginfo.cmd runs a pre configured Background Information script.
BsLogon is the first exe to get BsExplorer working.
BsExplorer is an Explorer like environment.
You can get it from here: http://www.kursknet.ru/~boa/en/index.html –> windows pe –> My programs for Win PE.
My BsExplorer config and a modified CommonEng.dll, with Ressource Hacker to correct some language mistakes, is uploaded as a zip-Archive here.

Ein Kommentar

Kommentar hinterlassen

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.