-
-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathuniversal-intel-chipset-device-updater.ps1
More file actions
2661 lines (2299 loc) · 116 KB
/
Copy pathuniversal-intel-chipset-device-updater.ps1
File metadata and controls
2661 lines (2299 loc) · 116 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
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<#PSScriptInfo
.VERSION 2026.07.0015
.GUID c5044de3-67b5-4e70-b6fc-75e7847c799e
.NAME universal-intel-chipset-device-updater
.AUTHOR Marcin Grygiel
.COMPANYNAME FirstEver.tech
.COPYRIGHT (c) 2026 Marcin Grygiel / FirstEver.tech. All rights reserved.
.TAGS Universal Intel Chipset Device Software Updater INF Windows Automation MDM
.LICENSEURI https://github.com/FirstEverTech/Universal-Intel-Chipset-Updater/blob/main/LICENSE
.PROJECTURI https://github.com/FirstEverTech/Universal-Intel-Chipset-Updater
.ICONURI
.EXTERNALMODULEDEPENDENCIES
.REQUIREDSCRIPTS
.EXTERNALSCRIPTDEPENDENCIES
.RELEASENOTES
v2026.05.0014 - Improved display formatting: removed "Generation:" label, added parsing info hint, cleaned up extra blank lines.
#>
<#
.SYNOPSIS
Detects and installs the latest Intel Chipset Device Software INF files.
.DESCRIPTION
Automatically detects, downloads, and installs the latest Intel Chipset Device
Software INF files for your specific hardware. Compares installed INF versions
against a complete historical database of every Intel Chipset Device Software
package ever released, then downloads and installs the correct latest version.
Security: full SHA-256 hash verification and Intel digital signature validation
before execution. Automatic System Restore Point created before any changes.
Requires Administrator privileges (auto-elevates if needed) and internet access
to GitHub and Intel servers. Downloads are verified before execution - no
unverified code is ever run.
Supports silent unattended deployment via -quiet flag for MDM solutions:
Microsoft Intune, SCCM, VMware Workspace ONE, PDQ Deploy.
Usage: .\universal-intel-chipset-device-updater.ps1 [options]
Options:
-help, -? Display this help and exit.
-version, -v Display the tool version and exit.
-auto, -a All prompts are answered with Yes, no user interaction required.
-quiet, -q Run in completely silent mode (no console window).
Implies -auto and hides the PowerShell window.
-beta Use beta database for new hardware testing.
-debug, -d Enable debug output.
-skipverify, -s Skip script self-hash verification. Use only for testing.
Logging: All actions are logged to %ProgramData%\chipset_update.log.
.PARAMETER version
Display the tool version and exit.
.PARAMETER auto
Run in automatic mode - all prompts are answered with Yes.
No user interaction is required. Suitable for scripted deployments.
.PARAMETER quiet
Run in completely silent mode with no console window.
Implies -auto and relaunches the script with -WindowStyle Hidden.
Suitable for MDM solutions: Microsoft Intune, SCCM, VMware Workspace ONE, PDQ Deploy.
.PARAMETER beta
Use the beta database (intel-chipset-infs-beta.md) instead of the stable release.
Intended for testing support for new Intel hardware platforms before official release.
.PARAMETER debug
Enable debug output. Prints detailed diagnostic messages to the console
during execution. All debug messages are also written to the log file
regardless of whether this flag is set.
.PARAMETER skipverify
Skip the script self-hash verification.
By default, the script verifies its own integrity against a SHA-256 file
published on GitHub before proceeding. Use this flag for local testing only.
.EXAMPLE
.\universal-intel-chipset-device-updater.ps1
Runs the updater interactively. The user is prompted at each step.
.EXAMPLE
.\universal-intel-chipset-device-updater.ps1 -auto
Runs the updater without any user prompts. All confirmations are answered Yes automatically.
.EXAMPLE
.\universal-intel-chipset-device-updater.ps1 -quiet
Runs completely silently with no console window. Suitable for background deployment via MDM.
.EXAMPLE
.\universal-intel-chipset-device-updater.ps1 -auto -debug
Runs without user prompts and prints detailed diagnostic output to the console.
.EXAMPLE
.\universal-intel-chipset-device-updater.ps1 -auto -skipverify
Runs without user prompts and skips self-hash verification. Use for local testing only.
.NOTES
Author: Marcin Grygiel / FirstEver.tech
License: MIT
All actions are logged to %ProgramData%\chipset_update.log.
This tool is not affiliated with Intel Corporation.
INF files are sourced from official Intel servers.
Use at your own risk.
.LINK
https://github.com/FirstEverTech/Universal-Intel-Chipset-Updater
#>
# =============================================
# COMMAND-LINE PARAMETERS - MANUAL PARSING
# =============================================
# To disable partial matching, we do not use param() block.
# Instead we parse $args manually.
$rawArgs = $args
$Help = $false
$Version = $false
$AutoMode = $false
$Debug = $false
$SkipVerification = $false
$QuietMode = $false
$Beta = $false
$Developer = $false
# Allowed switches (full names and aliases)
$allowedSwitches = @(
'-help',
'-?',
'-version', '-v',
'-auto', '-a',
'-beta',
'-developer',
'-debug', '-d',
'-skipverify', '-s',
'-quiet', '-q'
)
# Parse arguments
for ($i = 0; $i -lt $rawArgs.Count; $i++) {
$arg = $rawArgs[$i]
if ($arg -match '^-') {
if ($allowedSwitches -notcontains $arg) {
Clear-Host
Write-Host ""
Write-Host " Unknown parameter: $arg"
Write-Host " Use -help or -? to see available options."
Write-Host ""
exit 1
}
switch -Regex ($arg) {
'^-help$' { $Help = $true }
'^-version$|^-v$' { $Version = $true }
'^-auto$|^-a$' { $AutoMode = $true }
'^-beta$' { $Beta = $true }
'^-developer$' { $Developer = $true }
'^-debug$|^-d$' { $Debug = $true }
'^-skipverify$|^-s$' { $SkipVerification = $true }
'^-quiet$|^-q$' { $QuietMode = $true }
}
} else {
# Positional arguments are not supported
Clear-Host
Write-Host ""
Write-Host " Positional arguments are not allowed."
Write-Host " Use -help or -? to see available options."
Write-Host ""
exit 1
}
}
# If quiet mode is requested, relaunch with -auto and hidden window
if ($QuietMode) {
# Rebuild argument list without -quiet/-q, add -auto if not already present
$newArgs = @()
$hasAuto = $false
foreach ($arg in $rawArgs) {
if ($arg -match '^-quiet$|^-q$') {
# skip
} else {
$newArgs += $arg
if ($arg -match '^-auto$|^-a$') {
$hasAuto = $true
}
}
}
if (-not $hasAuto) {
$newArgs += '-auto'
}
$scriptPath = $MyInvocation.MyCommand.Path
$argString = ($newArgs -join ' ')
Start-Process -FilePath "powershell.exe" -ArgumentList "-WindowStyle Hidden -File `"$scriptPath`" $argString"
exit 0
}
# Set flags based on parsed arguments
[bool]$DebugMode = $Debug # $true = enabled, $false = disabled (default)
[bool]$SkipSelfHashVerification = $SkipVerification # $true = skip, $false = verify (default)
# =============================================
# SCRIPT VERSION
# =============================================
$ScriptVersion = "2026.07.0015"
# =============================================
# Detect if running from SFX package
$isSFX = $MyInvocation.ScriptName -like "$env:SystemRoot\Temp\universal-intel-chipset-device-updater*"
if ($ScriptVersion -match '^(\d+\.\d+)-(\d{4}\.\d{2}\.\d+)$') {
$DisplayVersion = "$($matches[1]) ($($matches[2]))"
} else {
$DisplayVersion = $ScriptVersion
}
# If help requested, show and exit
if ($Help) {
Get-Help $MyInvocation.MyCommand.Path
exit 0
}
# If version requested, show and exit
if ($Version) {
Clear-Host
Write-Host ""
Write-Host " Universal Intel Chipset Device Updater version $DisplayVersion"
Write-Host ""
exit 0
}
# =============================================
# AUTO-ELEVATE IF NOT ADMIN (with argument passing)
# =============================================
$currentPrincipal = New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent())
$isAdmin = $currentPrincipal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)
if (-not $isAdmin) {
Clear-Host
Write-Host ""
Write-Host " Administrator privileges required. Restarting with elevation..." -ForegroundColor Yellow
Write-Host ""
$scriptPath = $MyInvocation.MyCommand.Path
# Rebuild argument string from the original arguments
$argList = ""
if ($rawArgs.Count -gt 0) {
$argList = ($rawArgs -join " ")
}
try {
Start-Process -FilePath "powershell.exe" -ArgumentList "-NoExit -File `"$scriptPath`" $argList" -Verb RunAs
} catch {
Clear-Host
Write-Host ""
Write-Host " Elevation failed. Please run the script as Administrator manually." -ForegroundColor Red
Write-Host ""
pause
exit 1
}
exit 0
}
# =============================================
# ELEVATED CONTEXT
# =============================================
Write-Host "Running with administrator privileges. Applying console settings..." -ForegroundColor Green
$Host.UI.RawUI.BackgroundColor = "Black"
try {
[console]::WindowWidth = 75
[console]::WindowHeight = 58
[console]::BufferWidth = [console]::WindowWidth
} catch {
Write-Host "Failed to set console size: $_" -ForegroundColor Red
}
# =============================================
# CONFIGURATION
# =============================================
# $DebugMode and $SkipSelfHashVerification already set above
# =============================================
# GitHub repository URLs
$githubBaseUrl = "https://raw.githubusercontent.com/FirstEverTech/Universal-Intel-Chipset-Updater/main/data/"
$githubArchiveUrl = "https://github.com/FirstEverTech/Universal-Intel-Chipset-Updater/releases/download/archive/"
$chipsetINFsUrl = $githubBaseUrl + "intel-chipset-infs-latest.md"
if ($Developer) {
$chipsetINFsUrl = $githubBaseUrl + "intel-chipset-infs-dev.md"
Write-Host ""
Write-Host " [DEVELOPER MODE] Using development database: intel-chipset-infs-dev.md" -ForegroundColor Magenta
Write-Host " This database is intended for internal testing only." -ForegroundColor Magenta
Write-Host ""
} elseif ($Beta) {
$chipsetINFsUrl = $githubBaseUrl + "intel-chipset-infs-beta.md"
Write-Host ""
Write-Host " [BETA MODE] Using beta database: intel-chipset-infs-beta.md" -ForegroundColor Yellow
Write-Host " This database may contain support for new hardware not yet in stable release." -ForegroundColor Yellow
Write-Host ""
}
$downloadListUrl = $githubBaseUrl + "intel-chipset-infs-download.txt"
$supportMessageUrl = $githubBaseUrl + "intel-chipset-infs-message.txt"
$creditsMessageUrl = $githubBaseUrl + "intel-chipset-infs-credits.txt"
$adsUrl = $githubBaseUrl + "intel-chipset-infs-ads.txt"
# Temporary directory for downloads
$tempDir = Join-Path $env:SystemRoot "Temp\IntelChipset"
# =============================================
# ENHANCED ERROR HANDLING
# =============================================
$global:InstallationErrors = @()
$global:ScriptStartTime = Get-Date
$global:NewVersionLaunched = $false
$global:NewerWindowsInboxVersion = $false
$logFile = Join-Path $env:ProgramData "chipset_update.log"
# =============================================
# VERSION MANAGEMENT FUNCTIONS
# =============================================
function Get-VersionNumber {
param([string]$Version)
$oldVersionTable = @{
"10.1-2025.11.0" = "2025.11.0001"
"10.1-2025.11.5" = "2025.11.0002"
"10.1-2025.11.6" = "2025.11.0003"
"10.1-2025.11.7" = "2025.11.0004"
"10.1-2025.11.8" = "2025.11.0005"
"10.1-2026.02.1" = "2026.02.0006"
"10.1-2026.02.2" = "2026.02.0007"
}
if ($oldVersionTable.ContainsKey($Version)) {
$Version = $oldVersionTable[$Version]
}
if ($Version -match '^10\.1-(\d{4}\.\d{2}\.\d+)$') {
$Version = $matches[1]
}
if ($Version -match '^(\d{4})\.(\d{2})\.(\d+)$') {
return [int]$matches[3]
}
throw "Cannot parse version: $Version"
}
function Compare-Versions {
param([string]$Version1, [string]$Version2)
$ver1Num = Get-VersionNumber -Version $Version1
$ver2Num = Get-VersionNumber -Version $Version2
if ($ver1Num -eq $ver2Num) { return 0 }
if ($ver1Num -lt $ver2Num) { return -1 }
return 1
}
function Get-VersionForFileName {
param([string]$Version)
if ($Version -match '^10\.1-(\d{4}\.\d{2}\.\d+)$') {
return $matches[1]
}
return $Version
}
function Get-VersionForGitHubTag {
param([string]$Version)
# TODO: Both branches return $Version unchanged — if tag format ever
# differs from the version string (e.g. needs a "v" prefix or other
# transformation), implement the conversion logic here.
if ($Version -match '^10\.1-') {
return $Version
}
return $Version
}
# =============================================
# LOGGING FUNCTIONS
# =============================================
function Write-Log {
param([string]$Message, [string]$Type = "INFO")
$timestamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss"
$logEntry = "[$timestamp] [$Type] $Message"
try {
Add-Content -Path $logFile -Value $logEntry -ErrorAction SilentlyContinue
} catch {
# Silent fallback
}
if ($Type -eq "ERROR") {
$global:InstallationErrors += $Message
Write-Host " ERROR: $Message" -ForegroundColor Red
}
}
function Write-DebugMessage {
param([string]$Message, [string]$Color = "Gray")
Write-Log -Message $Message -Type "DEBUG"
if ($DebugMode) {
Write-Host " DEBUG: $Message" -ForegroundColor $Color
}
}
function Show-FinalSummary {
$duration = (Get-Date) - $global:ScriptStartTime
if ($global:InstallationErrors.Count -gt 0) {
Write-Host "`n Completed with $($global:InstallationErrors.Count) error(s)." -ForegroundColor Red
Write-Host " See $logFile for details." -ForegroundColor Red
} else {
Write-Host "`n Operation completed successfully." -ForegroundColor Green
}
Write-Log "Script execution completed in $([math]::Round($duration.TotalMinutes, 2)) minutes with $($global:InstallationErrors.Count) errors"
}
# =============================================
# COLOR LINE PARSING FUNCTION
# =============================================
function Write-ColorLine {
param([string]$Line)
# Get all valid console color names
$validColors = [Enum]::GetNames([ConsoleColor])
# Start with the console's current colors
$currentFg = $Host.UI.RawUI.ForegroundColor
$currentBg = $Host.UI.RawUI.BackgroundColor
$segments = @()
$position = 0
$length = $Line.Length
while ($position -lt $length) {
# Find next opening bracket '['
$openBracket = $Line.IndexOf('[', $position)
if ($openBracket -eq -1) {
# No more brackets – take the rest of the line as plain text
$text = $Line.Substring($position)
if ($text) {
$segments += [PSCustomObject]@{
Text = $text
Foreground = $currentFg
Background = $currentBg
}
}
break
}
# If there is text before the bracket, add it as a segment
if ($openBracket -gt $position) {
$text = $Line.Substring($position, $openBracket - $position)
$segments += [PSCustomObject]@{
Text = $text
Foreground = $currentFg
Background = $currentBg
}
}
# Find the closing bracket
$closeBracket = $Line.IndexOf(']', $openBracket)
if ($closeBracket -eq -1) {
# No closing bracket – treat everything from '[' as literal text
$text = $Line.Substring($openBracket)
$segments += [PSCustomObject]@{
Text = $text
Foreground = $currentFg
Background = $currentBg
}
break
}
# Extract the tag content (what's inside the brackets)
$tagContent = $Line.Substring($openBracket + 1, $closeBracket - $openBracket - 1)
# Check if the tag contains a comma – meaning a pair "Foreground,Background"
if ($tagContent -match ',') {
$colors = $tagContent -split ',' | ForEach-Object { $_.Trim() }
if ($colors.Count -eq 2 -and ($validColors -contains $colors[0]) -and ($validColors -contains $colors[1])) {
$currentFg = [ConsoleColor]$colors[0]
$currentBg = [ConsoleColor]$colors[1]
$position = $closeBracket + 1
continue
}
}
# If it's a single color name (foreground only)
if ($validColors -contains $tagContent) {
$currentFg = [ConsoleColor]$tagContent
$position = $closeBracket + 1
continue
}
# If it's not a recognized color, treat the brackets as literal text
$text = $Line.Substring($openBracket, $closeBracket - $openBracket + 1)
$segments += [PSCustomObject]@{
Text = $text
Foreground = $currentFg
Background = $currentBg
}
$position = $closeBracket + 1
}
# Output all segments on the same line
foreach ($seg in $segments) {
Write-Host $seg.Text -NoNewline -ForegroundColor $seg.Foreground -BackgroundColor $seg.Background
}
Write-Host ""
}
# =============================================
# PARSE KEY AND URL FROM CREDIT LINE
# =============================================
function Get-KeyAndUrlFromLine {
param([string]$Line)
# List of all valid color names (must match those used in Write-ColorLine)
$validColors = [Enum]::GetNames([ConsoleColor])
# Build a regex that matches any single color or a pair separated by comma
$colorPattern = '\[(?:' + (($validColors | ForEach-Object { [regex]::Escape($_) }) -join '|') + ')(?:,(?:' + (($validColors | ForEach-Object { [regex]::Escape($_) }) -join '|') + '))?\]'
# Remove only color tags from the line
$cleanLine = $Line -replace $colorPattern, ''
# Look for pattern "press [X]" (case-insensitive) to get the key
if ($cleanLine -match 'press \[([A-Za-z0-9])\]') {
$key = $matches[1]
# Find a URL pattern in the line (domain with at least one dot, optionally with path)
if ($cleanLine -match '(https?://)?([a-zA-Z0-9.-]+\.[a-zA-Z]{2,}(?:/[^\s]*)?)') {
$urlCandidate = $matches[0]
# If no protocol, add https://
if ($urlCandidate -notmatch '^https?://') {
$urlCandidate = "https://$urlCandidate"
}
return @{ Key = $key; Url = $urlCandidate }
}
}
return $null
}
# =============================================
# HEADER DISPLAY FUNCTION
# =============================================
function Show-Header {
Clear-Host
Write-Host "/*************************************************************************" -ForegroundColor Gray -BackgroundColor DarkBlue
Write-Host "**" -NoNewline -ForegroundColor Gray -BackgroundColor DarkBlue
Write-Host " UNIVERSAL INTEL CHIPSET DEVICE UPDATER " -NoNewline -ForegroundColor White -BackgroundColor DarkBlue
Write-Host "**" -ForegroundColor Gray -BackgroundColor DarkBlue
Write-Host "** --------------------------------------------------------------------- **" -ForegroundColor Gray -BackgroundColor DarkBlue
Write-Host "** **" -ForegroundColor Gray -BackgroundColor DarkBlue
$paddedVersion = $DisplayVersion.PadRight(14)
Write-Host "**" -NoNewline -ForegroundColor Gray -BackgroundColor DarkBlue
Write-Host " Tool Version: $paddedVersion " -NoNewline -ForegroundColor Yellow -BackgroundColor DarkBlue
Write-Host "**" -ForegroundColor Gray -BackgroundColor DarkBlue
Write-Host "** **" -ForegroundColor Gray -BackgroundColor DarkBlue
$authorText = " Author: Marcin Grygiel / GitHub.com/FirstEverTech "
$padding = [math]::Floor((69 - $authorText.Length) / 2)
$spaces = " " * [math]::Max(0, $padding)
Write-Host "**" -NoNewline -ForegroundColor Gray -BackgroundColor DarkBlue
Write-Host "$spaces$authorText$spaces" -NoNewline -ForegroundColor Green -BackgroundColor DarkBlue
# Adjust length – if the text does not reach the end, padding with spaces to 69 characters (internal width)
$totalLength = $spaces.Length + $authorText.Length + $spaces.Length
if ($totalLength -lt 69) {
Write-Host (" " * (69 - $totalLength)) -NoNewline -ForegroundColor Green -BackgroundColor DarkBlue
}
Write-Host "**" -ForegroundColor Gray -BackgroundColor DarkBlue
Write-Host "** **" -ForegroundColor Gray -BackgroundColor DarkBlue
Write-Host "**" -NoNewline -ForegroundColor Gray -BackgroundColor DarkBlue
Write-Host " This tool is not affiliated with Intel Corporation. " -NoNewline -ForegroundColor Gray -BackgroundColor DarkBlue
Write-Host "**" -ForegroundColor Gray -BackgroundColor DarkBlue
Write-Host "**" -NoNewline -ForegroundColor Gray -BackgroundColor DarkBlue
Write-Host " INF files are sourced from official Intel servers. " -NoNewline -ForegroundColor Gray -BackgroundColor DarkBlue
Write-Host "**" -ForegroundColor Gray -BackgroundColor DarkBlue
Write-Host "**" -NoNewline -ForegroundColor Gray -BackgroundColor DarkBlue
Write-Host " Use at your own risk. " -NoNewline -ForegroundColor Gray -BackgroundColor DarkBlue
Write-Host "**" -ForegroundColor Gray -BackgroundColor DarkBlue
Write-Host "** **" -ForegroundColor Gray -BackgroundColor DarkBlue
Write-Host "*************************************************************************/" -ForegroundColor Gray -BackgroundColor DarkBlue
Write-Host ""
}
# =============================================
# SCREEN MANAGEMENT FUNCTIONS
# =============================================
function Show-Screen1 {
Show-Header
Write-Host " [SCREEN 1/4] INITIALIZATION AND SECURITY CHECKS" -ForegroundColor Cyan
Write-Host " ===============================================" -ForegroundColor Cyan
if ($DebugMode) {
Write-Host " DEBUG MODE: ENABLED" -ForegroundColor Magenta
}
if ($SkipSelfHashVerification) {
Write-Host "`n SELF-HASH VERIFICATION: DISABLED (Testing Mode)" -ForegroundColor Yellow
}
Write-Host ""
Write-Host " Checking Windows system requirements..." -ForegroundColor Yellow
try {
$os = Get-CimInstance -ClassName Win32_OperatingSystem -ErrorAction Stop
$build = [int]$os.BuildNumber
if ($build -lt 17763) {
Write-Host " [WARNING] Windows 10 LTSB 2015/2016 detected." -ForegroundColor Red
Write-Host " TLS 1.2 may not work properly." -ForegroundColor Gray
Write-Host " Some features may be limited." -ForegroundColor Gray
} else {
Write-Host " Windows Build: $build" -ForegroundColor Gray
Write-Host " Operating system compatibility: PASSED" -ForegroundColor Green
}
} catch {
Write-Host " [INFO] Could not determine Windows build." -ForegroundColor Gray
}
Write-Host ""
Write-Host " Checking .NET Framework prerequisites..." -ForegroundColor Yellow
try {
$netRelease = Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full" -Name "Release" -ErrorAction Stop
if ($netRelease -ge 461808) {
Write-Host " .NET Framework 4.7.2 or newer detected: PASSED" -ForegroundColor Green
} else {
Write-Host " [WARNING] .NET Framework older than 4.7.2" -ForegroundColor Red
}
} catch {
Write-Host " [WARNING] .NET Framework 4.7.2+ not found or couldn't be checked" -ForegroundColor Red
Write-Host " This may affect GitHub connectivity." -ForegroundColor Gray
}
Write-Host ""
Write-Host " Testing GitHub connectivity..." -ForegroundColor Yellow
try {
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$null = Invoke-WebRequest -Uri "https://raw.githubusercontent.com" -UseBasicParsing -TimeoutSec 5 -ErrorAction Stop
Write-Host " Repository access verification: PASSED" -ForegroundColor Green
} catch {
Write-Host " [WARNING] Cannot reach GitHub servers" -ForegroundColor Red
Write-Host " Self-hash verification will be skipped." -ForegroundColor Gray
Write-Host " You can still use offline INF detection." -ForegroundColor Gray
}
Write-Host ""
Write-Host " Pre-check summary..." -ForegroundColor Yellow
$continue = $true
if ($build -lt 17763 -or !$netRelease -or $netRelease -lt 461808) {
Write-Host " [IMPORTANT] Some issues were detected." -ForegroundColor Yellow
Write-Host ""
Write-Host " If you experience problems:" -ForegroundColor Gray
Write-Host " 1. For LTSB/LTSC users: Install .NET Framework 4.8" -ForegroundColor Gray
Write-Host " 2. For GitHub issues: Check firewall/proxy settings" -ForegroundColor Gray
Write-Host ""
if ($AutoMode) {
$choice = "Y"
Write-Host " Auto mode: automatically continuing (Y)." -ForegroundColor Cyan
} else {
do {
$choice = Read-Host " Continue despite warnings? (Y/N)"
$choice = $choice.Trim().ToUpper()
if ($choice -ne 'Y' -and $choice -ne 'N') {
Write-Host " Invalid input. Please enter Y or N." -ForegroundColor Red
}
} while ($choice -ne 'Y' -and $choice -ne 'N')
}
if ($choice -eq 'N') {
Write-Host " Operation cancelled." -ForegroundColor Red
if (-not $AutoMode) {
Write-Host " Press any key to exit..."
$null = $Host.UI.RawUI.ReadKey('NoEcho,IncludeKeyDown')
}
exit 0
}
Write-Host " Continuing with limited functionality..." -ForegroundColor Yellow
Write-Host ""
} else {
Write-Host " All system requirements verified successfully." -ForegroundColor Green
}
}
function Show-Screen2 {
Show-Header
Write-Host " [SCREEN 2/4] HARDWARE DETECTION AND VERSION ANALYSIS" -ForegroundColor Cyan
Write-Host " ====================================================" -ForegroundColor Cyan
Write-Host ""
}
function Show-Screen3 {
Show-Header
Write-Host " [SCREEN 3/4] UPDATE CONFIRMATION AND SYSTEM PREPARATION" -ForegroundColor Cyan
Write-Host " =======================================================" -ForegroundColor Cyan
Write-Host ""
Write-Host " IMPORTANT NOTICE:" -ForegroundColor Yellow
Write-Host " The INF files update process may take several minutes to complete." -ForegroundColor Yellow
Write-Host " During installation, the screen may temporarily go black and some" -ForegroundColor Yellow
Write-Host " devices may temporarily disconnect as PCIe bus INF files are being" -ForegroundColor Yellow
Write-Host " updated. This is normal behavior and the system will return to" -ForegroundColor Yellow
Write-Host " normal operation once the installation is complete." -ForegroundColor Yellow
Write-Host ""
if ($AutoMode) {
$response = "Y"
Write-Host " Auto mode: automatically proceeding (Y)." -ForegroundColor Cyan
} else {
$response = Read-Host " Do you want to proceed with INF files update? (Y/N)"
}
return $response
}
function Show-Screen4 {
Show-Header
Write-Host " [SCREEN 4/4] DOWNLOAD AND INSTALLATION PROGRESS" -ForegroundColor Cyan
Write-Host " ===============================================" -ForegroundColor Cyan
Write-Host ""
}
# =============================================
# SELF-HASH VERIFICATION FUNCTION
# =============================================
function Verify-ScriptHash {
if ($SkipSelfHashVerification) {
Write-Host " SKIPPED: Self-hash verification disabled (Testing Mode)." -ForegroundColor Yellow
Write-Host ""
return $true
}
try {
Write-Host " Verifying Updater source file integrity..." -ForegroundColor Yellow
$scriptPath = $null
if ($PSCommandPath) {
$scriptPath = $PSCommandPath
} elseif ($MyInvocation.MyCommand.Path) {
$scriptPath = $MyInvocation.MyCommand.Path
} else {
$potentialPath = Join-Path (Get-Location) "universal-intel-chipset-device-updater.ps1"
if (Test-Path $potentialPath) {
$scriptPath = $potentialPath
}
}
if (-not $scriptPath -or -not (Test-Path $scriptPath)) {
Write-Host " FAIL: Cannot locate script file for hash verification." -ForegroundColor Red
return $false
}
Write-DebugMessage "Script path: $scriptPath"
$currentHash = $null
$retryCount = 0
$maxRetries = 3
while ($retryCount -lt $maxRetries -and -not $currentHash) {
try {
$hashResult = Get-FileHash -Path $scriptPath -Algorithm SHA256
$currentHash = $hashResult.Hash.ToUpper()
Write-DebugMessage "Successfully calculated script hash (attempt $($retryCount + 1)): $currentHash"
} catch {
$retryCount++
if ($retryCount -eq $maxRetries) {
Write-Host " FAIL: Could not calculate script hash after $maxRetries attempts." -ForegroundColor Red
Write-Host " Error: $($_.Exception.Message)" -ForegroundColor Red
return $false
}
Start-Sleep -Milliseconds 500
}
}
if (-not $currentHash) {
Write-Host " FAIL: Could not calculate script hash." -ForegroundColor Red
return $false
}
$hashVersion = Get-VersionForFileName -Version $ScriptVersion
$hashFileUrl = "https://github.com/FirstEverTech/Universal-Intel-Chipset-Updater/releases/download/v$hashVersion/universal-intel-chipset-device-updater-$hashVersion-ps1.sha256"
Write-DebugMessage "Downloading hash from: $hashFileUrl"
try {
$expectedHashResponse = Invoke-WebRequest -Uri $hashFileUrl -UseBasicParsing -ErrorAction Stop
$expectedHashLine = ""
if ($expectedHashResponse.Content -is [byte[]]) {
$expectedHashLine = [System.Text.Encoding]::UTF8.GetString($expectedHashResponse.Content).Trim()
} else {
$expectedHashLine = $expectedHashResponse.Content.ToString().Trim()
}
Write-DebugMessage "Raw hash file content: '$expectedHashLine'"
$expectedHash = $null
$expectedFileName = $null
if ($expectedHashLine -match '^([A-Fa-f0-9]{64})\s+(\S+)$') {
$expectedHash = $matches[1].ToUpper()
$expectedFileName = $matches[2]
Write-DebugMessage "Parsed format: HASH FILENAME"
} elseif ($expectedHashLine -match '^([A-Fa-f0-9]{64})$') {
$expectedHash = $expectedHashLine.ToUpper()
$expectedFileName = "universal-intel-chipset-device-updater.ps1"
Write-DebugMessage "Parsed format: HASH only"
} elseif ($expectedHashLine -match '^([A-Fa-f0-9]{64})\s*\*?\s*(\S+)$') {
$expectedHash = $matches[1].ToUpper()
$expectedFileName = $matches[2]
Write-DebugMessage "Parsed format: HASH * FILENAME"
}
if (-not $expectedHash) {
Write-Host " FAIL: Could not parse hash from file. Content: $expectedHashLine" -ForegroundColor Red
return $false
}
Write-DebugMessage "Expected hash: $expectedHash"
Write-DebugMessage "Current hash: $currentHash"
Write-DebugMessage "Expected file: $expectedFileName"
if ($currentHash -eq $expectedHash) {
Write-Host " Updater hash verification: PASSED" -ForegroundColor Green
Write-Host ""
Write-DebugMessage "Hash verification successful"
return $true
} else {
Write-Host " FAIL: Updater hash verification failed. Hash doesn't match." -ForegroundColor Red
Write-Host "`n WARNING: The updater file may have been modified or corrupted!" -ForegroundColor Red
Write-Host " Please download the Updater from the official source:" -ForegroundColor Red
Write-Host " https://github.com/FirstEverTech/Universal-Intel-Chipset-Updater/releases" -ForegroundColor Cyan
Write-Host ""
Write-Host " Hash verification failed: $($expectedFileName)" -ForegroundColor Yellow
Write-Host " Source: $expectedHash" -ForegroundColor Green
Write-Host " Actual: $currentHash" -ForegroundColor Red
return $false
}
} catch {
Write-Host " ERROR: Could not download or parse hash file." -ForegroundColor Red
Write-Host " Please download the Updater from the official source and try again:" -ForegroundColor Red
Write-Host " https://github.com/FirstEverTech/Universal-Intel-Chipset-Updater/releases" -ForegroundColor Red
Write-Host ""
Write-Host " Hash verification failed: universal-intel-chipset-device-updater.ps1" -ForegroundColor Yellow
Write-Host " Source: I can't read the source HASH from the GitHub repository." -ForegroundColor Red
Write-Host " Actual: $currentHash" -ForegroundColor Red
Write-Host ""
return $false
}
} catch {
Write-Host " ERROR: Could not verify script hash." -ForegroundColor Red
Write-Host " Error: $($_.Exception.Message)" -ForegroundColor Red
Write-Host "`n Please download the Updater from the official source and try again:" -ForegroundColor Red
Write-Host " https://github.com/FirstEverTech/Universal-Intel-Chipset-Updater/releases" -ForegroundColor Red
return $false
}
}
# =============================================
# UPDATE CHECK FUNCTION
# =============================================
function Get-DownloadsFolder {
try {
$registryPath = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders"
$downloadsGuid = "{374DE290-123F-4565-9164-39C4925E467B}"
if (Test-Path $registryPath) {
$downloadsValue = Get-ItemProperty -Path $registryPath -Name $downloadsGuid -ErrorAction SilentlyContinue
if ($downloadsValue -and $downloadsValue.$downloadsGuid) {
$downloadsPath = [Environment]::ExpandEnvironmentVariables($downloadsValue.$downloadsGuid)
Write-DebugMessage "Found Downloads folder in registry: $downloadsPath"
return $downloadsPath
}
}
$defaultDownloads = [Environment]::GetFolderPath("UserProfile") + "\Downloads"
Write-DebugMessage "Using default Downloads folder: $defaultDownloads"
return $defaultDownloads
} catch {
Write-DebugMessage "Error getting Downloads folder: $($_.Exception.Message)"
return [Environment]::GetFolderPath("UserProfile") + "\Downloads"
}
}
function Check-ForUpdaterUpdates {
try {
Write-Host " Checking for newer updater version..." -ForegroundColor Yellow
$versionFileUrl = "https://raw.githubusercontent.com/FirstEverTech/Universal-Intel-Chipset-Updater/main/src/universal-intel-chipset-device-updater.ver"
$latestVersionContent = Invoke-WebRequest -Uri $versionFileUrl -UseBasicParsing -ErrorAction Stop
$latestVersion = $latestVersionContent.Content.Trim()
$comparisonResult = Compare-Versions -Version1 $ScriptVersion -Version2 $latestVersion
Write-DebugMessage "Current version: $ScriptVersion"
Write-DebugMessage "Latest version: $latestVersion"
Write-DebugMessage "Comparison result: $comparisonResult"
if ($comparisonResult -eq 0) {
Write-Host " Status: Already on latest version." -ForegroundColor Green
Write-Host ""
Write-Host " Starting hardware detection..." -ForegroundColor Gray
Write-Host ""
Start-Sleep -Seconds 3
return $true
} elseif ($comparisonResult -lt 0) {
Write-Host " A new version $latestVersion is available (current: $ScriptVersion)." -ForegroundColor Yellow
# Check if running from PSGallery installation
$psGalleryPath = Join-Path $env:ProgramFiles "WindowsPowerShell\Scripts"
$isPSGallery = $MyInvocation.ScriptName -like "$psGalleryPath*"
if ($isPSGallery) {
Write-Host ""
Write-Host " Detected PowerShell Gallery installation." -ForegroundColor Cyan
Write-Host " Updating via Update-Script..." -ForegroundColor Yellow
Write-Host ""
try {
Update-Script universal-intel-chipset-device-updater -Force -ErrorAction Stop
Write-Host " SUCCESS: Script updated successfully." -ForegroundColor Green
Write-Host " Please run the script again to use the new version." -ForegroundColor Yellow
Write-Host ""
Cleanup
if (-not $isSFX) { Clear-Host; Write-Host "`n Thank you for using Universal Intel Chipset Device Updater!`n" -ForegroundColor Cyan }
exit 0
} catch {
Write-Host " ERROR: Failed to update via PSGallery - $($_.Exception.Message)" -ForegroundColor Red
Write-Host " Please update manually: Update-Script universal-intel-chipset-device-updater" -ForegroundColor Yellow
Write-Host ""
# Fall through to normal update flow
}
}
if ($AutoMode) {
$continueChoice = "Y"
Write-Host " Auto mode: automatically continuing with current version (Y)." -ForegroundColor Cyan
} else {
do {
Write-Host ""
$continueChoice = Read-Host " Do you want to continue with the current version? (Y/N)"
$continueChoice = $continueChoice.Trim().ToUpper()
if ($continueChoice -ne 'Y' -and $continueChoice -ne 'N') {
Write-Host " Invalid input. Please enter Y or N." -ForegroundColor Red
}
} while ($continueChoice -ne 'Y' -and $continueChoice -ne 'N')
}
if ($continueChoice -eq 'Y') {
return $true
} else {
# User chose not to continue with current version
if ($AutoMode) {
$downloadChoice = "N"
Write-Host " Auto mode: automatically not downloading new version (N)." -ForegroundColor Cyan
} else {
do {
$downloadChoice = Read-Host " Do you want to download the latest version? (Y/N)"
$downloadChoice = $downloadChoice.Trim().ToUpper()
if ($downloadChoice -ne 'Y' -and $downloadChoice -ne 'N') {
Write-Host " Invalid input. Please enter Y or N." -ForegroundColor Red
}
} while ($downloadChoice -ne 'Y' -and $downloadChoice -ne 'N')
}
if ($downloadChoice -eq 'Y') {
$tagVersion = Get-VersionForGitHubTag -Version $latestVersion
$fileVersion = Get-VersionForFileName -Version $latestVersion
$downloadUrl = "https://github.com/FirstEverTech/Universal-Intel-Chipset-Updater/releases/download/v$tagVersion/ChipsetUpdater-$fileVersion-Win10-Win11.exe"
$downloadsFolder = Get-DownloadsFolder
$outputPath = Join-Path $downloadsFolder "ChipsetUpdater-$fileVersion-Win10-Win11.exe"
Write-Host " Downloading new version to:" -ForegroundColor Yellow
Write-Host " $outputPath" -ForegroundColor Yellow
Write-Host ""
$maxRetries = 3
$retryCount = 0
$downloadSuccess = $false