forked from brunopaiva15/WinPE-Creation-Tool
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWizard.cs
492 lines (445 loc) · 27.7 KB
/
Wizard.cs
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
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
/*
* Copyright (C) 2019 Bruno Paiva
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
*/
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Management;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WinPE_Creation_Tool
{
public partial class Wizard : Form
{
public Wizard()
{
InitializeComponent();
}
string strChoosed;
private void Wizard_FormClosing(object sender, FormClosingEventArgs e)
{
try
{
DialogResult form1 = MessageBox.Show("Are you sure you want to leave the utility ?", "Exit", MessageBoxButtons.YesNo);
if (form1 == DialogResult.Yes)
{
System.Diagnostics.Process[] process = System.Diagnostics.Process.GetProcessesByName("cmd");
foreach (System.Diagnostics.Process p in process)
{
if (!string.IsNullOrEmpty(p.ProcessName))
{
p.Kill();
}
}
System.Diagnostics.Process[] process1 = System.Diagnostics.Process.GetProcessesByName("Dism");
foreach (System.Diagnostics.Process p in process1)
{
if (!string.IsNullOrEmpty(p.ProcessName))
{
p.Kill();
}
}
Process.GetCurrentProcess().Kill();
}
else
{
e.Cancel = true;
}
}
catch
{
MessageBox.Show("Error when closing the program.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void Wizard_Load(object sender, EventArgs e)
{
MessageBox.Show("Before using this utility, make sure you have the deployment tools and the WinPE pre-installation environment.\n\nNote : It's necessary to have Windows 10 installed on this computer in order for this utility to work.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
try
{
if (Directory.Exists(@"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit"))
{
rbAMD64.Checked = true;
ManagementObjectCollection drives = new ManagementObjectSearcher("SELECT Caption, DeviceID FROM Win32_DiskDrive WHERE InterfaceType='USB'").Get();
cbxUSB.ItemHeight = drives.Count;
foreach (ManagementObject drive in drives) {
foreach (ManagementObject partition in new ManagementObjectSearcher(
"ASSOCIATORS OF {Win32_DiskDrive.DeviceID='"
+ drive["DeviceID"]
+ "'} WHERE AssocClass = Win32_DiskDriveToDiskPartition").Get())
{
foreach (ManagementObject disk in new ManagementObjectSearcher(
"ASSOCIATORS OF {Win32_DiskPartition.DeviceID='"
+ partition["DeviceID"]
+ "'} WHERE AssocClass = Win32_LogicalDiskToPartition").Get())
{
cbxUSB.Items.Add(disk["CAPTION"].ToString());
}
}
}
}
}
catch
{
if (cbxUSB.Height == 0)
{
MessageBox.Show("No USB devices are connected to your computer.");
}
}
}
private void btnGo_Click(object sender, EventArgs e)
{
try
{
if (Directory.Exists(@"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit"))
{
Cursor.Current = Cursors.WaitCursor;
btnGo.Enabled = false;
if (rbAMD64.Checked)
{
strChoosed = "amd64";
Process procGenererPE = new Process();
procGenererPE.StartInfo.FileName = "cmd";
procGenererPE.StartInfo.Verb = "runas";
//procGenererPE.StartInfo.WorkingDirectory = @"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment";
procGenererPE.StartInfo.Arguments = "/k " + Directory.GetCurrentDirectory() + "\\copype.cmd amd64" + " C:\\WinPE_amd64 & exit";
procGenererPE.StartInfo.ErrorDialog = true;
procGenererPE.StartInfo.WindowStyle = ProcessWindowStyle.Normal;
procGenererPE.Start();
procGenererPE.WaitForExit();
}
if (rbX86.Checked)
{
strChoosed = "x86";
Process procGenererPE = new Process();
procGenererPE.StartInfo.FileName = "cmd";
procGenererPE.StartInfo.Verb = "runas";
//procGenererPE.StartInfo.WorkingDirectory = @"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment";
procGenererPE.StartInfo.Arguments = "/k " + Directory.GetCurrentDirectory() + "\\copype.cmd x86" + " C:\\WinPE_x86 & exit";
procGenererPE.StartInfo.ErrorDialog = true;
procGenererPE.StartInfo.WindowStyle = ProcessWindowStyle.Normal;
procGenererPE.Start();
procGenererPE.WaitForExit();
}
if (rbARM.Checked)
{
strChoosed = "arm";
Process procGenererPE = new Process();
procGenererPE.StartInfo.FileName = "cmd";
procGenererPE.StartInfo.Verb = "runas";
//procGenererPE.StartInfo.WorkingDirectory = @"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment";
procGenererPE.StartInfo.Arguments = "/k " + Directory.GetCurrentDirectory() + "\\copype.cmd arm" + " C:\\WinPE_arm & exit";
procGenererPE.StartInfo.ErrorDialog = true;
procGenererPE.StartInfo.WindowStyle = ProcessWindowStyle.Normal;
procGenererPE.Start();
procGenererPE.WaitForExit();
}
if (tbxLCID.Text != "" || cbxDrivers.Checked)
{
Process procOuvrirWIM = new Process();
procOuvrirWIM.StartInfo.FileName = "cmd";
procOuvrirWIM.StartInfo.Verb = "runas";
procOuvrirWIM.StartInfo.WorkingDirectory = Directory.GetCurrentDirectory();
procOuvrirWIM.StartInfo.Arguments = @"/k Dism /Mount-Image /ImageFile:C:\WinPE_" + strChoosed + @"\media\sources\boot.wim /index:1 /MountDir:C:\WinPE_" + strChoosed + @"\mount & exit";
procOuvrirWIM.StartInfo.ErrorDialog = true;
procOuvrirWIM.StartInfo.WindowStyle = ProcessWindowStyle.Normal;
procOuvrirWIM.Start();
procOuvrirWIM.WaitForExit();
}
if (Directory.Exists("C:\\WinPE_" + strChoosed))
{
if (tbxLCID.Text != "")
{
Process procSysLocale = new Process();
procSysLocale.StartInfo.FileName = "cmd";
procSysLocale.StartInfo.Verb = "runas";
procSysLocale.StartInfo.WorkingDirectory = Directory.GetCurrentDirectory();
procSysLocale.StartInfo.Arguments = "/k Dism /image:C:\\WinPE_" + strChoosed + "\\mount /Set-SysLocale:" + tbxLCID.Text + " & exit";
procSysLocale.StartInfo.ErrorDialog = true;
procSysLocale.StartInfo.WindowStyle = ProcessWindowStyle.Normal;
procSysLocale.Start();
procSysLocale.WaitForExit();
Process procInputLocale = new Process();
procInputLocale.StartInfo.FileName = "cmd";
procInputLocale.StartInfo.Verb = "runas";
procInputLocale.StartInfo.WorkingDirectory = Directory.GetCurrentDirectory();
procInputLocale.StartInfo.Arguments = "/k Dism /image:C:\\WinPE_" + strChoosed + "\\mount /Set-InputLocale:" + tbxLCID.Text + " & exit";
procInputLocale.StartInfo.ErrorDialog = true;
procInputLocale.StartInfo.WindowStyle = ProcessWindowStyle.Normal;
procInputLocale.Start();
procInputLocale.WaitForExit();
Process procUserLocale = new Process();
procUserLocale.StartInfo.FileName = "cmd";
procUserLocale.StartInfo.Verb = "runas";
procUserLocale.StartInfo.WorkingDirectory = Directory.GetCurrentDirectory();
procUserLocale.StartInfo.Arguments = "/k Dism /image:C:\\WinPE_" + strChoosed + "\\mount /Set-UserLocale:" + tbxLCID.Text + " & exit";
procUserLocale.StartInfo.ErrorDialog = true;
procUserLocale.StartInfo.WindowStyle = ProcessWindowStyle.Normal;
procUserLocale.Start();
procUserLocale.WaitForExit();
}
}
if (Directory.Exists("C:\\WinPE_" + strChoosed))
{
if (cbxCreateUSB.Checked)
{
if (cbxUSB.Text != "")
{
Process procDeplacerFichier = new Process();
procDeplacerFichier.StartInfo.FileName = "cmd";
procDeplacerFichier.StartInfo.Verb = "runas";
procDeplacerFichier.StartInfo.WorkingDirectory = Directory.GetCurrentDirectory();
procDeplacerFichier.StartInfo.Arguments = "/k copy " + Directory.GetCurrentDirectory() + @"\bootsect.exe C:\Windows\System32\ & exit";
procDeplacerFichier.StartInfo.ErrorDialog = true;
procDeplacerFichier.StartInfo.WindowStyle = ProcessWindowStyle.Normal;
procDeplacerFichier.Start();
procDeplacerFichier.WaitForExit();
Process procCreerUSB = new Process();
procCreerUSB.StartInfo.FileName = "cmd";
procCreerUSB.StartInfo.Verb = "runas";
procCreerUSB.StartInfo.Arguments = "/k " + Directory.GetCurrentDirectory() + "\\MakeWinPEMedia.cmd /UFD C:\\WinPE_" + strChoosed + " " + cbxUSB.Text + " & exit";
procCreerUSB.StartInfo.ErrorDialog = true;
procCreerUSB.StartInfo.WindowStyle = ProcessWindowStyle.Normal;
procCreerUSB.Start();
procCreerUSB.WaitForExit();
}
}
}
if (Directory.Exists("C:\\WinPE_" + strChoosed))
{
if (cbxScript.Checked)
{
Process procCreerRepertoireScript = new Process();
procCreerRepertoireScript.StartInfo.FileName = "cmd";
procCreerRepertoireScript.StartInfo.Verb = "runas";
procCreerRepertoireScript.StartInfo.WorkingDirectory = Directory.GetCurrentDirectory();
procCreerRepertoireScript.StartInfo.Arguments = @"/k mkdir C:\WinPE_" + strChoosed + @"\mount\scripts & exit";
procCreerRepertoireScript.StartInfo.ErrorDialog = true;
procCreerRepertoireScript.StartInfo.WindowStyle = ProcessWindowStyle.Normal;
procCreerRepertoireScript.Start();
procCreerRepertoireScript.WaitForExit();
Process procDeplacerFichier1 = new Process();
procDeplacerFichier1.StartInfo.FileName = "cmd";
procDeplacerFichier1.StartInfo.Verb = "runas";
procDeplacerFichier1.StartInfo.WorkingDirectory = Directory.GetCurrentDirectory();
procDeplacerFichier1.StartInfo.Arguments = @"/k copy diskpart_DISK.txt C:\WinPE_" + strChoosed + @"\mount\scripts\diskpart_DISK.txt & exit";
procDeplacerFichier1.StartInfo.ErrorDialog = true;
procDeplacerFichier1.StartInfo.WindowStyle = ProcessWindowStyle.Normal;
procDeplacerFichier1.Start();
procDeplacerFichier1.WaitForExit();
Process procDeplacerFichier2 = new Process();
procDeplacerFichier2.StartInfo.FileName = "cmd";
procDeplacerFichier2.StartInfo.Verb = "runas";
procDeplacerFichier2.StartInfo.WorkingDirectory = Directory.GetCurrentDirectory();
procDeplacerFichier2.StartInfo.Arguments = @"/k copy diskpart_prep_1.txt C:\WinPE_" + strChoosed + @"\mount\scripts\diskpart_prep_1.txt & exit";
procDeplacerFichier2.StartInfo.ErrorDialog = true;
procDeplacerFichier2.StartInfo.WindowStyle = ProcessWindowStyle.Normal;
procDeplacerFichier2.Start();
procDeplacerFichier2.WaitForExit();
Process procDeplacerFichier3 = new Process();
procDeplacerFichier3.StartInfo.FileName = "cmd";
procDeplacerFichier3.StartInfo.Verb = "runas";
procDeplacerFichier3.StartInfo.WorkingDirectory = Directory.GetCurrentDirectory();
procDeplacerFichier3.StartInfo.Arguments = @"/k copy diskpart_prep_2.txt C:\WinPE_" + strChoosed + @"\mount\scripts\diskpart_prep_2.txt & exit";
procDeplacerFichier3.StartInfo.ErrorDialog = true;
procDeplacerFichier3.StartInfo.WindowStyle = ProcessWindowStyle.Normal;
procDeplacerFichier3.Start();
procDeplacerFichier3.WaitForExit();
Process procDeplacerFichier4 = new Process();
procDeplacerFichier4.StartInfo.FileName = "cmd";
procDeplacerFichier4.StartInfo.Verb = "runas";
procDeplacerFichier4.StartInfo.WorkingDirectory = Directory.GetCurrentDirectory();
procDeplacerFichier4.StartInfo.Arguments = @"/k copy diskpart_prep_3.txt C:\WinPE_" + strChoosed + @"\mount\scripts\diskpart_prep_3.txt & exit";
procDeplacerFichier4.StartInfo.ErrorDialog = true;
procDeplacerFichier4.StartInfo.WindowStyle = ProcessWindowStyle.Normal;
procDeplacerFichier4.Start();
procDeplacerFichier4.WaitForExit();
Process procDeplacerFichier5 = new Process();
procDeplacerFichier5.StartInfo.FileName = "cmd";
procDeplacerFichier5.StartInfo.Verb = "runas";
procDeplacerFichier5.StartInfo.WorkingDirectory = Directory.GetCurrentDirectory();
procDeplacerFichier5.StartInfo.Arguments = @"/k copy diskpart_TWICE.txt C:\WinPE_" + strChoosed + @"\mount\scripts\diskpart_TWICE.txt & exit";
procDeplacerFichier5.StartInfo.ErrorDialog = true;
procDeplacerFichier5.StartInfo.WindowStyle = ProcessWindowStyle.Normal;
procDeplacerFichier5.Start();
procDeplacerFichier5.WaitForExit();
Process procDeplacerFichier6 = new Process();
procDeplacerFichier6.StartInfo.FileName = "cmd";
procDeplacerFichier6.StartInfo.Verb = "runas";
procDeplacerFichier6.StartInfo.WorkingDirectory = Directory.GetCurrentDirectory();
procDeplacerFichier6.StartInfo.Arguments = @"/k copy diskpart_VOL.txt C:\WinPE_" + strChoosed + @"\mount\scripts\diskpart_VOL.txt & exit";
procDeplacerFichier6.StartInfo.ErrorDialog = true;
procDeplacerFichier6.StartInfo.WindowStyle = ProcessWindowStyle.Normal;
procDeplacerFichier6.Start();
procDeplacerFichier6.WaitForExit();
Process procDeplacerFichier7 = new Process();
procDeplacerFichier7.StartInfo.FileName = "cmd";
procDeplacerFichier7.StartInfo.Verb = "runas";
procDeplacerFichier7.StartInfo.WorkingDirectory = Directory.GetCurrentDirectory();
procDeplacerFichier7.StartInfo.Arguments = @"/k copy dism_script.bat C:\WinPE_" + strChoosed + @"\mount\scripts\dism_script.bat & exit";
procDeplacerFichier7.StartInfo.ErrorDialog = true;
procDeplacerFichier7.StartInfo.WindowStyle = ProcessWindowStyle.Normal;
procDeplacerFichier7.Start();
procDeplacerFichier7.WaitForExit();
Process procDeplacerFichier8 = new Process();
procDeplacerFichier8.StartInfo.FileName = "cmd";
procDeplacerFichier8.StartInfo.Verb = "runas";
procDeplacerFichier8.StartInfo.WorkingDirectory = Directory.GetCurrentDirectory();
procDeplacerFichier8.StartInfo.Arguments = @"/k copy Ghost64.exe C:\WinPE_" + strChoosed + @"\mount\scripts\Ghost64.bat & exit";
procDeplacerFichier8.StartInfo.ErrorDialog = true;
procDeplacerFichier8.StartInfo.WindowStyle = ProcessWindowStyle.Normal;
procDeplacerFichier8.Start();
procDeplacerFichier8.WaitForExit();
Process procDeplacerFichier9 = new Process();
procDeplacerFichier9.StartInfo.FileName = "cmd";
procDeplacerFichier9.StartInfo.Verb = "runas";
procDeplacerFichier9.StartInfo.WorkingDirectory = Directory.GetCurrentDirectory();
procDeplacerFichier9.StartInfo.Arguments = @"/k copy /y startnet.cmd C:\WinPE_" + strChoosed + @"\mount\Windows\System32\startnet.cmd & exit";
procDeplacerFichier9.StartInfo.ErrorDialog = true;
procDeplacerFichier9.StartInfo.WindowStyle = ProcessWindowStyle.Normal;
procDeplacerFichier9.Start();
procDeplacerFichier9.WaitForExit();
}
}
if (Directory.Exists("C:\\WinPE_" + strChoosed))
{
if (cbxDrivers.Checked)
{
if (tbxDrivers.Text != "")
{
string[] lines = tbxDrivers.Text.Split(new string[] { Environment.NewLine }, StringSplitOptions.None);
foreach (string l in lines)
{
Process procAddDriver = new Process();
procAddDriver.StartInfo.FileName = "cmd";
procAddDriver.StartInfo.Verb = "runas";
procAddDriver.StartInfo.WorkingDirectory = Directory.GetCurrentDirectory();
procAddDriver.StartInfo.Arguments = "/k Dism /Add-Driver /Image:C:\\WinPE_" + strChoosed + @"\mount /Driver:\"" + l + "" & exit";
procAddDriver.StartInfo.ErrorDialog = true;
procAddDriver.StartInfo.WindowStyle = ProcessWindowStyle.Normal;
procAddDriver.Start();
procAddDriver.WaitForExit();
}
}
}
}
if (tbxLCID.Text != "" || cbxDrivers.Checked)
{
Process procFermerWIM = new Process();
procFermerWIM.StartInfo.FileName = "cmd";
procFermerWIM.StartInfo.Verb = "runas";
procFermerWIM.StartInfo.WorkingDirectory = Directory.GetCurrentDirectory();
procFermerWIM.StartInfo.Arguments = "/k Dism /Unmount-Image /MountDir:C:\\WinPE_" + strChoosed + "\\mount /commit & exit";
procFermerWIM.StartInfo.ErrorDialog = true;
procFermerWIM.StartInfo.WindowStyle = ProcessWindowStyle.Normal;
procFermerWIM.Start();
procFermerWIM.WaitForExit();
}
if (Directory.Exists("C:\\WinPE_" + strChoosed))
{
if (cbxGenerateISO.Checked)
{
Process procDeplacerFichier = new Process();
procDeplacerFichier.StartInfo.FileName = "cmd";
procDeplacerFichier.StartInfo.Verb = "runas";
procDeplacerFichier.StartInfo.WorkingDirectory = Directory.GetCurrentDirectory();
procDeplacerFichier.StartInfo.Arguments = "/k copy " + Directory.GetCurrentDirectory() + @"\oscdimg.exe C:\Windows\System32\ & exit";
procDeplacerFichier.StartInfo.ErrorDialog = true;
procDeplacerFichier.StartInfo.WindowStyle = ProcessWindowStyle.Normal;
procDeplacerFichier.Start();
procDeplacerFichier.WaitForExit();
Process procGenereISO = new Process();
procGenereISO.StartInfo.FileName = "cmd";
procGenereISO.StartInfo.Verb = "runas";
procGenereISO.StartInfo.WorkingDirectory = Directory.GetCurrentDirectory();
procGenereISO.StartInfo.Arguments = "/k " + Directory.GetCurrentDirectory() + "\\MakeWinPEMedia.cmd /iso C:\\WinPE_" + strChoosed + " C:\\WinPe_" + strChoosed + "\\WinPE.iso & exit";
procGenereISO.StartInfo.ErrorDialog = true;
procGenereISO.StartInfo.WindowStyle = ProcessWindowStyle.Normal;
procGenereISO.Start();
procGenereISO.WaitForExit();
}
}
Cursor.Current = Cursors.Default;
btnGo.Enabled = true;
MessageBox.Show("All operations were successfully completed.", "Success", MessageBoxButtons.OK);
}
else
{
System.Diagnostics.Process.Start("https://docs.microsoft.com/en-us/windows-hardware/get-started/adk-install");
MessageBox.Show("You need to install Windows ADK to use WinPE Creation Tool.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
catch
{
MessageBox.Show("An unexpected error occurred.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void cbxUSB_DropDown(object sender, EventArgs e)
{
try
{
cbxUSB.Items.Clear();
ManagementObjectCollection drives = new ManagementObjectSearcher("SELECT Caption, DeviceID FROM Win32_DiskDrive WHERE InterfaceType='USB'").Get();
cbxUSB.ItemHeight = drives.Count;
foreach (ManagementObject drive in drives)
{
foreach (ManagementObject partition in new ManagementObjectSearcher(
"ASSOCIATORS OF {Win32_DiskDrive.DeviceID='"
+ drive["DeviceID"]
+ "'} WHERE AssocClass = Win32_DiskDriveToDiskPartition").Get())
{
foreach (ManagementObject disk in new ManagementObjectSearcher(
"ASSOCIATORS OF {Win32_DiskPartition.DeviceID='"
+ partition["DeviceID"]
+ "'} WHERE AssocClass = Win32_LogicalDiskToPartition").Get())
{
cbxUSB.Items.Add(disk["CAPTION"].ToString());
}
}
}
}
catch
{
if (cbxUSB.Height == 0)
{
MessageBox.Show("No USB devices are connected to your computer.");
}
}
}
private void btnHelp_Click(object sender, EventArgs e)
{
MessageBox.Show("Windows Language Code Identifier. For example : fr-FR, en-US, de-DE...");
}
private void BtnHelpScript_Click(object sender, EventArgs e)
{
MessageBox.Show("By checking this box, WinPE Creation Tool will make a pre-made script launch when WinPE starts. This script is used to capture and deploy WIM, FFU and Ghost images. It is also used to find out the index of a WIM image, add an entry to the boot menu, and prepare a partition for deployment.\n\nOf course, you can edit the script at any time. To do this, edit the \"dism_script.bat\" file.");
}
private void CbxDrivers_CheckedChanged(object sender, EventArgs e)
{
if (cbxDrivers.Checked)
{
MessageBox.Show("Add ONE driver path on EACH line.");
}
}
}
}