Specifying Regional and Language Options<?xml:namespace prefix = o />
地区和语言选项
Start by selecting and opening the Install.wim file of the version of Vista you want to deploy by following the procedure outlined in the previous article of this series. In this walkthrough, I’ll be using the 32-bit US English version of Windows Vista SP1 Enterprise Edition. .ce the image file is open, create a new answer file by selecting New Answer File from the File menu.
我将会使用
US
英语版本的
Vista SP1
企业版作为案例进行讲解。现在我们已经打开了镜像文件并创建了一个新的应答文件。
Now we’re ready to begin adding components to our answer file. In the Windows Image pane, expand the Components node and select the Microsoft-Windows-International-Core-WinPE node beneath it. Then right-click . the Microsoft-Windows-International-Core-WinPE node and select Add Setting to Pass 1 windowsPE to add this component to the windowPE pass for your answer file. Now in the Properties pane, type values for the various settings of this component as indicated by the following table:
我们已经做好准备,开始往应答文件里加入组件。在
Windows Image
面板里,展开组件的节点并选择
Microsoft-Windows-International-Core-WinPE
节点。右击并添加
Pass 1 windowsPE
到应答文件中。在
Properties
面板里,输入如下表格中的数值
:
Setting
|
Value
|
InputLocale
|
en-us
|
Layered Driver
| |
SystemLocale
|
en-us
|
UILanguage
|
en-us
|
UILanguageFallback
|
en-us
|
UserLocale
|
en-us
|
What we’ve done up to this point is to specify answer file settings for the default language and locale for Windows Setup. The following table describes the settings we’ve just configured in more detail:
下面则是我们刚刚配置内容的详细介绍:
Setting
|
De.ion
|
InputLocale
|
Keyboard layout and system input locale
键盘种类
|
Layered Driver
|
Optional—used .ly for Japanese and Korean keyboards
可选,仅用于日本和韩国键盘
|
SystemLocale
|
Default language for Windows Setup
Windows
安装程序的语言
|
UILanguage
|
Default system user interface language
默认系统用户界面语言
|
UILanguageFallback
|
Fallback language if UILanguage is not fully localized
|
UserLocale
|
Locale to use for dates, times, currency and numbers
时间、数据、金钱和数字使用的地区
|
We’re not quite through however as there’s another answer file component we need to specify to finish configuring user locale and language settings. Here’s what to do next: in the Answer File pane, expand the Microsoft-Windows-International-Core-WinPE node and select the SetupUILanguage node beneath it. Then in the Properties pane, click in the box to the right of the UILanguage setting and type en-us as the value for this setting (see Figure 2):
还有一个不应当遗忘的关于语言和地区选项在
Microsoft-Windows-International-Core-WinPE
节点的
SetupUILanguage
子节点。
I’m not sure why you need to specify UILanguage in two places like this, but you need to.
我不知道为什么需要在两个地方确定
UILanguae
,但你需要这么做。
Accepting the EULA
Next we’re going to specify the answer file setting that will automatically accept the EULA. In the Windows Image pane, under Components, find the Microsoft-Windows-Setup node and expand it to display the UserData node beneath it. Then right-click . the UserData node and select Add Setting to Pass 1 windowsPE to add this component to the windowPE pass for your answer file. Click the box to the right of the AcceptEula setting to display a drop-down arrow, then click the arrow and select True. The result should look like this (Figure 3):
下面我们在应答文件里填写自动接受
EULA
。在
Windows Image
面板中,在
Components
下找到
Microsoft-Windows-Setup
节点并展开,找到
UserData
节点并右击添加
Pass 1 windowsPE
。在右边的选项框里找到
AcceptEula
选项,下拉选择
True
。
Tip: If you’re deploying a retail version of Windows Vista (such as Windows Vista Business edition) instead of the volume-licensed Enterprise edition, you’ll also need to specify your product key at this point. To do that, expand the Microsoft-Windows-Setup\UserData node in the Answer File pane to display the ProductKey node beneath it, and they type your 29 character product key (you must include the dashes) in the box beside the Key setting in the Properties pane.
小建议如果你正在部署零售版的
Vista
而不是批量许可的企业版,你需要在这里填入序列号。在
UserData
节点里找到
ProductKey
节点,填入序列号(包括横线)。
Creating a New Primary Partition
Next, we need to prepare the hard disk . our computer so it will be ready to install Vista .to it. We’re assuming in this article that we’re deploying Vista .to bare-metal, that is, .to a hard drive that is unpartitioned and therefore has no existing volumes . it. We’re also assuming that our target system has .ly .e hard drive in it. This means we have to configure our answer file to create a new primary partition, set it as the active partition, and format it using NTFS. Here’s how we do this:
接下来我们需要开始准备硬盘以进行安装。本文里假设要在裸设备上进行安装,也就是说要给硬盘先分区。假设计算机上只有一个硬盘,我们会创建一个主分区,设置为活动分区,用
ntfs
进行格式化。
First, add the Microsoft-Windows-Setup\DiskConfiguration\Disk component to the windowsPE configuration pass of your answer file, and in the Properties pane, set the value of DiskID to the number 0 (see Figure 4):
首先,添加
Microsoft-Windows-Setup\DiskConfiguration\Disk
为
windowsPE
配置过程。在
Properties
面板里,设置
DiskID
为
0
Next, add the Microsoft-Windows-Setup\DiskConfiguration\Disk\CreatePartitions\CreatePartition node to the windowsPE configuration pass of your answer file, and in the Properties pane, configure the settings shown in the figure below to create a new primary partition of size 50 GB (see Figure 5):
接下来,添加
add the Microsoft-Windows-Setup\DiskConfiguration\Disk\CreatePartitions\CreatePartition
节点到
windowsPE
配置过程,在
Properties
面板里,设置主分区大小为
50G
Tip: If you want your new partition to fill up your entire hard drive, set the Extend setting to True and don’t specify a value for the Size setting.
小建议:如果你想让分区占用整个硬盘,则选择
Extend setting
为真,不要输入大小。
Now we have to mark our new partition (partition 1) as active and format it using NTFS. To do this, add the Microsoft-Windows-Setup\DiskConfiguration\Disk\ModifyPartitions\ModifyPartition node to the windowsPE configuration pass of your answer file, and in the Properties pane, configure the settings shown in Figure 6 below:
现在我们要把创建的新分区标记为活动分区并用
NTFS
格式化。添加
Microsoft-Windows-Setup\DiskConfiguration\Disk\ModifyPartitions\ModifyPartition
节点到
pass WindowsPE
,如下图进行修改:
Note that we also had to specify the Order setting in the above figure—this is required.
注意,我们必须设置
Order
!
Specifying the Target Partition
Now we’re ready to tell Windows Setup which disk partition we want to install Vista .to. To specify where you want to install the image, add the Microsoft-Windows-Setup\DiskConfiguration\ImageInstall\OSImage\InstallTo node to the windowsPE configuration pass of your answer file, and in the Properties pane, configure the settings shown in Figure 7 below:
现在我们已经准备好了,接下来则是告诉安装程序在哪里安装,把
Microsoft-Windows-Setup\DiskConfiguration\ImageInstall\OSImage\InstallTo
节点添加到
Pass windowsPE
,如下图进行配置:
Validating and Saving the Answer File
At this point let’s select Validate Answer File from the Tools menu and check for any error or warning events that are displayed in the Messages pane (only informational events should be displayed, and those you can safely ignore). Now save your answer file using the filename autounattend.xml in the root folder of a USB flash drive. Why name it autounattend.xml? And why save it .to a flash drive? You’ll find out in the next article of this series!
现在让我们开始检查应答文件是否有错误或者警告,选择菜单栏的
Tools/Validate
。然后保存文件名
autounattend.xml
到
USB
闪存的根目录下。
Examining and Commenting the Answer File
Let’s conclude by taking a quick look at the answer file we just created. If you open autounattend.xml using Notepad it should look something like this:
下面就是我们刚刚创建的
autounattend.xml
文件:
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<settings pass="windowsPE">
<component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SetupUILanguage>
<UILanguage>en-us</UILanguage>
</SetupUILanguage>
<InputLocale>en-us</InputLocale>
<SystemLocale>en-us</SystemLocale>
<UILanguage>en-us</UILanguage>
<UILanguageFallback>en-us</UILanguageFallback>
<UserLocale>en-us</UserLocale>
</component>
<component name="Microsoft-Windows-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<UserData>
<AcceptEula>true</AcceptEula>
</UserData>
<DiskConfiguration>
<Disk wcm:action="add">
<CreatePartitions>
<CreatePartition wcm:action="add">
<Order>1</Order>
<Size>50000</Size>
<Type>Primary</Type>
</CreatePartition>
</CreatePartitions>
<ModifyPartitions>
<ModifyPartition wcm:action="add">
<Active>true</Active>
<Format>NTFS</Format>
<Order>1</Order>
<PartitionID>1</PartitionID>
</ModifyPartition>
</ModifyPartitions>
<DiskID>0</DiskID>
<WillWipeDisk>true</WillWipeDisk>
</Disk>
</DiskConfiguration>
<ImageInstall>
<OSImage>
<InstallTo>
<DiskID>0</DiskID>
<PartitionID>1</PartitionID>
</InstallTo>
</OSImage>
</ImageInstall>
</component>
</settings>
<cpi:offlineImage cpi:source="wim:w:/sources/vista%20enterprise%20sp1/install.wim#Windows Vista ENTERPRISE" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
</unattend>
<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<settings pass="windowsPE">
<component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SetupUILanguage>
<UILanguage>en-us</UILanguage>
</SetupUILanguage>
<InputLocale>en-us</InputLocale>
<SystemLocale>en-us</SystemLocale>
<UILanguage>en-us</UILanguage>
<UILanguageFallback>en-us</UILanguageFallback>
<UserLocale>en-us</UserLocale>
</component>
<component name="Microsoft-Windows-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<UserData>
<AcceptEula>true</AcceptEula>
</UserData>
<DiskConfiguration>
<Disk wcm:action="add">
<CreatePartitions>
<CreatePartition wcm:action="add">
<Order>1</Order>
<Size>50000</Size>
<Type>Primary</Type>
</CreatePartition>
</CreatePartitions>
<ModifyPartitions>
<ModifyPartition wcm:action="add">
<Active>true</Active>
<Format>NTFS</Format>
<Order>1</Order>
<PartitionID>1</PartitionID>
</ModifyPartition>
</ModifyPartitions>
<DiskID>0</DiskID>
<WillWipeDisk>true</WillWipeDisk>
</Disk>
</DiskConfiguration>
<ImageInstall>
<OSImage>
<InstallTo>
<DiskID>0</DiskID>
<PartitionID>1</PartitionID>
</InstallTo>
</OSImage>
</ImageInstall>
</component>
</settings>
<cpi:offlineImage cpi:source="wim:w:/sources/vista%20enterprise%20sp1/install.wim#Windows Vista ENTERPRISE" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
</unattend>
Here’s a tip: What if you need to create several different answer files and they all need to be named autounattend.xml? In that case, just add comments to your answer files using standard HTML comment syntax as follows:
小技巧:如果你需要创建多个版本的应答文件,只需要在应答文件里添加标准的
Html comment syntax
:(类似于注释的东西,其实等于没说
…
)
<?xml version="1.0" encoding="utf-8"?>
<!-- ############################################# -->
<!-- Answer file created in Deploying Vista Part 7 -->
<!-- ############################################# -->
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<!-- ############################################# -->
<!-- Answer file created in Deploying Vista Part 7 -->
<!-- ############################################# -->
<unattend xmlns="urn:schemas-microsoft-com:unattend">
转载于:https://blog.51cto.com/xmuxsp/128082