Repository navigation
Expand file tree
/
Copy pathdocs_setup.html
More file actions
561 lines (500 loc) · 39.5 KB
/
Copy pathdocs_setup.html
File metadata and controls
561 lines (500 loc) · 39.5 KB
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
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Setup & Script System Guide - moedev Docs</title>
<meta name="description" content="tetoOS Setup Architecture Documentation - Comprehensive guide to $OEM$ folder structures, stage scripts, and installer options.">
<meta name="keywords" content="tetoOS setup, modular setup, $OEM$ structure, Windows setup wrapper, customize windows iso">
<meta name="author" content="moedev Project">
<meta name="robots" content="index, follow, max-image-preview:large">
<meta name="theme-color" content="#dc2626">
<link rel="canonical" href="https://moedev.eu.org/docs_setup.html">
<link rel="icon" type="image/webp" href="img/t_ic.webp">
<!-- OG -->
<meta property="og:type" content="article">
<meta property="og:url" content="https://moedev.eu.org/docs_setup.html">
<meta property="og:site_name" content="moedev Docs">
<meta property="og:title" content="tetoOS Setup & Script System Architecture">
<meta property="og:description" content="Complete guide to folder structures, custom setup wrappers, and script systems for tetoOS ISO modification.">
<meta property="og:image" content="https://moedev.eu.org/img/t_ic.webp">
<meta property="og:locale" content="en_US">
<!-- Twitter -->
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="tetoOS Setup & Script System Architecture">
<meta name="twitter:description" content="Complete guide to folder structures, custom setup wrappers, and script systems for tetoOS ISO modification.">
<meta name="twitter:image" content="https://moedev.eu.org/img/t_ic.webp">
<!-- Preconnect -->
<link rel="preconnect" href="https://cdn.jsdelivr.net">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="preconnect" href="https://flagcdn.com">
<!-- Bootstrap -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
<!-- Fonts -->
<link href="https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;700;800&family=JetBrains+Mono:wght@400;500;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="css/main.css?v=2.7">
<link rel="stylesheet" href="css/docs.css?v=2.6">
</head>
<body class="teto-theme">
<!-- Navbar -->
<nav id="main-nav"></nav>
<!-- Content -->
<main class="docs-wrapper container fade-in-smooth">
<!-- Header -->
<header class="docs-header">
<div class="docs-badge" data-i18n="docs_badge">DOCUMENTATION & SETUP GUIDE</div>
<h1 class="docs-title" data-i18n="docs_title">Section required for review</h1>
<p class="docs-subtitle" data-i18n="docs_subtitle">README - Complete Guide to Folder Structures, Custom Setup Wrappers, Script Systems & Installer Options for tetoOS ISO Modification.</p>
</header>
<div class="row">
<!-- Sticky Table of Contents (Sidebar) -->
<div class="col-lg-3">
<div class="toc-box">
<div class="toc-title" data-i18n="docs_toc_title">TABLE OF CONTENTS</div>
<ul class="toc-list">
<li><a href="#overview" data-i18n="docs_toc_1">1. Overview</a></li>
<li><a href="#startsetup-ini" data-i18n="docs_toc_2">2. StartSetup.ini Structure</a></li>
<li><a href="#folder-structure" data-i18n="docs_toc_3">3. $OEM$ Folder Structure</a></li>
<li><a href="#script-system" data-i18n="docs_toc_4">4. Script System</a></li>
<li><a href="#install-options" data-i18n="docs_toc_5">5. _InstallOption_*.cmd Files</a></li>
<li><a href="#settings-ini" data-i18n="docs_toc_6">6. OS_Settings.ini Structure</a></li>
<li><a href="#cmd-guide" data-i18n="docs_toc_7">7. CMD Scripting Guide</a></li>
<li><a href="#debugging" data-i18n="docs_toc_8">8. Common Errors & Debugging</a></li>
</ul>
</div>
</div>
<!-- Main Content Area -->
<div class="col-lg-9">
<!-- SECTION 1: OVERVIEW -->
<section id="overview" class="docs-card">
<h2 class="docs-card-title" data-i18n="docs_sec1_title">1. Overview</h2>
<p class="docs-lead" data-i18n="docs_sec1_lead">
Folder placement follows the native Windows <code>$OEM$</code> folder mechanism. This wrapper was created to apply customizations during the installation process, so after progress reaches 100%, the computer can be left unattended without waiting for OOBE to finish.
</p>
<p style="color: #cbd5e1; line-height: 1.7;" data-i18n="docs_sec1_p1">
This wrapper does not eliminate OOBE, but rather moves most of the post-installation workload into the Windows setup stage. The entry point is reads <code>StartSetup.ini</code> to display OS/edition selection and then copies the appropriate <code>$oem$</code> folder to the installation media.
</p>
<div class="my-4">
<h5 style="color: #fff; font-weight: 700; font-size: 1.1rem; margin-bottom: 12px;" data-i18n="docs_sec1_adv_title">Advantages of this Method:</h5>
<ul class="feature-list">
<li data-i18n="docs_sec1_adv1"><span style="color: #34d399; font-weight: bold;">•</span> <strong>Users can unplug the USB drive after 100% progress.</strong></li>
<li data-i18n="docs_sec1_adv2"><span style="color: #34d399; font-weight: bold;">•</span> <strong>Tweaks and software can be installed while setup is running.</strong></li>
<li data-i18n="docs_sec1_adv3"><span style="color: #34d399; font-weight: bold;">•</span> <strong>No need to wait at the computer during OOBE.</strong></li>
<li data-i18n="docs_sec1_adv4"><span style="color: #34d399; font-weight: bold;">•</span> <strong>Compatible with standard $oem$ structure.</strong></li>
</ul>
</div>
<div class="alert-box-warn" data-i18n="docs_sec1_warn">
<strong>Critical Warning:</strong><br>
Scripts running too early, taking too long, or containing invalid syntax can still cause:
<ul class="mb-0 mt-2 ps-3">
<li>Indefinite <em>Just a moment</em> screen;</li>
<li>Recurring boot loops;</li>
<li><code>CONFIG_INITIALIZATION_FAILED</code>;</li>
<li>User profile corruption;</li>
<li>Deadlocks during OOBE phase.</li>
</ul>
</div>
<p style="color: #94a3b8; font-size: 0.95rem; line-height: 1.7; margin-bottom: 0;" data-i18n="docs_sec1_foot">
This system is designed as an extension of the Windows <code>$oem$</code> mechanism. Folders, scripts, and configuration files (<code>StartSetup.ini</code>, <code>OS_Settings.ini</code>) are deeply interconnected. An error in one component can disrupt the entire installation process.
</p>
</section>
<!-- SECTION 2: STARTSETUP.INI -->
<section id="startsetup-ini" class="docs-card">
<h2 class="docs-card-title" data-i18n="docs_sec2_title">2. StartSetup.ini Structure</h2>
<p class="docs-lead" data-i18n="docs_sec2_lead">
The primary configuration file read to manage OS selection and setup UI timeout.
</p>
<h6 style="color: #fca5a5; font-weight: 700; margin-top: 20px;" data-i18n="docs_sec2_example_label">Example StartSetup.ini Content:</h6>
<pre class="code-block"><code><span class="heading">[OSList]</span>
Windows 11=11|10.0.22000
Windows 10=10|10.0.<22000
Windows 8.1=8.1|6.3
Windows 7=7|6.1
<span class="heading">[Unattend]</span>
SetupUILangDefault=en-US
OSDefault=10</pre>
<div class="docs-table-wrapper">
<table class="docs-table">
<thead>
<tr>
<th data-i18n="docs_sec2_th_key">Key / Parameter</th>
<th data-i18n="docs_sec2_th_desc">Function & Explanation</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>[OSList]</code></td>
<td data-i18n="docs_sec2_row1">List of selectable operating systems. Format: <code>Label=Code|Build version</code>. The <code><</code> symbol denotes "lower than" (e.g. <code>10.0.<22000</code> = Windows 10).</td>
</tr>
<tr>
<td><code>SetupAutoStart_Timeout</code></td>
<td data-i18n="docs_sec2_row2">Seconds before setup auto-starts without user intervention.</td>
</tr>
<tr>
<td><code>SetupUILangDefault</code></td>
<td data-i18n="docs_sec2_row3">Default setup UI language (e.g. <code>en-US</code>).</td>
</tr>
<tr>
<td><code>OSDefault</code></td>
<td data-i18n="docs_sec2_row4">OS code selected by default (matches code in <code>[OSList]</code>).</td>
</tr>
<tr>
<td><code>OSPage_Hide</code></td>
<td data-i18n="docs_sec2_row5">If uncommented (<code>=1</code>), hides the OS selection page.</td>
</tr>
<tr>
<td><code>OSPage_Timeout</code></td>
<td data-i18n="docs_sec2_row6">Seconds before the OS selection page automatically advances to the next step.</td>
</tr>
</tbody>
</table>
</div>
</section>
<!-- SECTION 3: FOLDER STRUCTURE -->
<section id="folder-structure" class="docs-card">
<h2 class="docs-card-title" data-i18n="docs_sec3_title">3. Folder Structure & $OEM$ Mapping</h2>
<p class="docs-lead" data-i18n="docs_sec3_lead">
Below are the physical folders packaged inside the Setup. Numeric prefixes (e.g. <code>OS_</code>) denote target OS codes defined in <code>[OSList]</code> - <code>10</code> = Windows 10.
</p>
<h5 style="color: #fff; font-weight: 700; margin-top: 25px;" data-i18n="docs_sec3_h1">Per-OS $oem$ Folders</h5>
<div class="docs-table-wrapper">
<table class="docs-table">
<thead>
<tr>
<th data-i18n="docs_sec3_th_folder">Folder</th>
<th data-i18n="docs_sec3_th_fn">Function</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>OS_$oem$</code></td>
<td data-i18n="docs_sec3_r1">Identical to native Windows <code>$OEM$</code> folder for the respective OS (in this case Windows 10).</td>
</tr>
<tr>
<td><code>OS_$oem$_2</code></td>
<td data-i18n="docs_sec3_r2">Same as <code>$OEM$</code>, but applied immediately without installer options. Contains Media, Resources\Themes, Setup\Scripts\Patches, etc.</td>
</tr>
</tbody>
</table>
</div>
<h5 style="color: #fff; font-weight: 700; margin-top: 30px;" data-i18n="docs_sec3_h2">Shared $oem$ Folders (Cross-OS)</h5>
<div class="docs-table-wrapper">
<table class="docs-table">
<thead>
<tr>
<th data-i18n="docs_sec3_th_folder">Folder</th>
<th data-i18n="docs_sec3_th_fn">Function</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>$oem$_shared</code></td>
<td data-i18n="docs_sec3_sh1">Applied to all Windows architectures.</td>
</tr>
<tr>
<td><code>$oem$_shared_x64</code></td>
<td data-i18n="docs_sec3_sh2">Applied exclusively to 64-bit Windows.</td>
</tr>
<tr>
<td><code>$oem$_shared_x86</code></td>
<td data-i18n="docs_sec3_sh3">Applied exclusively to 32-bit Windows.</td>
</tr>
<tr>
<td><code>$oem$_scripts_shared</code></td>
<td data-i18n="docs_sec3_sh4">Scripts always copied & executed (contains Activator, Tweaks, Tweaks_forced, _Drivers.cmd, _Soft.cmd, cmdow.exe).</td>
</tr>
<tr>
<td><code>$oem$_scripts_options_shared</code></td>
<td data-i18n="docs_sec3_sh5">Copied to <code>C:\Windows\Scripts</code> only when selected in installer options (<code>OS_Settings.ini</code>). E.g. 7-Zip.</td>
</tr>
<tr>
<td><code>$oem$_scripts_options_8+</code></td>
<td data-i18n="docs_sec3_sh6">Same as above, but restricted to Windows 8 and later.</td>
</tr>
</tbody>
</table>
</div>
<h5 style="color: #fff; font-weight: 700; margin-top: 30px;" data-i18n="docs_sec3_h3">Standard $OEM$ Folder Mapping</h5>
<div class="docs-table-wrapper">
<table class="docs-table">
<thead>
<tr>
<th data-i18n="docs_sec3_th_src">Source Folder</th>
<th data-i18n="docs_sec3_th_dst">Destination Extraction on Target System</th>
</tr>
</thead>
<tbody>
<tr><td><code>$1</code></td><td><code>C:\</code></td></tr>
<tr><td><code>$$</code></td><td><code>C:\Windows</code></td></tr>
<tr><td><code>$$\Setup\Scripts</code></td><td><code>C:\Windows\Setup\Scripts</code> (primary stage scripts location)</td></tr>
<tr><td><code>$Docs</code></td><td>User Documents folder</td></tr>
<tr><td><code>$Progs</code></td><td><code>C:\Program Files</code></td></tr>
<tr><td><code>$Progs32</code></td><td><code>C:\Program Files (x86)</code></td></tr>
<tr><td><code>$Users</code></td><td><code>C:\Users</code></td></tr>
</tbody>
</table>
</div>
<div class="alert-box-info my-3" data-i18n="docs_sec3_ex_map">
<strong>Mapping Examples:</strong><br>
• <code>OS_$oem$\$1\Users\Public\Desktop</code> → copied to <code>C:\Users\Public\Desktop</code><br>
• <code>OS_$oem$\$$\Setup\Scripts\SetupComplete.cmd</code> → copied to <code>C:\Windows\Setup\Scripts\SetupComplete.cmd</code>
</div>
<div class="alert-box-warn" data-i18n="docs_sec3_warn">
<strong>Important Notes:</strong>
<ul class="mb-0 mt-2 ps-3">
<li>Folders ending in <code>_options</code> require user selection in the installer.</li>
<li>Folders ending in <code>_2</code> are always applied automatically.</li>
<li><code>OS_Settings.ini</code> configures tweaks and installer options for that OS.</li>
<li>Incorrect folder placement may cause tweaks or scripts not to execute at all.</li>
</ul>
</div>
</section>
<!-- SECTION 4: SCRIPT SYSTEM -->
<section id="script-system" class="docs-card">
<h2 class="docs-card-title" data-i18n="docs_sec4_title">4. Script System</h2>
<p class="docs-lead" data-i18n="docs_sec4_lead">
Contents of <code>$$\Setup\Scripts</code> are copied to <code>C:\Windows\Setup\Scripts</code> and executed automatically during matching installation phases. Primary stage scripts reside in <code>OS_$oem$\$$\Setup\Scripts</code>.
</p>
<h5 style="color: #fff; font-weight: 700; margin-top: 25px;" data-i18n="docs_sec4_order_title">Execution Order of Stage Scripts:</h5>
<div class="d-flex flex-wrap align-items-center gap-2 my-3">
<span class="badge" style="background: rgba(239, 68, 68, 0.2); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.4); padding: 8px 12px; font-size: 0.9rem;">1. Specialize.cmd</span>
<span style="color: #64748b;">→</span>
<span class="badge" style="background: rgba(239, 68, 68, 0.2); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.4); padding: 8px 12px; font-size: 0.9rem;">2. OOBE.cmd</span>
<span style="color: #64748b;">→</span>
<span class="badge" style="background: rgba(239, 68, 68, 0.2); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.4); padding: 8px 12px; font-size: 0.9rem;">3. SetupComplete.cmd</span>
<span style="color: #64748b;">→</span>
<span class="badge" style="background: rgba(239, 68, 68, 0.2); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.4); padding: 8px 12px; font-size: 0.9rem;">4. FirstLogonCommands.cmd</span>
<span style="color: #64748b;">→</span>
<span class="badge" style="background: rgba(239, 68, 68, 0.2); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.4); padding: 8px 12px; font-size: 0.9rem;">5. FirstLogonCommandsDesktop.cmd</span>
</div>
<h5 style="color: #fff; font-weight: 700; margin-top: 30px;" data-i18n="docs_sec4_pattern_title">Tweak Calling Pattern (Crucial):</h5>
<p style="color: #cbd5e1; line-height: 1.7;" data-i18n="docs_sec4_pattern_p">
Each stage script loops through tweak folders and invokes <code>_InstallOption_<Stage>.cmd</code> if present. Note: the filename uses <code>_InstallOption_</code> (singular), NOT <code>_InstallOptions_</code>.
</p>
<h6 style="color: #fca5a5; font-weight: 700; margin-top: 15px;" data-i18n="docs_sec4_example_label">Snippet from Specialize.cmd:</h6>
<pre class="code-block"><code><span class="keyword">@echo off</span>
<span class="string">"%~dp0cmdow.exe"</span> @ /HID
<span class="keyword">cd</span> <span class="string">"%~dp0"</span>
<span class="keyword">if exist</span> <span class="string">"%~dp0specialize.DONE"</span> <span class="keyword">exit</span>
<span class="keyword">for</span> %%x <span class="keyword">in</span> (tweaks_forced\*.reg) <span class="keyword">do</span> regedit /s <span class="string">"%%x"</span>
<span class="keyword">for /d</span> %%B <span class="keyword">in</span> (<span class="string">"%~dp0*"</span>) <span class="keyword">do</span> (
<span class="keyword">if exist</span> <span class="string">"%%B\_InstallOption_Specialize.cmd"</span> (
<span class="keyword">call</span> <span class="string">"%%B\_InstallOption_Specialize.cmd"</span>
)
)
<span class="keyword">@echo</span> Prevent double launch><span class="string">"%~dp0specialize.DONE"</span>
<span class="keyword">exit</span></code></pre>
<ul class="feature-list">
<li data-i18n="docs_sec4_note1"><span style="color: #38bdf8;">•</span> <code>cmdow.exe @ /HID</code> hides the CMD console window while background stages execute.</li>
<li data-i18n="docs_sec4_note2"><span style="color: #38bdf8;">•</span> <code>.DONE</code> marker files (e.g. <code>specialize.DONE</code>, <code>FirstLogonCommands.DONE</code>) prevent redundant/looping executions.</li>
<li data-i18n="docs_sec4_note3"><span style="color: #38bdf8;">•</span> <code>Tweaks_forced\*.reg</code> are applied without options; folder tweaks use <code>_InstallOption_<Stage>.cmd</code>.</li>
</ul>
</section>
<!-- SECTION 5: INSTALLOPTION & WORKFLOW -->
<section id="install-options" class="docs-card">
<h2 class="docs-card-title" data-i18n="docs_sec5_title">5. _InstallOption_*.cmd Files & Mechanism</h2>
<p class="docs-lead" data-i18n="docs_sec5_lead">
The filename dictates the exact installation stage where the tweak is triggered by the wrapper.
</p>
<h5 style="color: #fff; font-weight: 700;" data-i18n="docs_sec5_stages_title">System Recognized Stage Names:</h5>
<div class="d-flex flex-wrap gap-2 my-3">
<code>_InstallOption_Specialize.cmd</code>
<code>_InstallOption_OOBE.cmd</code>
<code>_InstallOption_SetupComplete.cmd</code>
<code>_InstallOption_FirstLogon.cmd</code>
<code>_InstallOption_FirstLogonDesktop.cmd</code>
</div>
<div class="alert-box-info" data-i18n="docs_sec5_special_alert">
<strong>Special Tweak Collections:</strong><br>
• Tweaks in <code>Tweaks_forced</code> (e.g. <code>Control_Defender</code>, <code>Control_UpdateCenter</code>) are invoked directly via <code>_Install.cmd</code> from <code>OOBE.cmd</code> - not via <code>_InstallOption_</code>.<br>
• The <code>Skipped</code> folder contains intentionally disabled tweaks (using <code>__InstallOption_Specialize.cmd</code> with double underscores so the system skips looping it).
</div>
<h5 style="color: #fff; font-weight: 700; margin-top: 25px;" data-i18n="docs_sec5_workflow_title">Installer Workflow & Configuration:</h5>
<p style="color: #cbd5e1; line-height: 1.7;" data-i18n="docs_sec5_workflow_p">
The installer reads <code>OS_Settings.ini</code>, scans for matching <code>_InstallOption_*.cmd</code> files in target tweak folders, and executes them at the designated stage after user confirmation.
</p>
<pre class="code-block"><code><span class="comment"># Folder Structure:</span>
$oem$_scripts_options_8+\0.StartMenu
└── _InstallOption_SetupComplete.cmd
└── _InstallOption_FirstLogonDesktop.cmd
<span class="comment"># Configuration in OS_Settings.ini:</span>
<span class="heading">[Option:StartIsBack]</span>
Checked=0
en-US=Windows 7 Start Menu
Dir=$oem$_scripts_options_8+\0.StartMenu</code></pre>
<p style="color: #34d399; font-size: 0.95rem;" data-i18n="docs_sec5_result_p">
<strong>Result:</strong> "Windows 7 Start Menu" tweak runs at <em>SetupComplete</em> and <em>FirstLogonDesktop</em> stages if checked by user during install.
</p>
<h5 style="color: #fff; font-weight: 700; margin-top: 30px;" data-i18n="docs_sec5_steps_title">Steps to Add a New Tweak:</h5>
<ol style="color: #cbd5e1; line-height: 1.8; padding-left: 20px;">
<li data-i18n="docs_sec5_step1">Create a new folder inside <code>Tweaks</code> (or <code>Tweaks_forced</code> for mandatory tweaks).</li>
<li data-i18n="docs_sec5_step2">Add <code>_InstallOption_<Stage>.cmd</code> to define execution timing (or <code>_Install.cmd</code> for Tweaks_forced).</li>
<li data-i18n="docs_sec5_step3">Place supporting files such as <code>.reg</code>, <code>.cmd</code>, <code>.ps1</code>, or <code>.exe</code> in the same folder.</li>
<li data-i18n="docs_sec5_step4">Register the folder in <code>OS_Settings.ini</code> (for optional installer tweaks).</li>
</ol>
</section>
<!-- SECTION 6: OS_SETTINGS.INI -->
<section id="settings-ini" class="docs-card">
<h2 class="docs-card-title" data-i18n="docs_sec6_title">6. OS_Settings.ini Structure</h2>
<p class="docs-lead" data-i18n="docs_sec6_lead">
<code>OS_Settings.ini</code> is utilized by the installer to specify target images/editions, unattend options, and the list of tweaks presented to users. It connects tweak labels to script folders. Stored as <strong>UTF-16LE</strong>.
</p>
<h5 style="color: #fca5a5; font-weight: 700; margin-top: 25px;" data-i18n="docs_sec6_sec1_title">Section [WIM-ESD]</h5>
<p style="color: #cbd5e1;" data-i18n="docs_sec6_sec1_p">Defines image sources, WIM/ESD index assignments, and Office image targets.</p>
<pre class="code-block"><code><span class="heading">[WIM-ESD]</span>
OSImage_1=sources\install.esd
OSImage_2=sources\install.wim
OfficeImage=sources\o_office_24.esd,1
IfOfficeImageNotExist=WIM-ESD\o_office_24.esd,1
WinRE_x86=sources\boot.wim,1
WinRE_x64=sources\boot.wim,1</code></pre>
<h5 style="color: #fca5a5; font-weight: 700; margin-top: 25px;" data-i18n="docs_sec6_sec2_title">Section [EditionsListFull-HighFromLow]</h5>
<p style="color: #cbd5e1;" data-i18n="docs_sec6_sec2_p">Maps Windows editions (e.g. Core, Enterprise) alongside language tags and edition upgrade paths.</p>
<pre class="code-block"><code><span class="heading">[EditionsListFull-HighFromLow]</span>
CoreSingleLanguage=Core
Core=CoreSingleLanguage
Professional=Core,CoreSingleLanguage
<span class="comment">;Education:NNNNN-NNNNN-NNNNN-NNNNN-NNNNN=Core,CoreSingleLanguage</span>
Enterprise:NNNNN-NNNNN-NNNNN-NNNNN-NNNNN=Professional,Core,CoreSingleLanguage
LTSC21=
LSTC19=
IoTEnterprise=Enterprise</code></pre>
<h5 style="color: #fca5a5; font-weight: 700; margin-top: 25px;" data-i18n="docs_sec6_sec3_title">Section [Unattend]</h5>
<p style="color: #cbd5e1;" data-i18n="docs_sec6_sec3_p">Configures edition page behavior and installer customization defaults.</p>
<pre class="code-block"><code><span class="heading">[Unattend]</span>
EditionDefault=IoTEnterpriseS
SEditionDefault_Architecture=x64
SEditionDefault_InstallLang=en-US
OSPage_SystemUserName=Admin
OSPage_ComputerName=*
OSPage_Workgroup=WORKGROUP
OSPage_ActivateWindows=0
OSPage_InstallDrivers=0
OSPage_TurnOff_UAC=0
OSPage_TurnOff_Defender=0
OSPage_TurnOff_Firewall=0</code></pre>
<h5 style="color: #fca5a5; font-weight: 700; margin-top: 25px;" data-i18n="docs_sec6_sec4_title">Section [Option:*]</h5>
<p style="color: #cbd5e1;" data-i18n="docs_sec6_sec4_p">
Each optional tweak is defined as an <code>[Option:Name]</code> block. Language labels (e.g. <code>en-US=</code>) display in the installer UI; <code>Dir=</code> targets the tweak folder; <code>Checked=</code> determines default selection state.
</p>
<pre class="code-block"><code><span class="heading">[Option:7Zip]</span>
Checked=1
en-US=7-Zip
Dir=$oem$_scripts_options_shared\7-Zip
<span class="heading">[Option:StartIsBack]</span>
Checked=0
en-US=Windows 7 Start Menu
Dir=$oem$_scripts_options_8+\0.StartMenu
<span class="heading">[Option:Theme]</span>
Checked=0
en-US=No anime wallpaper
Dir=$oem$_scripts_options_8+\Theme</code></pre>
<div class="alert-box-info" data-i18n="docs_sec6_note">
<strong>Note:</strong> Folders listed in <code>OS_Settings.ini</code> will still be copied, but without a matching <code>_InstallOption_<Stage>.cmd</code> file, scripts won't execute - files are simply copied over.
</div>
</section>
<!-- SECTION 7: CMD GUIDE -->
<section id="cmd-guide" class="docs-card">
<h2 class="docs-card-title" data-i18n="docs_sec7_title">7. CMD Script Writing Guide</h2>
<p class="docs-lead" data-i18n="docs_sec7_lead">
Most tweaks are executed through <code>.cmd</code> or <code>.bat</code> files. Minor mistakes can cause excessive setup delays, boot failures, or OOBE stalls.
</p>
<h5 style="color: #fff; font-weight: 700;" data-i18n="docs_sec7_basic_title">Basic CMD Script Structure:</h5>
<pre class="code-block"><code><span class="keyword">@echo off</span>
<span class="keyword">cd /d</span> <span class="string">"%~dp0"</span>
<span class="keyword">setlocal</span> EnableExtensions EnableDelayedExpansion
<span class="comment">REM === Write customization commands here ===</span>
<span class="keyword">exit /b</span></code></pre>
<h5 style="color: #fff; font-weight: 700; margin-top: 30px;" data-i18n="docs_sec7_rules_title">Practical Script Writing Guidelines:</h5>
<ul class="feature-list">
<li data-i18n="docs_sec7_rule1"><span>•</span> <strong>Always terminate scripts with <code>exit /b</code></strong> (or <code>exit</code> for main stage scripts) so the installer can proceed.</li>
<li data-i18n="docs_sec7_rule2"><span>•</span> <strong>Use <code>call</code> when invoking external CMD files;</strong> otherwise, the parent script terminates prematurely.</li>
<li data-i18n="docs_sec7_rule3"><span>•</span> <strong>Use <code>start /wait</code></strong> whenever external installers must finish before continuing.</li>
<li data-i18n="docs_sec7_rule4"><span>•</span> <strong>Begin stage scripts with <code>cd /d "%~dp0"</code></strong> and <code>"%~dp0cmdow.exe" @ /HID</code> to conceal CMD console windows.</li>
<li data-i18n="docs_sec7_rule5"><span>•</span> <strong>Leverage <code>.DONE</code> markers</strong> to prevent scripts from executing repeatedly.</li>
<li data-i18n="docs_sec7_rule6"><span>•</span> <strong>Avoid interactive dialogs</strong> such as <code>pause</code>, <code>choice</code>, or <code>msgbox</code> during installation.</li>
<li data-i18n="docs_sec7_rule7"><span>•</span> <strong>Avoid issuing restart, shutdown, or logoff commands</strong> unless strictly mandatory.</li>
<li data-i18n="docs_sec7_rule8"><span>•</span> <strong>Wrap all system paths in double quotes</strong>, e.g. <code>"%SystemRoot%\Setup\Scripts"</code>.</li>
<li data-i18n="docs_sec7_rule9"><span>•</span> <strong>Test every tweak standalone</strong> before integrating into the master installer package.</li>
</ul>
<h5 style="color: #fff; font-weight: 700; margin-top: 35px;" data-i18n="docs_sec7_stages_table_title">Installation Stage Breakdown Table:</h5>
<div class="docs-table-wrapper">
<table class="docs-table">
<thead>
<tr>
<th data-i18n="docs_sec7_th_stage">Installation Stage</th>
<th data-i18n="docs_sec7_th_purpose">Recommended Usage</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>Specialize</code></td>
<td data-i18n="docs_sec7_stg1">Driver injection, system registry, early hardware configuration, and <code>tweaks_forced\*.reg</code> execution.</td>
</tr>
<tr>
<td><code>OOBE</code></td>
<td data-i18n="docs_sec7_stg2">User account creation, light tweaks, and executing <code>_Install.cmd</code> for Control_Defender / UpdateCenter.</td>
</tr>
<tr>
<td><code>SetupComplete</code></td>
<td data-i18n="docs_sec7_stg3">Built-in software installation, system patches, Windows activation, and residual cleanup (OneDrive, defaultuser0).</td>
</tr>
<tr>
<td><code>FirstLogonCommands</code></td>
<td data-i18n="docs_sec7_stg4">Specific configuration for new user profiles upon initial login.</td>
</tr>
<tr>
<td><code>FirstLogonCommandsDesktop</code></td>
<td data-i18n="docs_sec7_stg5">Taskbar, Start Menu, Windows Explorer settings, and visual desktop interface tweaks.</td>
</tr>
</tbody>
</table>
</div>
</section>
<!-- SECTION 8: DEBUGGING & COMMON ERRORS -->
<section id="debugging" class="docs-card">
<h2 class="docs-card-title" data-i18n="docs_sec8_title">8. Common Errors & Debugging Tips</h2>
<h5 style="color: #fca5a5; font-weight: 700;" data-i18n="docs_sec8_common_err_title">Most Frequent Mistakes:</h5>
<ul class="feature-list">
<li data-i18n="docs_sec8_err1"><span style="color: #ef4444;">•</span> Forgetting to append <code>exit /b</code> at the end of the script.</li>
<li data-i18n="docs_sec8_err2"><span style="color: #ef4444;">•</span> Using <code>start</code> without the <code>/wait</code> switch, causing process overlap.</li>
<li data-i18n="docs_sec8_err3"><span style="color: #ef4444;">•</span> Calling secondary scripts directly without the <code>call</code> keyword.</li>
<li data-i18n="docs_sec8_err4"><span style="color: #ef4444;">•</span> Running application installers that require interactive user input (non-silent).</li>
<li data-i18n="docs_sec8_err5"><span style="color: #ef4444;">•</span> Assigning tweaks to the wrong stage (e.g. running UI desktop tweaks during Specialize).</li>
<li data-i18n="docs_sec8_err6"><span style="color: #ef4444;">•</span> Typos in filename: using <code>_InstallOptions_</code> (plural) instead of <code>_InstallOption_</code> (singular).</li>
<li data-i18n="docs_sec8_err7"><span style="color: #ef4444;">•</span> Tweak folder name mismatching the <code>Dir=</code> entry in <code>OS_Settings.ini</code>.</li>
</ul>
<div class="alert-box-info mt-4">
<h5 style="color: #93c5fd; font-weight: 700; margin-bottom: 10px;" data-i18n="docs_sec8_checklist_title">Debugging Checklist Tips:</h5>
<p style="margin-bottom: 8px;" data-i18n="docs_sec8_checklist_desc">If your tweak or customization fails to execute during setup, verify the following:</p>
<ol style="padding-left: 20px; line-height: 1.8; margin-bottom: 0;">
<li data-i18n="docs_sec8_chk1">Verify the tweak folder is registered under the <code>Dir=</code> line in <code>OS_Settings.ini</code>.</li>
<li data-i18n="docs_sec8_chk2">Ensure the physical folder name matches the INI file entry exactly (case-sensitive safe).</li>
<li data-i18n="docs_sec8_chk3">Verify the existence of <code>_InstallOption_<Stage>.cmd</code> (singular spelling without "s").</li>
<li data-i18n="docs_sec8_chk4">Check if a leftover <code>.DONE</code> marker file from previous attempts is blocking execution.</li>
<li data-i18n="docs_sec8_chk5">Test the script manually inside a running live Windows instance to verify functionality.</li>
<li data-i18n="docs_sec8_chk6">Add debug logging like <code>echo Stage OK >> C:\log.txt</code> to track execution line by line.</li>
</ol>
</div>
<!-- Cross Navigation Footer -->
<!-- <div class="text-center mt-4 pt-3 border-top" style="border-color: rgba(255, 255, 255, 0.08) !important;"> -->
<!-- <a href="teto.html" class="btn btn-primary-red px-4 py-2 me-2">↠Back to tetoOS 10</a> -->
<!-- <a href="docs_tpkg.html" class="btn btn-outline-light px-4 py-2 me-2" style="border-radius: 8px;">Package Manager (tpkg) Docs →</a> -->
<!-- <a href="docs_debloat.html" class="btn btn-outline-light px-4 py-2" style="border-radius: 8px;">Debloat Docs →</a> -->
<!-- </div> -->
</section>
</div>
</div>
</main>
<!-- Shared bottom -->
<div id="shared-bottom-sections"></div>
<!-- Modals -->
<div id="shared-modals"></div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
<script src="js/translations.js"></script>
<script src="js/translations_docs_setup.js"></script>
<script src="js/components.js"></script>
<script src="js/theme.js"></script>
</body>
</html>