If you repost, clearly indicate the author and the original website of the reprinted article:
Http://blog.sina.com.cn/s/blog_6e94205b0100njpj.html
Thank you.
Xiao zhengbo (happymy)
This article has technical problems. Please read the following amendments:
Http://blog.sina.com.cn/s/blog_6e94205b0100o3po.html
Chapter 4 practical development
4.1 what should we do?
OK. I think you should have a preliminary understanding of wes7 development after reading the first three chapters. This chapter describes how to use VMWare virtual machines as the hardware platform. A Wes 7 embedded system image is developed on the vmwarevm. This demonstrates a standard development process for writing response files and custom development tools using ice. This development process includes some embedded features. It covers how to configure the response file for unattended installation, how to integrate drivers, how to execute custom commands and scripts during image installation, and how to encapsulate system images for large-scale deployment. problems frequently encountered.
4.2 create virtual machines and collect hardware information
• Step 1:How to Create a VMware Workstation 7 VM is not described here. You only need to set the virtual machine's host operating system to "Windows 7.
Figure 4-1 VMware Workstation Virtual Machine
• Step 2:Load standard_7_32bit.iso to the optical drive of the VM, start the VM, and boot from the CD. Click "launch winpe command prompt"
• Step 3:Prepare a formatted USB flash drive and mount the USB flash drive to the VM.
• Step 4: Type "tap/o C:/demo. pmq". C: The drive letter of the USB flash drive (Save the generated pmq file to the USB flash drive)
4.3Image configuration Editor (ICE) to compile the response file (Use and build the motherboard image)
• Step 1: OpenImage configuration Editor (ICE), choose "file"> "select distribution share" to select the location of the distribution share folder. The default location is "C:/program files/Windows Embedded Standard 7/Ds". For 64bit distribution share, the folder name should be DS64. Distribution share is provided by development tools. Users should not create new folders in their root directories.
• Step 2: click "new ..." Button to create a new response file. Double-click thin client. xml under "Distribution share/templates/IBW"
• Step 3: Choose "File> Import pmq", select the pmq file generated in the previous section, and import it.
• Step 4: Choose "Validate> Add required packages ". Double-click the error message below.
• Step 5:Deselect "Windows Explorer Shell" and select "Command Prompt shell with shell support" and "simplified (PRC) Chinese Language Pack ". Click OK.
• Step 6:Menu "Validate> Add required packages ". Expand "Distribution share/packages/Feature Pack/Embedded enabling features" and double-click hide boot screens.
• Step 7:Find windows under the installation directory of VMware Workstation. ISO. Use WinRAR or other software to open windows. ISO: Copy all the files in the file to "/$ OEM $ folders/$1/program files/vmtoolsetup" in the DS database, for example: C: /program files/Windows Embedded Standard 7/DS/$ OEM $ folders/$1/program files/vmtoolsetup "folder.
Create a script file named "setupcomplete. cmd" in the "/DS/$ OEM $ folders/$1/Windows/Setup/scripts" folder. Edit the file and add the following command:
"C:/program files/vmtoolsetup/setup.exe"/V/Qn
C:/Windows/system32/calc.exe
In this way, the above two commands will be executed in the first stage (oobe), but the method of executing the command or script will not check the return value of the executed command. In addition, as shown above, after the first command is executed, the computer is restarted, which may cause the second command to be unexecuted or not executed completely. This should be noted during the development process!
• Step 8:Copy the "SCSI" folder "/$ OEM $ folders/$1/program files/vmtoolsetup/program files/vmware/VMware Tools/Drivers/" of the DS Library to the DS Library "/out-of-box DRIVERS directory, for example: /program files/Windows Embedded Standard 7/DS/$ OEM $ folders/$1/program files/vmtoolsetup/program files/copy the "SCSI" folder of VMware/VMware Tools/Drivers to "C: /program files/Windows Embedded Standard 7/DS/out-of-box drivers folder.
All files in the $1 folder will be automatically copied to the target system disk by Ibe. Other "variables" similar to "$1" can be queried from the help documentation. In addition to this integration file, use imagex to modify the install. Wim file in the IBW/DS directory. I will not go into details here.
• Step 9:Menu "Insert> OEM folders path ..." Select the "$ OEM $ Folders" folder under "C:/program files/Windows Embedded Standard 7/Ds" and click "open.
• Step 10:Press the shortcut key Ctrl + F, enter home, and click find. Double-click IE-InternetExplorer_x86/home_page under answer file ".
• Step 11:Set "value" of "home_page" to "www.cyent.com.cn ".
• Step 12:Set "value" of "disablefirstrunwizard" and "disablewelcomepage" at the top of the page to "true ".
• Step 13:Expand and select "Answer file/untitled/featurepack/User Interface/Command Prompt shell with shell support ".
Set "filter view by:" to "2 offline servicing ".
Set "value" of "customshell" to "C:/Windows/system32/cmd.exe"
This is called a custom shell and is one of the common embedded features. Users can be "locked" in custom applications. The command prompt is used as an example (the command prompt is used by default ).
• Step 14:After completing step 2, select "Distribution share/out-of-box Drivers/mydevices" and Right-click "insert drive path to pass 1 windowspe"
This is called an integrated driver. This method can only integrate drivers in INF format! The drive of the disk controller (this type of driver is called the driver that must be loaded when the system starts) must be loaded in the first stage. Otherwise, no available disk can be found.
• Step 15:Expand "Answer file/untitled/product/operating system/Foundation CORE/Windows Embedded edition/setup_x86/userdata"
Set "filter view by:" to "1 windowspe"
Set "value" of "acepteula" to "true ".
Expand and set "value" of "productkeykey/" as the product serial number. If not, leave it blank. Do not use 00000-00000-00000-00000-00000.
Set "value" of "willshowui" to "onerror"
• Step 16:Expand answer file/untitled/product/operating system/Foundation CORE/Windows Embedded edition/International-Core-WinPE_X86 ".
Set "filter view by:" to "1 windowspe ".
Set "value" of "uilanguage" to "ZH-CN ".
• Step 17:Expand answer file/untitled/product/operating system/Foundation CORE/Windows Embedded edition/International-Core_X86 ".
Set "filter view by:" to "4 specialize ".
Set "value" of "uilanguage" to "ZH-CN ".
• Step 18:Create a text file named disksp.txt under the DS/movie oemedia foldersfolder.
Select disk 0
Create partition primary
Select partition 1
Format FS = NTFS quick
Active
Exit
Copy the above script to the text document and save it.
Menu "insert/Synchronous command/pass 1 windows PE ...", In the displayed window, type (only the characters in bold are entered ):
"Diskpart/s" D:/autounattend_files/windowspe/$ OEM $ folders/disksp.txt ". Click "OK.
In the first stage, we call dskpart to partition and configure partitions. Runsynchronous and runasynchronous can execute commands at the specified stage. The difference between runsynchronous and runasynchronous is that runsynchronous will execute the next one only after the current command is executed.
• Step 19:Expand "Answer file/untitled/product/operating system/Foundation CORE/Windows Embedded edition/setup_x86/imageinstall ".
Set "filter view by:" to "1 windowspe ".
Set "value" of "installtoavailablepartition" to "true ".
This setting causes the system image to be installed in the first active partition. To specify the installation partition, expand "installto ". Set "value" of partitionid and "diskid ".
• Step 20:Expand answer file/untitled/product/operating system/Foundation CORE/Windows Embedded edition/Shell-Setup_X86/oobe"
Set "filter view by:" to "7 oobe System"
Set "value" of "networklocation" to "work ".
Set "value" of "skipuseroobe" to "true ".
Set "value" of "skipmachineoobe" to "true ".
Set "value" of "hidewirelesssetupinoobe" to "true ".
Set "value" of "protectyourpc" to "1 ".
Set "value" of "hideeulapage" to "true ".
These settings can skip the oobe stage to set up new users and wireless networks.
• Step 21:Expand and select answer file/untitled/product/operating system/Foundation CORE/Windows Embedded edition/Shell-Setup_X86/u
Seraccounts/localaccount ". Right-click and Choose Insert new localaccount from the shortcut menu ".
Set "name" to "cybr"
Set "displayname" to "cybr"
Expand "password" and set "value" to "cybr"
Set the following "group" to "Administrators"
• Step 22:Expand "Answer file/untitled/product/operating system/fou
Ndation Core/Windows Embedded edition/Shell-Setup_X86/autologon"
Set "filter view by:" to "4 specialize ".
Set "value" of "username" to "cybr ".
Set "value" of "enabled" to "true ".
Set "value" of "password" to "cybr ".
• Step 23:Menu "Validate> Add required packages ".
Press the "Ctrl + S" shortcut key to save the response file to the desktop and use the default file name.
Choose "Tools"> "Create media"> "create IBW image from answer File"
In the displayed window, click "…". Select the "C:/osimage" folder and click "OK" to generate the system image.
• Step 24:Open the "Start" menu, find the command prompt in "attachment", right-click it, and select "Run as administrator" in the pop-up menu ".
Enter the following commands in sequence:
Cd c:/program files/Windows Embedded Standard 7/tools/x86
Oscdimg-n-m-B "C:/program files/Windows Embedded Standard 7/tools/IBW/x86/boot/etfsboot.com" C:/osimage. ISO
In this way, the installation source of the system image is packaged into an iso cd image file.
• Step 25: copy the created ISO image to the VM and start the VM. If the preceding steps are correct. Wait for 40 minutes for the system to be built smoothly and no manual intervention is required during this period.
4.4Image configuration Editor (ICE) to write the response file (for sysprep encapsulation system)
First of all, we will provide a more "general" response file (testsysprep. XML). Some content of the response file must be modified before it can be used! The content of the response file is as follows:
<? XML version = "1.0" encoding = "UTF-8"?>
<Unattend xmlns = "urn: Schemas-Microsoft-com: unattend" xmlns: wcm = "Subtitle xmlns: ew =" urn: Schemas-Microsoft-com: embedded. unattend. internal. v1 ">
<Servicing>
<Package action = "Configure">
<Assemblyidentity name = "Microsoft-Windows-embeddedition" version = "6.1.7600.16385" processorarchitecture = "x86" publickeytoken = "comment" Language = "neutral" versionscope = "nonsxs"/>
<EW: packageinfo releasetype = "product" minminfoversion = "1.0"/>
</Package>
</Servicing>
<Settings pass = "generalize">
<Component name = "Microsoft-Windows-pnpsysprep" processorarchitecture = "x86" publickeytoken = "31bf3856ad364e35" Language = "neutral" versionscope = "nonsxs" xmlns: xsi = "external>
<Persistalldeviceinstils> true </persistalldeviceinstils>
</Component>
<Component name = "Microsoft-Windows-security-licensing-SLC" processorarchitecture = "x86" publickeytoken = "31bf3856ad364e35" Language = "neutral" versionscope = "nonsxs" xmlns: xsi = "http://www.w3.org/2001/xmlschema-instance”>
<Skiprearm> 0 </skiprearm>
</Component>
</Settings>
<Settings pass = "specialize">
<Component name = "Microsoft-Windows-International-core" processorarchitecture = "x86" publickeytoken = "31bf3856ad364e35" Language = "neutral" versionscope = "nonsxs" xmlns: xsi = "external>
<Uilanguage> ZH-CN </uilanguage>
</Component>
<Component name = "Microsoft-Windows-shell-setup" processorarchitecture = "x86" publickeytoken = "31bf3856ad364e35" Language = "neutral" versionscope = "nonsxs" xmlns: xsi = "external>
<Productkey> 00000-00000-00000-00000-00000 </productkey>
</Component>
</Settings>
<Settings pass = "oobesystem">
<Component name = "Microsoft-Windows-shell-setup" processorarchitecture = "x86" publickeytoken = "31bf3856ad364e35" Language = "neutral" versionscope = "nonsxs" xmlns: xsi = "external>
<Autologon>
<Password>
<Value> cybr </value>
<Plaintext> true </plaintext>
</Password>
<Username> cybr </username>
<Enabled> true </enabled>
</Autologon>
<Oobe>
<Networklocation> Work </networklocation>
<Skipuseroobe> true </skipuseroobe>
<Skipmachineoobe> true </skipmachineoobe>
<Hidewirelesssetupinoobe> true <Protectyourpc> 1 </protectyourpc>
<Hideeulapage> true </Oobe>
</Component>
</Settings>
<Settings pass = "windowspe">
<Component name = "Microsoft-Windows-International-core-winpe" processorarchitecture = "x86" publickeytoken = "31bf3856ad364e35" Language = "neutral" versionscope = "nonsxs" xmlns: xsi = "http://www.w3.org/2001/xmlschema-instance”>
<Uilanguage> ZH-CN </uilanguage>
</Component>
</Settings>
<EW: answerfileinfo distributionsharepath = "C:/program files/Windows Embedded Standard 7/Ds" footprint = "576716800" ecorefootprint = "576716800"/>
</Unattend>
You can use ice to open the response file and see which configurations have been changed. In particular, an error is reported when ice saves the response file. This is normal because no "component package" is added to the response file and cannot be used to build system images. Therefore, ignore these errors directly. After all, using ice to write a response file is much more convenient than using notepad. The above response file is configured in total:
1. Set the settings in the oobe process (so that unattended deployment is achieved)
2. Skip hardware detection (reduce the deployment time and do not delete the configured driver .)
3. Automatic Logon (this need should be changed as needed .)
4. Set the cdkey (the productkey must be modified according to the actual situation, and the trial version is left empty .)
5. Reset the activation counter (WES 7 requires product activation and can be reset up to 3 times. Therefore, skiprearm can be set to 0 only when the last syssprep command is executed)
• Step 1Start the Virtual Machine. After CMD is enabled, enter explorer to open the Resource Manager ("desktop" still does not appear ")
• Step 2: Convert the response file (Modified by yourself) Copy to "C:/Windows/system32/sysprep" (copy and paste it directly, and vmtool has been installed just now ).
Delete all files under "C:/Windows/Setup/scripts.
Go back to CMD and execute the following command:
Sysprep/shutdown/generalize/oobe/unattend: C:/Windows/system32/sysprep/testsysprep. xml
After shutdown, you can use ghost or imagex to deploy System Images in batches. Of course, you can also start the virtual machine again to view the results.
Happy New Year! \ (^ )/