给 Windows ISO 添加语言包

给 Windows ISO 添加语言包

一直以来都是使用中文版系统,但是有时候Windows ISO中只有英文版,比如ARM64和泄露出来的版本,所以需要将中文版ISO中的语言包添加到英文版ISO中。

准备文件:

此处我们演示的是为 LTSC2024 的英文版系统ISO添加中文语言包。

这个案例中,我们能够获取到完整的ADK和PE加载项,以及LoF/FoD ISO,这样能够安装微软官方推荐的方式进行集成。如果文件不全,您可能需要从UUPDUMP上获取。

同时,install.wim中包含3个索引,我们需要对其分别进行操作。

  1. 英文版系统ISO(此处为LTSC2024)
    26100.1.240331-1435.ge_release_CLIENT_ENTERPRISES_OEM_x64FRE_en-us.iso

  2. 中文版系统ISO(需要和系统镜像版本保持一致,可从UUP提取)
    26100.1.240331-1435.ge_release_CLIENTCHINA_OEM_x64FRE_zh-cn.iso

  3. ADK和PE加载项(需要和系统镜像版本保持一致)
    文档:https://learn.microsoft.com/zh-cn/windows-hardware/get-started/adk-install
    26100.1.240331-1435.ge_release_amd64fre_ADK.iso
    26100.1.240331-1435.ge_release_amd64fre_adkwinpeaddons.iso

  4. LoF/FoD ISO(语言和功能离线包,需要和系统镜像版本保持一致)
    26100.1.240331-1435.ge_release_amd64fre_CLIENT_LOF_PACKAGES_OEM.iso

详细步骤:

以下文档根据微软官方教程编写,微软官方文档中有很多坑,需要自行补全,此处已改写成具体命令。

请将下面的脚本放入文本编辑器中,设置语言格式为Batch,供本地编辑查看。

可将路径批量替换为实际路径,提高运行效率。

如果您有多个镜像要集成,那可以将下面内容中的路径替换成变量,通过for执行重复的步骤,然后编写成批处理。

建议您选择 .1 初始版本的母盘集成语言包,之后再集成LCU补丁。微软官方文档说明,如果在添加语言之前添加了更新包 (LCU),请重新安装更新包,以确保更新的所有语言资源都在你的映像中。

附:下表显示了将各种任务应用于文件的正确顺序。 例如,完整序列从将服务堆栈更新添加到 WinRE (1) 开始,最后将启动管理器从 WinPE 添加到新媒体 (28) 。

任务 WinRE (winre.wim) 操作系统 (install.wim) WinPE (boot.wim) 新媒体
添加服务堆栈动态更新 1 9 17
添加语言包 2 10 18
添加本地化的可选包 3 19
添加字体支持 4 20
添加文本转语音 5 21
更新 Lang.ini 22
按需添加功能 11
添加安全 OS 动态更新 6
添加安装程序动态更新 26
从 WinPE 添加 setup.exe 27
从 WinPE 添加启动管理器 28
添加最新的累积更新 12 23
清理映像 7 13 24
添加可选组件 14
添加 .NET 和 .NET 累积更新 15
导出映像 8 16 25

从 2021 年 2 月开始,最新的累积更新和服务堆栈更新将合并并分发到 Microsoft 更新目录中,作为新的组合累积更新。 对于需要服务堆栈更新以更新安装媒体的步骤 1、9 和 18,应使用组合累积更新。 有关组合累积更新的详细信息,请参阅 服务堆栈更新。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
:: 给 Windows ISO 添加语言包

:: 警告:此文件非批处理,文件格式仅供更好排版
:: 需要手动复制命令然后粘贴执行,请勿直接运行此文件!!!

:: Tips:复制命令时带下一行的换行符可以避免最后一条命令需要按回车

:: 目录介绍:
:: C: 当前运行的系统(1904x以上,安装ADK和PE)
:: C:\Program Files (x86)\Windows Kits\10 ADK和PE安装目录
:: D: 工作硬盘
:: D:\temp 工作目录
:: D:\temp\dist 分发合盘
:: F: 挂载英文版系统ISO
:: G: 挂载中文版系统ISO(需要用到sources\zh-CN文件夹)
:: H: 挂载LoF/FoD ISO
:: 路径请勿带空格!

:: 进入ADK环境(管理员权限运行)
:: 1. 开始菜单搜索“部署和映像工具环境”
:: 2. "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Windows Kits\Windows ADK\Deployment and Imaging Tools Environment.lnk"
:: 3. C:\WINDOWS\system32\cmd.exe /k "C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools\DandISetEnv.bat"

:: 将安装文件复制到分发合盘文件夹
md D:\temp\dist
xcopy /E F: D:\temp\dist

:: 挂载boot.wim
md d:\temp\mount\boot
Dism /mount-image /imagefile:D:\temp\dist\sources\boot.wim /index:2 /mountdir:d:\temp\mount\boot

:: 此处建议使用ADK PE中的文件

:: 将语言添加到boot.wim(index:2)
Dism /image:d:\temp\mount\boot /add-package /packagepath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\zh-cn\lp.cab"
Dism /image:d:\temp\mount\boot /add-package /packagepath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\zh-cn\WinPE-Setup_zh-cn.cab"
Dism /image:d:\temp\mount\boot /add-package /packagepath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\zh-cn\WinPE-Setup-Client_zh-cn.cab"

:: 添加语言字体支持
Dism /image:d:\temp\mount\boot /add-package /packagepath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-FontSupport-ZH-CN.cab"

:: 将setup.exe语言资源添加到分发合盘
xcopy G:\sources\zh-CN D:\temp\dist\sources\zh-CN /cherkyi

:: 挂载install.wim
md d:\temp\mount\windows\1
md d:\temp\mount\windows\2
md d:\temp\mount\windows\3
Dism /Mount-Image /ImageFile:D:\temp\dist\sources\install.wim /Index:1 /MountDir:"d:\temp\mount\windows\1"
Dism /Mount-Image /ImageFile:D:\temp\dist\sources\install.wim /Index:2 /MountDir:"d:\temp\mount\windows\2"
Dism /Mount-Image /ImageFile:D:\temp\dist\sources\install.wim /Index:3 /MountDir:"d:\temp\mount\windows\3"

:: 将语言包添加到install.wim
Dism /Image:"d:\temp\mount\windows\1" /Add-Package /PackagePath="H:\LanguagesAndOptionalFeatures\Microsoft-Windows-Client-Language-Pack_x64_zh-cn.cab"
Dism /Image:"d:\temp\mount\windows\2" /Add-Package /PackagePath="H:\LanguagesAndOptionalFeatures\Microsoft-Windows-Client-Language-Pack_x64_zh-cn.cab"
Dism /Image:"d:\temp\mount\windows\3" /Add-Package /PackagePath="H:\LanguagesAndOptionalFeatures\Microsoft-Windows-Client-Language-Pack_x64_zh-cn.cab"

:: 检查语言包安装情况
Dism /Image:"d:\temp\mount\windows\1" /Get-Packages /format:table | findstr /i "zh-cn"
:: Microsoft-Windows-Client-LanguagePack-Package~31bf3856ad364e35~amd64~zh-CN~10.0.26100.1 | 已安装 | Language Pack | 2024/8/17 21:41
:: Microsoft-Windows-InternetExplorer-Optional-Package~31bf3856ad364e35~amd64~zh-CN~11.0.26100.1 | 已安装 | OnDemand Pack | 2024/8/17 21:41
:: Microsoft-Windows-Licenses-EnterpriseS-Package~31bf3856ad364e35~amd64~zh-CN~10.0.26100.1 | 已安装 | Language Pack | 2024/8/17 21:41
:: Microsoft-Windows-MediaPlayer-Package~31bf3856ad364e35~amd64~zh-CN~10.0.26100.1 | 已安装 | OnDemand Pack | 2024/8/17 21:41
:: Microsoft-Windows-MediaPlayer-Package~31bf3856ad364e35~wow64~zh-CN~10.0.26100.1 | 已安装 | OnDemand Pack | 2024/8/17 21:41
:: Microsoft-Windows-MSPaint-FoD-Package~31bf3856ad364e35~amd64~zh-CN~10.0.26100.1 | 已安装 | OnDemand Pack | 2024/8/17 21:41
:: Microsoft-Windows-MSPaint-FoD-Package~31bf3856ad364e35~wow64~zh-CN~10.0.26100.1 | 已安装 | OnDemand Pack | 2024/8/17 21:41
:: Microsoft-Windows-Notepad-FoD-Package~31bf3856ad364e35~amd64~zh-CN~10.0.26100.1 | 已安装 | OnDemand Pack | 2024/8/17 21:41
:: Microsoft-Windows-Notepad-FoD-Package~31bf3856ad364e35~wow64~zh-CN~10.0.26100.1 | 已安装 | OnDemand Pack | 2024/8/17 21:41
:: Microsoft-Windows-PowerShell-ISE-FOD-Package~31bf3856ad364e35~amd64~zh-CN~10.0.26100.1 | 已安装 | OnDemand Pack | 2024/8/17 21:41
:: Microsoft-Windows-PowerShell-ISE-FOD-Package~31bf3856ad364e35~wow64~zh-CN~10.0.26100.1 | 已安装 | OnDemand Pack | 2024/8/17 21:41
:: Microsoft-Windows-Printing-PMCPPC-FoD-Package~31bf3856ad364e35~amd64~zh-CN~10.0.26100.1 | 已安装 | OnDemand Pack | 2024/8/17 21:41
:: Microsoft-Windows-SenseClient-FoD-Package~31bf3856ad364e35~amd64~zh-CN~10.0.26100.1 | 已安装 | OnDemand Pack | 2024/8/17 21:41
:: Microsoft-Windows-SnippingTool-FoD-Package~31bf3856ad364e35~amd64~zh-CN~10.0.26100.1 | 已安装 | OnDemand Pack | 2024/8/17 21:41
:: Microsoft-Windows-StepsRecorder-Package~31bf3856ad364e35~amd64~zh-CN~10.0.26100.1 | 已安装 | OnDemand Pack | 2024/8/17 21:41
:: Microsoft-Windows-StepsRecorder-Package~31bf3856ad364e35~wow64~zh-CN~10.0.26100.1 | 已安装 | OnDemand Pack | 2024/8/17 21:41
:: Microsoft-Windows-VBSCRIPT-FoD-Package~31bf3856ad364e35~amd64~zh-CN~10.0.26100.1 | 已安装 | OnDemand Pack | 2024/8/17 21:41
:: Microsoft-Windows-VBSCRIPT-FoD-Package~31bf3856ad364e35~wow64~zh-CN~10.0.26100.1 | 已安装 | OnDemand Pack | 2024/8/17 21:41
:: Microsoft-Windows-WMIC-FoD-Package~31bf3856ad364e35~amd64~zh-CN~10.0.26100.1 | 已安装 | OnDemand Pack | 2024/8/17 21:41
:: Microsoft-Windows-WMIC-FoD-Package~31bf3856ad364e35~wow64~zh-CN~10.0.26100.1 | 已安装 | OnDemand Pack | 2024/8/17 21:41


:: 跳过集成 LIP (zh-CN无)

:: 查看未安装的语言FoD功能
Dism /English /Image:"d:\temp\mount\windows\1" /Get-Capabilities /format:table | findstr /i "Not Present" | findstr /i "zh-cn"
:: Language.Basic~~~zh-CN~0.0.1.0 | Not Present
:: Language.Handwriting~~~zh-CN~0.0.1.0 | Not Present
:: Language.OCR~~~zh-CN~0.0.1.0 | Not Present
:: Language.Speech~~~zh-CN~0.0.1.0 | Not Present
:: Language.TextToSpeech~~~zh-CN~0.0.1.0 | Not Present

:: 安装未安装的语言FoD功能
:: 基本内容、手写识别、OCR、语音识别和文本转语音
Dism /Image:"d:\temp\mount\windows\1" /Add-Capability /capabilityname:Language.Basic~~~zh-cn~0.0.1.0 /capabilityname:Language.Handwriting~~~zh-cn~0.0.1.0 /capabilityname:Language.OCR~~~zh-cn~0.0.1.0 /capabilityname:Language.Speech~~~zh-cn~0.0.1.0 /capabilityname:Language.TextToSpeech~~~zh-cn~0.0.1.0 /source:H:\LanguagesAndOptionalFeatures
Dism /Image:"d:\temp\mount\windows\2" /Add-Capability /capabilityname:Language.Basic~~~zh-cn~0.0.1.0 /capabilityname:Language.Handwriting~~~zh-cn~0.0.1.0 /capabilityname:Language.OCR~~~zh-cn~0.0.1.0 /capabilityname:Language.Speech~~~zh-cn~0.0.1.0 /capabilityname:Language.TextToSpeech~~~zh-cn~0.0.1.0 /source:H:\LanguagesAndOptionalFeatures
Dism /Image:"d:\temp\mount\windows\3" /Add-Capability /capabilityname:Language.Basic~~~zh-cn~0.0.1.0 /capabilityname:Language.Handwriting~~~zh-cn~0.0.1.0 /capabilityname:Language.OCR~~~zh-cn~0.0.1.0 /capabilityname:Language.Speech~~~zh-cn~0.0.1.0 /capabilityname:Language.TextToSpeech~~~zh-cn~0.0.1.0 /source:H:\LanguagesAndOptionalFeatures

:: 现在,删除多余的语言和按需功能
:: 此处为en-US

:: 获取映像中安装的包和功能列表
Dism /English /Image:"d:\temp\mount\windows\1" /Get-Packages /format:table | findstr /i "en-US"
Dism /English /Image:"d:\temp\mount\windows\1" /Get-Capabilities /format:table | findstr /i "en-US"
:: 可直接通过以下命令清洗数据
for /f %a in ('Dism /English /Image:"d:\temp\mount\windows\1" /Get-Packages /format:table ^| findstr /i "en-US"') do @echo %a
:: Microsoft-Windows-Client-LanguagePack-Package~31bf3856ad364e35~amd64~en-US~10.0.26100.1
:: Microsoft-Windows-InternetExplorer-Optional-Package~31bf3856ad364e35~amd64~en-US~11.0.26100.1
:: Microsoft-Windows-LanguageFeatures-Basic-en-us-Package~31bf3856ad364e35~amd64~~10.0.26100.1
:: Microsoft-Windows-LanguageFeatures-Handwriting-en-us-Package~31bf3856ad364e35~amd64~~10.0.26100.1
:: Microsoft-Windows-LanguageFeatures-OCR-en-us-Package~31bf3856ad364e35~amd64~~10.0.26100.1
:: Microsoft-Windows-LanguageFeatures-Speech-en-us-Package~31bf3856ad364e35~amd64~~10.0.26100.1
:: Microsoft-Windows-LanguageFeatures-TextToSpeech-en-us-Package~31bf3856ad364e35~amd64~~10.0.26100.1
:: Microsoft-Windows-Licenses-EnterpriseS-Package~31bf3856ad364e35~amd64~en-US~10.0.26100.1
:: Microsoft-Windows-MediaPlayer-Package~31bf3856ad364e35~amd64~en-US~10.0.26100.1
:: Microsoft-Windows-MediaPlayer-Package~31bf3856ad364e35~wow64~en-US~10.0.26100.1
:: Microsoft-Windows-MSPaint-FoD-Package~31bf3856ad364e35~amd64~en-US~10.0.26100.1
:: Microsoft-Windows-MSPaint-FoD-Package~31bf3856ad364e35~wow64~en-US~10.0.26100.1
:: Microsoft-Windows-Notepad-FoD-Package~31bf3856ad364e35~amd64~en-US~10.0.26100.1
:: Microsoft-Windows-Notepad-FoD-Package~31bf3856ad364e35~wow64~en-US~10.0.26100.1
:: Microsoft-Windows-PowerShell-ISE-FOD-Package~31bf3856ad364e35~amd64~en-US~10.0.26100.1
:: Microsoft-Windows-PowerShell-ISE-FOD-Package~31bf3856ad364e35~wow64~en-US~10.0.26100.1
:: Microsoft-Windows-Printing-PMCPPC-FoD-Package~31bf3856ad364e35~amd64~en-US~10.0.26100.1
:: Microsoft-Windows-SenseClient-FoD-Package~31bf3856ad364e35~amd64~en-US~10.0.26100.1
:: Microsoft-Windows-SnippingTool-FoD-Package~31bf3856ad364e35~amd64~en-US~10.0.26100.1
:: Microsoft-Windows-StepsRecorder-Package~31bf3856ad364e35~amd64~en-US~10.0.26100.1
:: Microsoft-Windows-StepsRecorder-Package~31bf3856ad364e35~wow64~en-US~10.0.26100.1
:: Microsoft-Windows-VBSCRIPT-FoD-Package~31bf3856ad364e35~amd64~en-US~10.0.26100.1
:: Microsoft-Windows-VBSCRIPT-FoD-Package~31bf3856ad364e35~wow64~en-US~10.0.26100.1
:: Microsoft-Windows-WMIC-FoD-Package~31bf3856ad364e35~amd64~en-US~10.0.26100.1
:: Microsoft-Windows-WMIC-FoD-Package~31bf3856ad364e35~wow64~en-US~10.0.26100.1

:: 直接一个一个全部删除没必要,我们需要先给语言包的主包删除掉
Dism /Image:"d:\temp\mount\windows\1" /Remove-Package /PackageName:Microsoft-Windows-Client-LanguagePack-Package~31bf3856ad364e35~amd64~en-US~10.0.26100.1
Dism /Image:"d:\temp\mount\windows\2" /Remove-Package /PackageName:Microsoft-Windows-Client-LanguagePack-Package~31bf3856ad364e35~amd64~en-US~10.0.26100.1
Dism /Image:"d:\temp\mount\windows\3" /Remove-Package /PackageName:Microsoft-Windows-Client-LanguagePack-Package~31bf3856ad364e35~amd64~en-US~10.0.26100.1

:: 重新执行获取的命令能得到删除后的列表

:: 读取可删除的语言FoD包(此处筛选掉Basic包,因为英文的删不掉)
for /f %a in ('Dism /English /Image:"d:\temp\mount\windows\1" /Get-Packages /format:table ^| findstr /i "en-US" ^| findstr /i /v "LanguageFeatures-Basic"') do @echo %a
: Microsoft-Windows-LanguageFeatures-Handwriting-en-us-Package~31bf3856ad364e35~amd64~~10.0.26100.1
: Microsoft-Windows-LanguageFeatures-OCR-en-us-Package~31bf3856ad364e35~amd64~~10.0.26100.1
: Microsoft-Windows-LanguageFeatures-Speech-en-us-Package~31bf3856ad364e35~amd64~~10.0.26100.1
: Microsoft-Windows-LanguageFeatures-TextToSpeech-en-us-Package~31bf3856ad364e35~amd64~~10.0.26100.1
: 可见语言包删除主包会联动删除很多依赖组件

:: 根据上面返回的结果,拼凑成命令删除,也可一键删除(见后文)
Dism /Image:"d:\temp\mount\windows\1" /Remove-Package /PackageName:Microsoft-Windows-LanguageFeatures-Handwriting-en-us-Package~31bf3856ad364e35~amd64~~10.0.26100.1 /PackageName:Microsoft-Windows-LanguageFeatures-OCR-en-us-Package~31bf3856ad364e35~amd64~~10.0.26100.1 /PackageName:Microsoft-Windows-LanguageFeatures-Speech-en-us-Package~31bf3856ad364e35~amd64~~10.0.26100.1 /PackageName:Microsoft-Windows-LanguageFeatures-TextToSpeech-en-us-Package~31bf3856ad364e35~amd64~~10.0.26100.1
Dism /Image:"d:\temp\mount\windows\2" /Remove-Package /PackageName:Microsoft-Windows-LanguageFeatures-Handwriting-en-us-Package~31bf3856ad364e35~amd64~~10.0.26100.1 /PackageName:Microsoft-Windows-LanguageFeatures-OCR-en-us-Package~31bf3856ad364e35~amd64~~10.0.26100.1 /PackageName:Microsoft-Windows-LanguageFeatures-Speech-en-us-Package~31bf3856ad364e35~amd64~~10.0.26100.1 /PackageName:Microsoft-Windows-LanguageFeatures-TextToSpeech-en-us-Package~31bf3856ad364e35~amd64~~10.0.26100.1
Dism /Image:"d:\temp\mount\windows\3" /Remove-Package /PackageName:Microsoft-Windows-LanguageFeatures-Handwriting-en-us-Package~31bf3856ad364e35~amd64~~10.0.26100.1 /PackageName:Microsoft-Windows-LanguageFeatures-OCR-en-us-Package~31bf3856ad364e35~amd64~~10.0.26100.1 /PackageName:Microsoft-Windows-LanguageFeatures-Speech-en-us-Package~31bf3856ad364e35~amd64~~10.0.26100.1 /PackageName:Microsoft-Windows-LanguageFeatures-TextToSpeech-en-us-Package~31bf3856ad364e35~amd64~~10.0.26100.1
:: 读取可删除的语言FoD包并一键删除
for /f %a in ('Dism /English /Image:"d:\temp\mount\windows\1" /Get-Packages /format:table ^| findstr /i "en-US" ^| findstr /i /v "LanguageFeatures-Basic"') do Dism /Image:"d:\temp\mount\windows\1" /Remove-Package /PackageName:%a
for /f %a in ('Dism /English /Image:"d:\temp\mount\windows\2" /Get-Packages /format:table ^| findstr /i "en-US" ^| findstr /i /v "LanguageFeatures-Basic"') do Dism /Image:"d:\temp\mount\windows\2" /Remove-Package /PackageName:%a
for /f %a in ('Dism /English /Image:"d:\temp\mount\windows\3" /Get-Packages /format:table ^| findstr /i "en-US" ^| findstr /i /v "LanguageFeatures-Basic"') do Dism /Image:"d:\temp\mount\windows\3" /Remove-Package /PackageName:%a

:: 重新获取映像中安装的包和功能列表
Dism /English /Image:"d:\temp\mount\windows\1" /Get-Packages /format:table | findstr /i "en-US"
: Microsoft-Windows-LanguageFeatures-Basic-en-us-Package~31bf3856ad364e35~amd64~~10.0.26100.1 | Installed | OnDemand Pack | 2024/4/1 8:10
Dism /English /Image:"d:\temp\mount\windows\1" /Get-Capabilities /format:table | findstr /i "en-US"
: Language.Basic~~~en-US~0.0.1.0 | Installed
: Language.Handwriting~~~en-US~0.0.1.0 | Not Present
: Language.OCR~~~en-US~0.0.1.0 | Not Present
: Language.Speech~~~en-US~0.0.1.0 | Not Present
: Language.TextToSpeech~~~en-US~0.0.1.0 | Not Present


:: 更改默认语言、区域设置和其他国际设置
Dism /Image:"d:\temp\mount\windows\1" /Set-AllIntl:zh-cn
Dism /Image:"d:\temp\mount\windows\2" /Set-AllIntl:zh-cn
Dism /Image:"d:\temp\mount\windows\3" /Set-AllIntl:zh-cn
: 部署映像服务和管理工具
: 版本: 10.0.26100.1
:
: 映像版本: 10.0.26100.1
:
:
: 输入区域设置已设为: zh-cn
: 系统区域设置已设为: zh-cn
: 用户区域设置已设为: zh-cn
: 用户界面语言已设为: zh-cn
: 操作成功完成。

:: 查看当前的语言设置
Dism /Image:"d:\temp\mount\windows\1" /Get-Intl
: 部署映像服务和管理工具
: 版本: 10.0.26100.1
:
: 映像版本: 10.0.26100.1
:
: 正在报告脱机国际设置。
:
: 默认的系统用户界面语言 : zh-CN
: 用户界面语言回退是 : en-US
: 系统区域设置 : zh-CN
: 默认时区 : Pacific Standard Time
: 默认用户的用户区域设置 : zh-CN
: 位置 : 中国 (GEOID = 45)
: 活动键盘 : 0804:{81D4E9C9-1D3B-41BC-9E6C-4B40BF79E35E}{FA550B04-5AD7-411F-A5AC-CA038EC515D7}, 0804:{6A498709-E00B-4C45-A018-8F9E4081AE40}{82590C13-F4DD-44F4-BA1D-8667246FDF8E}
: 键盘分层驱动程序 : 未安装。
:
: 安装的语言: zh-CN
: 类型: 部分本地化的语言,MUI 类型。
: 回退语言 en-US
:
: 操作成功完成。

:: 挂载winre.wim
md d:\temp\mount\winre\1
md d:\temp\mount\winre\2
md d:\temp\mount\winre\3
Dism /Mount-Image /ImageFile:"d:\temp\mount\windows\1\Windows\System32\Recovery\winre.wim" /index:1 /MountDir:"d:\temp\mount\winre\1"
Dism /Mount-Image /ImageFile:"d:\temp\mount\windows\2\Windows\System32\Recovery\winre.wim" /index:1 /MountDir:"d:\temp\mount\winre\2"
Dism /Mount-Image /ImageFile:"d:\temp\mount\windows\3\Windows\System32\Recovery\winre.wim" /index:1 /MountDir:"d:\temp\mount\winre\3"

:: 此处建议使用LoF/FoD ISO中的文件

:: 将语言添加到winre.wim
Dism /Image:"d:\temp\mount\winre\1" /Add-Package /PackagePath:"H:\Windows Preinstallation Environment\x64\WinPE_OCs\zh-cn\lp.cab"
Dism /Image:"d:\temp\mount\winre\1" /Add-Package /PackagePath:"H:\Windows Preinstallation Environment\x64\WinPE_OCs\zh-cn\WinPE-Rejuv_zh-cn.cab"
Dism /Image:"d:\temp\mount\winre\1" /Add-Package /PackagePath:"H:\Windows Preinstallation Environment\x64\WinPE_OCs\zh-cn\WinPE-EnhancedStorage_zh-cn.cab"
Dism /Image:"d:\temp\mount\winre\1" /Add-Package /PackagePath:"H:\Windows Preinstallation Environment\x64\WinPE_OCs\zh-cn\WinPE-Scripting_zh-cn.cab"
Dism /Image:"d:\temp\mount\winre\1" /Add-Package /PackagePath:"H:\Windows Preinstallation Environment\x64\WinPE_OCs\zh-cn\WinPE-SecureStartup_zh-cn.cab"
Dism /Image:"d:\temp\mount\winre\1" /Add-Package /PackagePath:"H:\Windows Preinstallation Environment\x64\WinPE_OCs\zh-cn\WinPE-SRT_zh-cn.cab"
Dism /Image:"d:\temp\mount\winre\1" /Add-Package /PackagePath:"H:\Windows Preinstallation Environment\x64\WinPE_OCs\zh-cn\WinPE-WDS-Tools_zh-cn.cab"
Dism /Image:"d:\temp\mount\winre\1" /Add-Package /PackagePath:"H:\Windows Preinstallation Environment\x64\WinPE_OCs\zh-cn\WinPE-WMI_zh-cn.cab"
Dism /Image:"d:\temp\mount\winre\1" /Add-Package /PackagePath:"H:\Windows Preinstallation Environment\x64\WinPE_OCs\zh-cn\WinPE-StorageWMI_zh-cn.cab"
Dism /Image:"d:\temp\mount\winre\1" /Add-Package /PackagePath:"H:\Windows Preinstallation Environment\x64\WinPE_OCs\zh-cn\WinPE-HTA_zh-cn.cab"

Dism /Image:"d:\temp\mount\winre\2" /Add-Package /PackagePath:"H:\Windows Preinstallation Environment\x64\WinPE_OCs\zh-cn\lp.cab"
Dism /Image:"d:\temp\mount\winre\2" /Add-Package /PackagePath:"H:\Windows Preinstallation Environment\x64\WinPE_OCs\zh-cn\WinPE-Rejuv_zh-cn.cab"
Dism /Image:"d:\temp\mount\winre\2" /Add-Package /PackagePath:"H:\Windows Preinstallation Environment\x64\WinPE_OCs\zh-cn\WinPE-EnhancedStorage_zh-cn.cab"
Dism /Image:"d:\temp\mount\winre\2" /Add-Package /PackagePath:"H:\Windows Preinstallation Environment\x64\WinPE_OCs\zh-cn\WinPE-Scripting_zh-cn.cab"
Dism /Image:"d:\temp\mount\winre\2" /Add-Package /PackagePath:"H:\Windows Preinstallation Environment\x64\WinPE_OCs\zh-cn\WinPE-SecureStartup_zh-cn.cab"
Dism /Image:"d:\temp\mount\winre\2" /Add-Package /PackagePath:"H:\Windows Preinstallation Environment\x64\WinPE_OCs\zh-cn\WinPE-SRT_zh-cn.cab"
Dism /Image:"d:\temp\mount\winre\2" /Add-Package /PackagePath:"H:\Windows Preinstallation Environment\x64\WinPE_OCs\zh-cn\WinPE-WDS-Tools_zh-cn.cab"
Dism /Image:"d:\temp\mount\winre\2" /Add-Package /PackagePath:"H:\Windows Preinstallation Environment\x64\WinPE_OCs\zh-cn\WinPE-WMI_zh-cn.cab"
Dism /Image:"d:\temp\mount\winre\2" /Add-Package /PackagePath:"H:\Windows Preinstallation Environment\x64\WinPE_OCs\zh-cn\WinPE-StorageWMI_zh-cn.cab"
Dism /Image:"d:\temp\mount\winre\2" /Add-Package /PackagePath:"H:\Windows Preinstallation Environment\x64\WinPE_OCs\zh-cn\WinPE-HTA_zh-cn.cab"

Dism /Image:"d:\temp\mount\winre\3" /Add-Package /PackagePath:"H:\Windows Preinstallation Environment\x64\WinPE_OCs\zh-cn\lp.cab"
Dism /Image:"d:\temp\mount\winre\3" /Add-Package /PackagePath:"H:\Windows Preinstallation Environment\x64\WinPE_OCs\zh-cn\WinPE-Rejuv_zh-cn.cab"
Dism /Image:"d:\temp\mount\winre\3" /Add-Package /PackagePath:"H:\Windows Preinstallation Environment\x64\WinPE_OCs\zh-cn\WinPE-EnhancedStorage_zh-cn.cab"
Dism /Image:"d:\temp\mount\winre\3" /Add-Package /PackagePath:"H:\Windows Preinstallation Environment\x64\WinPE_OCs\zh-cn\WinPE-Scripting_zh-cn.cab"
Dism /Image:"d:\temp\mount\winre\3" /Add-Package /PackagePath:"H:\Windows Preinstallation Environment\x64\WinPE_OCs\zh-cn\WinPE-SecureStartup_zh-cn.cab"
Dism /Image:"d:\temp\mount\winre\3" /Add-Package /PackagePath:"H:\Windows Preinstallation Environment\x64\WinPE_OCs\zh-cn\WinPE-SRT_zh-cn.cab"
Dism /Image:"d:\temp\mount\winre\3" /Add-Package /PackagePath:"H:\Windows Preinstallation Environment\x64\WinPE_OCs\zh-cn\WinPE-WDS-Tools_zh-cn.cab"
Dism /Image:"d:\temp\mount\winre\3" /Add-Package /PackagePath:"H:\Windows Preinstallation Environment\x64\WinPE_OCs\zh-cn\WinPE-WMI_zh-cn.cab"
Dism /Image:"d:\temp\mount\winre\3" /Add-Package /PackagePath:"H:\Windows Preinstallation Environment\x64\WinPE_OCs\zh-cn\WinPE-StorageWMI_zh-cn.cab"
Dism /Image:"d:\temp\mount\winre\3" /Add-Package /PackagePath:"H:\Windows Preinstallation Environment\x64\WinPE_OCs\zh-cn\WinPE-HTA_zh-cn.cab"

:: 获取已安装的语言包
Dism /Image:"d:\temp\mount\winre\1" /Get-Packages /format:table | findstr /i "zh-cn"
: Microsoft-Windows-WinPE-LanguagePack-Package~31bf3856ad364e35~amd64~zh-CN~10.0.26100.1 | Installed | Language Pack | 2024/8/17 22:00
: WinPE-EnhancedStorage-Package~31bf3856ad364e35~amd64~zh-CN~10.0.26100.1 | Installed | Language Pack | 2024/8/17 22:00
: WinPE-HTA-Package~31bf3856ad364e35~amd64~zh-CN~10.0.26100.1 | Installed | Language Pack | 2024/8/17 22:00
: WinPE-Rejuv-Package~31bf3856ad364e35~amd64~zh-CN~10.0.26100.1 | Installed | Language Pack | 2024/8/17 22:00
: WinPE-Scripting-Package~31bf3856ad364e35~amd64~zh-CN~10.0.26100.1 | Installed | Language Pack | 2024/8/17 22:00
: WinPE-SecureStartup-Package~31bf3856ad364e35~amd64~zh-CN~10.0.26100.1 | Installed | Language Pack | 2024/8/17 22:00
: WinPE-SRT-Package~31bf3856ad364e35~amd64~zh-CN~10.0.26100.1 | Installed | Language Pack | 2024/8/17 22:00
: WinPE-StorageWMI-Package~31bf3856ad364e35~amd64~zh-CN~10.0.26100.1 | Installed | Language Pack | 2024/8/17 22:00
: WinPE-WDS-Tools-Package~31bf3856ad364e35~amd64~zh-CN~10.0.26100.1 | Installed | Language Pack | 2024/8/17 22:00
: WinPE-WMI-Package~31bf3856ad364e35~amd64~zh-CN~10.0.26100.1 | Installed | Language Pack | 2024/8/17 22:00


:: 卸载并提交winre.wim
:: 由于后期需要使用该镜像集成更新,暂不优化wim体积
Dism /Unmount-Image /MountDir:"d:\temp\mount\winre\1" /Commit
Dism /Unmount-Image /MountDir:"d:\temp\mount\winre\2" /Commit
Dism /Unmount-Image /MountDir:"d:\temp\mount\winre\3" /Commit

:: 不着急卸载install.wim和boot.wim

:: 从挂载的install.wim重新生成lang.ini
Dism /image:d:\temp\mount\windows\1 /gen-langINI /distribution:D:\temp\dist

:: 更改setup.exe默认语言
Dism /image:D:\temp\mount\boot /Set-SetupUILang:zh-CN /distribution:D:\temp\dist

:: 复制分发合盘中的lang.ini到boot.wim
xcopy /y D:\temp\dist\sources\lang.ini D:\temp\mount\boot\sources\lang.ini

:: 卸载并提交boot.wim、install.wim
Dism /Unmount-Image /MountDir:"D:\temp\mount\boot" /Commit
Dism /Unmount-Image /MountDir:"D:\temp\mount\windows\1" /Commit
Dism /Unmount-Image /MountDir:"D:\temp\mount\windows\2" /Commit
Dism /Unmount-Image /MountDir:"D:\temp\mount\windows\3" /Commit

:: 恭喜你,到此语言包已集成成功!

:: 创建USB启动盘
:: MakeWinPEMedia /UFD D:\temp\dist U:

:: 创建ISO启动顺序 D:\temp\BootOrder.txt
boot\bcd
boot\boot.sdi
boot\bootfix.bin
boot\bootsect.exe
boot\etfsboot.com
boot\memtest.efi
boot\memtest.exe
boot\en-us\bootsect.exe.mui
boot\fonts\chs_boot.ttf
boot\fonts\cht_boot.ttf
boot\fonts\jpn_boot.ttf
boot\fonts\kor_boot.ttf
boot\fonts\wgl4_boot.ttf
sources\boot.wim


:: 创建ISO文件
Oscdimg -bootdata:2#p0,e,b"D:\temp\dist\boot\etfsboot.com"#pEF,e,b"D:\temp\dist\efi\Microsoft\boot\efisys.bin" -o -m -u2 -udfver102 -l"CES_X64FREO_ZH-CN_DV9" D:\temp\dist D:\temp\26100.1.240331-1435.ge_release_CLIENT_ENTERPRISES_OEM_x64FRE_zh-cn.iso


参考文档:

https://learn.microsoft.com/zh-cn/windows-hardware/manufacture/desktop/add-multilingual-support-to-windows-setup

https://learn.microsoft.com/zh-cn/windows-hardware/manufacture/desktop/add-language-packs-to-windows

https://learn.microsoft.com/zh-cn/windows/deployment/update/media-dynamic-update

免责声明:

本 Windows 系统及软件版权属各自产权人所有,只用于个人封装技术研究交流使用,不得用于商业用途,且本系统制作者不承担任何技术及版权问题,请在试用后 24 小时内删除。如果您对本系统有任何意见和建议,欢迎反馈,请购买正版 Windows 操作系统软件!