Repository navigation
Expand file tree
/
Copy pathInstallerEngine.cs
More file actions
2657 lines (2418 loc) · 165 KB
/
Copy pathInstallerEngine.cs
File metadata and controls
2657 lines (2418 loc) · 165 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
using System.Diagnostics;
using System.IO.Compression;
using System.Management;
using Microsoft.Win32;
namespace GamingStackGUI
{
public enum AppKind { Winget, Manual, Bundle, Link }
/// <summary>
/// Which hardware an entry is for. An NVIDIA graphics card doesn't need AMD's graphics software and vice
/// versa (and an AMD processor is a separate question from the graphics card), so the wizard asks which
/// graphics card and processor you have and hides entries for the others. Any = shown for everyone.
/// IntelAny = shown if you have Intel graphics OR an Intel processor.
/// </summary>
public enum HardwareTag { Any, NvidiaGpu, AmdGpu, IntelGpu, AmdCpu, IntelCpu, IntelAny }
/// <summary>
/// Which kind of PC is being set up - picked on the first wizard screen. It decides
/// which catalog entries are offered (<see cref="AppEntry.Profiles"/>) and which
/// tweaks are shown for consent (gaming-only tweaks like HAGS, core parking and
/// mouse acceleration are never offered on an Office or Developer PC).
/// Flags so one catalog entry can belong to several profiles.
/// </summary>
[Flags]
public enum SetupProfile
{
None = 0,
Gaming = 1,
Office = 2,
Developer = 4,
All = Gaming | Office | Developer
}
public static class SetupProfileInfo
{
public static string Title(SetupProfile p) => p switch
{
SetupProfile.Office => "Office computer",
SetupProfile.Developer => "Developer / home lab",
_ => "Gaming / streaming PC"
};
}
/// <summary>
/// One installable thing, with a human-friendly name for display in the wizard
/// (the winget ID / manual URL are what actually gets run, kept separate so the
/// UI never has to show raw package IDs to the user). <see cref="Category"/> is
/// purely for grouping the wizard's on-screen list under a heading - it plays no
/// part in install order or logic.
/// </summary>
public class AppEntry
{
public required string FriendlyName { get; init; }
public required string Category { get; init; }
public required AppKind Kind { get; init; }
public string? WingetId { get; init; }
public string? ManualFileName { get; init; }
public string? ManualUrl { get; init; }
// The vendor's own download page. Link entries (no winget package, no stable direct
// download) just open this in your default browser; for Manual entries it is the
// fallback if the automatic download fails. Always https.
public string? PageUrl { get; init; }
// Bundle kind only: a handful of winget IDs installed back-to-back under one
// catalog entry (e.g. every VC++ Redistributable version), so the wizard shows
// a single friendly line instead of a dozen near-identical ones.
public string[]? BundleWingetIds { get; init; }
// Which setup profiles offer this entry. Defaults to Gaming only, so an entry
// that doesn't say otherwise never shows up on an Office/Developer PC.
public SetupProfile Profiles { get; init; } = SetupProfile.Gaming;
// Only offered when the user says they have this maker's hardware (see HardwareTag).
public HardwareTag Hardware { get; init; } = HardwareTag.Any;
// Lighting programs only (RGB & Peripheral Control). "lighting-universal" (OpenRGB, SignalRGB) take over
// EVERY device, so ticking one unticks all other lighting programs and vice versa. "lighting-brand"
// (iCUE, Hyte Nexus, L-Connect...) each control their own maker's hardware: you may tick several
// for different devices you own (a Hyte case with Lian Li fans), with a warning that two apps
// controlling the SAME device will fight.
public string? ExclusiveGroup { get; init; }
// One short plain-words line shown under the entry while it is highlighted on a section page.
public string? Note { get; init; }
}
/// <summary>
/// What happened to one catalog entry, once. Fired via
/// <see cref="InstallerEngine.OnItemResult"/> alongside the free-text log so the
/// UI can build a structured end-of-run summary (grouped by category, like the
/// wizard's own list) instead of parsing human-readable log lines.
/// </summary>
public enum InstallResultKind { Installed, Failed, Skipped, Opened }
public readonly record struct ItemResult(AppEntry Entry, InstallResultKind Kind, string? Detail = null);
/// <summary>
/// Which public DNS provider the optional "DNS servers" tweak should switch to.
/// Skip means "leave my DNS exactly as it is" and is the safe default, so a bug
/// in wiring the ChooseDns screen in can never silently change anyone's DNS.
/// </summary>
public enum DnsChoice { Skip, Cloudflare, Google, Quad9 }
/// <summary>
/// Everything the user chose on the wizard's tweak-related screens, bundled so
/// PreviewTweaks / ApplyTweaks / RunAsync all see the exact same answers.
/// <see cref="DebloatIds"/> holds <see cref="DebloatItem.Id"/>s the user ticked
/// on the debloat screen - empty means nothing gets removed.
/// </summary>
/// <summary>
/// What the wizard knew about this run, written to the top of the log so the file on
/// its own explains exactly what the user agreed to.
/// </summary>
public sealed record RunContext(string ProfileTitle, string BackupSummary);
public sealed record TweakOptions(
InstallerEngine.PowerPlanChoice PowerPlan,
DnsChoice Dns,
IReadOnlyCollection<string> DebloatIds,
SetupProfile Profile = SetupProfile.Gaming,
IReadOnlyCollection<string>? CleanupIds = null,
// Names (as shown on the tweak screen) of tweaks the user switched OFF. Empty = all on.
IReadOnlyCollection<string>? DisabledTweaks = null,
// Where to move the Windows "Captures" folder (Game Bar clips) and, optionally, Screenshots. Null = leave alone.
string? CapturesPath = null);
/// <summary>
/// One preinstalled app the opt-in debloat screen can offer to remove.
/// <see cref="PackageId"/> is the package family ID winget lists/uninstalls it
/// by; <see cref="StoreProductId"/> is the Microsoft Store listing used in the
/// revert script so the app can be put back.
/// </summary>
public sealed record DebloatItem(string Id, string Name, string Why, string PackageId, string StoreProductId);
/// <summary>
/// The actual install stack, ported directly from the earlier PowerShell version -
/// same behavior (retries, manual-installer fallback chain, tweaks), just written
/// as C# so it runs in-process instead of shelling out to a script.
/// Fires <see cref="OnLog"/> for every line so the UI can print it into the
/// terminal window without this class knowing anything about WinForms, and takes
/// the list of what to actually install as a parameter to <see cref="RunAsync"/> -
/// the wizard in MainForm decides that, this class just does the work.
/// </summary>
public class InstallerEngine
{
public event Action<string>? OnLog;
public event Action? OnFinished;
// Fired once per selected catalog entry, after that entry's own install
// attempt(s) finish - the summary screen builds off these, not the log text.
public event Action<ItemResult>? OnItemResult;
private static readonly HttpClient Http = CreateHttp();
private static HttpClient CreateHttp()
{
// Default timeout is 100s with no sign of life; a stalled download should
// fail clearly rather than hang the whole run. Some hosts also refuse
// requests that have no User-Agent.
var client = new HttpClient { Timeout = TimeSpan.FromMinutes(10) };
client.DefaultRequestHeaders.UserAgent.ParseAdd($"GamingStack/{typeof(InstallerEngine).Assembly.GetName().Version?.ToString(3) ?? "1"} (+Windows setup helper)");
return client;
}
// The full catalog, for every profile. Each entry says which profiles offer it
// (Profiles - defaults to Gaming only); the wizard shows CatalogFor(profile),
// grouped under one heading per Category in the order categories first appear
// here. Friendly names are what the user sees, everything else is what runs.
//
// Every winget ID below has been checked against a live `winget show` listing
// (the 1.1.0 additions on 2026-11-13). Vendor-published apps (RGB/peripheral
// control especially) change package IDs more than most, so if one starts
// failing every time, re-check it first with `winget search`.
private const SetupProfile Gm = SetupProfile.Gaming;
private const SetupProfile Of = SetupProfile.Office;
private const SetupProfile Dv = SetupProfile.Developer;
private const SetupProfile Everyone = SetupProfile.All;
public static readonly IReadOnlyList<AppEntry> Catalog = new List<AppEntry>
{
// ---- Browsers (every profile) ----
new() { FriendlyName = "Firefox", Category = "Web Browsers", Kind = AppKind.Winget, WingetId = "Mozilla.Firefox", Profiles = Everyone },
new() { FriendlyName = "Google Chrome", Category = "Web Browsers", Kind = AppKind.Winget, WingetId = "Google.Chrome", Profiles = Everyone },
new() { FriendlyName = "Brave (privacy-focused browser)", Category = "Web Browsers", Kind = AppKind.Winget, WingetId = "Brave.Brave", Profiles = Everyone },
// ---- Game launchers ----
new() { FriendlyName = "Steam", Category = "Game Launchers", Kind = AppKind.Winget, WingetId = "Valve.Steam" },
new() { FriendlyName = "Epic Games Launcher", Category = "Game Launchers", Kind = AppKind.Winget, WingetId = "EpicGames.EpicGamesLauncher" },
new() { FriendlyName = "Ubisoft Connect", Category = "Game Launchers", Kind = AppKind.Winget, WingetId = "Ubisoft.Connect" },
new() { FriendlyName = "EA app", Category = "Game Launchers", Kind = AppKind.Winget, WingetId = "ElectronicArts.EADesktop" },
new() { FriendlyName = "GOG Galaxy", Category = "Game Launchers", Kind = AppKind.Winget, WingetId = "GOG.Galaxy" },
new() { FriendlyName = "Battle.net", Category = "Game Launchers", Kind = AppKind.Winget, WingetId = "Blizzard.BattleNet" },
new() { FriendlyName = "Amazon Games", Category = "Game Launchers", Kind = AppKind.Winget, WingetId = "Amazon.Games" },
new() { FriendlyName = "Rockstar Games Launcher", Category = "Game Launchers", Kind = AppKind.Winget, WingetId = "RockstarGames.Launcher" },
new() { FriendlyName = "itch.io app", Category = "Game Launchers", Kind = AppKind.Winget, WingetId = "ItchIo.Itch" },
new() { FriendlyName = "Heroic (Epic/GOG/Amazon in one)", Category = "Game Launchers", Kind = AppKind.Winget, WingetId = "HeroicGamesLauncher.HeroicGamesLauncher" },
// Microsoft Store listing ID (not a community winget ID) - same trick as ChatGPT below.
new() { FriendlyName = "Xbox app (Game Pass)", Category = "Game Launchers", Kind = AppKind.Winget, WingetId = "9MV0B5HZVK9Z" },
new() { FriendlyName = "Playnite (unifies the above)", Category = "Game Launchers", Kind = AppKind.Winget, WingetId = "Playnite.Playnite" },
new() { FriendlyName = "NVIDIA GeForce NOW (cloud gaming)", Category = "Game Launchers", Kind = AppKind.Winget, WingetId = "Nvidia.GeForceNow", Profiles = Gm, Hardware = HardwareTag.NvidiaGpu },
// ---- Chat & meetings ----
new() { FriendlyName = "Discord", Category = "Chat & Meetings", Kind = AppKind.Winget, WingetId = "Discord.Discord", Profiles = Gm | Dv },
new() { FriendlyName = "Microsoft Teams", Category = "Chat & Meetings", Kind = AppKind.Winget, WingetId = "Microsoft.Teams", Profiles = Of },
new() { FriendlyName = "Zoom", Category = "Chat & Meetings", Kind = AppKind.Winget, WingetId = "Zoom.Zoom", Profiles = Of },
new() { FriendlyName = "Slack", Category = "Chat & Meetings", Kind = AppKind.Winget, WingetId = "SlackTechnologies.Slack", Profiles = Of | Dv },
new() { FriendlyName = "TeamSpeak (voice chat)", Category = "Chat & Meetings", Kind = AppKind.Winget, WingetId = "TeamSpeakSystems.TeamSpeakClient", Profiles = Gm },
new() { FriendlyName = "Mumble (voice chat)", Category = "Chat & Meetings", Kind = AppKind.Winget, WingetId = "Mumble.Mumble.Client", Profiles = Gm },
new() { FriendlyName = "Signal (private messaging)", Category = "Chat & Meetings", Kind = AppKind.Winget, WingetId = "OpenWhisperSystems.Signal", Profiles = Of },
new() { FriendlyName = "Telegram", Category = "Chat & Meetings", Kind = AppKind.Winget, WingetId = "Telegram.TelegramDesktop", Profiles = Of },
// ---- Office & documents ----
new() { FriendlyName = "Microsoft 365 Apps", Category = "Office & Documents", Kind = AppKind.Winget, WingetId = "Microsoft.Office", Profiles = Gm | Of },
new() { FriendlyName = "LibreOffice (free alternative)", Category = "Office & Documents", Kind = AppKind.Winget, WingetId = "TheDocumentFoundation.LibreOffice", Profiles = Of },
new() { FriendlyName = "Adobe Acrobat Reader (PDFs)", Category = "Office & Documents", Kind = AppKind.Winget, WingetId = "Adobe.Acrobat.Reader.64-bit", Profiles = Of },
new() { FriendlyName = "Thunderbird (email)", Category = "Office & Documents", Kind = AppKind.Winget, WingetId = "Mozilla.Thunderbird", Profiles = Of },
new() { FriendlyName = "Notepad++", Category = "Office & Documents", Kind = AppKind.Winget, WingetId = "Notepad++.Notepad++", Profiles = Of | Dv },
new() { FriendlyName = "Obsidian (notes)", Category = "Office & Documents", Kind = AppKind.Winget, WingetId = "Obsidian.Obsidian", Profiles = Of | Dv },
new() { FriendlyName = "Google Drive", Category = "Office & Documents", Kind = AppKind.Winget, WingetId = "Google.GoogleDrive", Profiles = Of },
new() { FriendlyName = "Foxit PDF Reader", Category = "Office & Documents", Kind = AppKind.Winget, WingetId = "Foxit.FoxitReader", Profiles = Of },
new() { FriendlyName = "ONLYOFFICE Desktop Editors (free Office-style suite)", Category = "Office & Documents", Kind = AppKind.Winget, WingetId = "ONLYOFFICE.DesktopEditors", Profiles = Of },
new() { FriendlyName = "Greenshot (quick screenshots with markup)", Category = "Office & Documents", Kind = AppKind.Winget, WingetId = "Greenshot.Greenshot", Profiles = Of },
new() { FriendlyName = "KeePassXC (offline password manager)", Category = "Office & Documents", Kind = AppKind.Winget, WingetId = "KeePassXCTeam.KeePassXC", Profiles = Of | Dv },
new() { FriendlyName = "Joplin (notes that sync anywhere)", Category = "Office & Documents", Kind = AppKind.Winget, WingetId = "Joplin.Joplin", Profiles = Of | Dv },
new() { FriendlyName = "PDFgear (free PDF editor)", Category = "Office & Documents", Kind = AppKind.Winget, WingetId = "PDFgear.PDFgear", Profiles = Of },
new() { FriendlyName = "SumatraPDF (fast, light PDF reader)", Category = "Office & Documents", Kind = AppKind.Winget, WingetId = "SumatraPDF.SumatraPDF", Profiles = Of },
new() { FriendlyName = "Notion (notes + docs)", Category = "Office & Documents", Kind = AppKind.Winget, WingetId = "Notion.Notion", Profiles = Of },
new() { FriendlyName = "calibre (e-books)", Category = "Office & Documents", Kind = AppKind.Winget, WingetId = "calibre.calibre", Profiles = Of },
new() { FriendlyName = "Dropbox", Category = "Cloud & Sync", Kind = AppKind.Winget, WingetId = "Dropbox.Dropbox", Profiles = Of },
new() { FriendlyName = "Nextcloud Desktop", Category = "Cloud & Sync", Kind = AppKind.Winget, WingetId = "Nextcloud.NextcloudDesktop", Profiles = Of | Dv },
// ---- GPU / drivers / monitoring / performance ----
new() { FriendlyName = "NVIDIA App (drivers, game settings, recording - opens page)", Category = "Monitoring & Performance", Kind = AppKind.Link, PageUrl = "https://www.nvidia.com/en-us/software/nvidia-app/", Hardware = HardwareTag.NvidiaGpu },
new() { FriendlyName = "NVIDIA Profile Inspector (advanced driver settings)", Category = "Monitoring & Performance", Kind = AppKind.Winget, WingetId = "Orbmu2k.nvidiaProfileInspector", Profiles = Gm, Hardware = HardwareTag.NvidiaGpu },
new() { FriendlyName = "NVCleanstall (choose which parts of an NVIDIA driver to install)", Category = "Monitoring & Performance", Kind = AppKind.Winget, WingetId = "TechPowerUp.NVCleanstall", Profiles = Gm, Hardware = HardwareTag.NvidiaGpu },
new() { FriendlyName = "NVIDIA Broadcast (AI mic noise removal + camera effects, opens page)", Category = "Monitoring & Performance", Kind = AppKind.Link, PageUrl = "https://www.nvidia.com/en-us/geforce/broadcasting/broadcast-app/", Profiles = Gm, Hardware = HardwareTag.NvidiaGpu },
new() { FriendlyName = "Display Driver Uninstaller (clean GPU driver swaps)", Category = "Monitoring & Performance", Kind = AppKind.Winget, WingetId = "Wagnardsoft.DisplayDriverUninstaller" },
new() { FriendlyName = "HWiNFO", Category = "Monitoring & Performance", Kind = AppKind.Winget, WingetId = "REALiX.HWiNFO" },
new() { FriendlyName = "CPU-Z", Category = "Monitoring & Performance", Kind = AppKind.Winget, WingetId = "CPUID.CPU-Z" },
new() { FriendlyName = "GPU-Z", Category = "Monitoring & Performance", Kind = AppKind.Winget, WingetId = "TechPowerUp.GPU-Z" },
new() { FriendlyName = "Speccy", Category = "Monitoring & Performance", Kind = AppKind.Winget, WingetId = "Piriform.Speccy" },
new() { FriendlyName = "CrystalDiskInfo", Category = "Monitoring & Performance", Kind = AppKind.Winget, WingetId = "CrystalDewWorld.CrystalDiskInfo" },
new() { FriendlyName = "MSI Afterburner (GPU overclock + FPS overlay)", Category = "Monitoring & Performance", Kind = AppKind.Winget, WingetId = "Guru3D.Afterburner" },
new() { FriendlyName = "CapFrameX (FPS capture + analysis)", Category = "Monitoring & Performance", Kind = AppKind.Winget, WingetId = "CXWorld.CapFrameX" },
new() { FriendlyName = "OCCT (stress test + stability)", Category = "Monitoring & Performance", Kind = AppKind.Winget, WingetId = "OCBase.OCCT.Personal" },
new() { FriendlyName = "FanControl (custom fan curves)", Category = "Monitoring & Performance", Kind = AppKind.Winget, WingetId = "Rem0o.FanControl" },
new() { FriendlyName = "Process Lasso", Category = "Monitoring & Performance", Kind = AppKind.Winget, WingetId = "BitSum.ProcessLasso" },
new() { FriendlyName = "LibreHardwareMonitor (open-source sensors)", Category = "Monitoring & Performance", Kind = AppKind.Winget, WingetId = "LibreHardwareMonitor.LibreHardwareMonitor", Profiles = Gm },
new() { FriendlyName = "RivaTuner Statistics Server (FPS overlay engine)", Category = "Monitoring & Performance", Kind = AppKind.Winget, WingetId = "Guru3D.RTSS", Profiles = Gm },
new() { FriendlyName = "CrystalDiskMark (drive speed test)", Category = "Monitoring & Performance", Kind = AppKind.Winget, WingetId = "CrystalDewWorld.CrystalDiskMark", Profiles = Gm },
new() { FriendlyName = "FurMark (GPU stress test)", Category = "Monitoring & Performance", Kind = AppKind.Winget, WingetId = "Geeks3D.FurMark.2", Profiles = Gm },
new() { FriendlyName = "HWMonitor (temperatures and voltages)", Category = "Monitoring & Performance", Kind = AppKind.Winget, WingetId = "CPUID.HWMonitor", Profiles = Gm },
new() { FriendlyName = "Core Temp (CPU temperature)", Category = "Monitoring & Performance", Kind = AppKind.Winget, WingetId = "ALCPU.CoreTemp", Profiles = Gm },
new() { FriendlyName = "ThrottleStop (Intel CPU throttling control)", Category = "Monitoring & Performance", Kind = AppKind.Winget, WingetId = "TechPowerUp.ThrottleStop", Profiles = Gm, Hardware = HardwareTag.IntelCpu },
// Microsoft's own first-party monitoring/cleanup app (labelled Beta upstream,
// but the package installs cleanly).
new() { FriendlyName = "Microsoft PC Manager (opens page)", Category = "Monitoring & Performance", Kind = AppKind.Link, PageUrl = "https://pcmanager.microsoft.com/" },
// No winget package exists for Cortex - Razer only ships a direct download,
// so it is a Manual entry using Razer's own stable short link.
new() { FriendlyName = "Razer Cortex", Category = "Monitoring & Performance", Kind = AppKind.Manual,
ManualFileName = "RazerCortexInstaller.exe",
ManualUrl = "https://rzr.to/cortex-download", PageUrl = "https://www.razer.com/cortex" },
// ---- Streaming / recording ----
new() { FriendlyName = "OBS Studio", Category = "Streaming & Recording", Kind = AppKind.Winget, WingetId = "OBSProject.OBSStudio" },
new() { FriendlyName = "Streamlabs Desktop", Category = "Streaming & Recording", Kind = AppKind.Winget, WingetId = "Streamlabs.Streamlabs" },
new() { FriendlyName = "Medal.tv", Category = "Streaming & Recording", Kind = AppKind.Winget, WingetId = "MedalB.V.Medal" },
new() { FriendlyName = "Voicemeeter Banana", Category = "Streaming & Recording", Kind = AppKind.Winget, WingetId = "VB-Audio.Voicemeeter.Banana" },
new() { FriendlyName = "Elgato Stream Deck", Category = "Streaming & Recording", Kind = AppKind.Winget, WingetId = "Elgato.StreamDeck" },
new() { FriendlyName = "Elgato Wave Link", Category = "Streaming & Recording", Kind = AppKind.Winget, WingetId = "Elgato.WaveLink" },
// Self-hosted game-streaming host - pairs with the free Moonlight app on a
// phone/TV/handheld to stream this PC's games around the house.
new() { FriendlyName = "Sunshine (stream games to Moonlight)", Category = "Streaming & Recording", Kind = AppKind.Winget, WingetId = "LizardByte.Sunshine" },
new() { FriendlyName = "Moonlight (play streamed PC games)", Category = "Streaming & Recording", Kind = AppKind.Winget, WingetId = "MoonlightGameStreamingProject.Moonlight" },
new() { FriendlyName = "Parsec (low-latency remote play)", Category = "Streaming & Recording", Kind = AppKind.Winget, WingetId = "Parsec.Parsec" },
new() { FriendlyName = "Elgato 4K Capture Utility (capture cards)", Category = "Streaming & Recording", Kind = AppKind.Winget, WingetId = "Elgato.4KCaptureUtility", Profiles = Gm },
new() { FriendlyName = "Elgato Camera Hub (webcam settings)", Category = "Streaming & Recording", Kind = AppKind.Winget, WingetId = "Elgato.CameraHub", Profiles = Gm },
new() { FriendlyName = "Elgato Control Center (Key Light)", Category = "Streaming & Recording", Kind = AppKind.Winget, WingetId = "Elgato.ControlCenter", Profiles = Gm },
new() { FriendlyName = "Streamer.bot (stream chat and alert automation)", Category = "Streaming & Recording", Kind = AppKind.Winget, WingetId = "streamerbot.streamerbot", Profiles = Gm },
new() { FriendlyName = "Voicemod (live voice changer, opens page)", Category = "Streaming & Recording", Kind = AppKind.Link, PageUrl = "https://www.voicemod.net/", Profiles = Gm },
new() { FriendlyName = "VB-Cable (virtual audio cable, opens page)", Category = "Streaming & Recording", Kind = AppKind.Link, PageUrl = "https://vb-audio.com/Cable/", Profiles = Gm },
new() { FriendlyName = "Voicemeeter Potato (advanced audio mixer)", Category = "Streaming & Recording", Kind = AppKind.Winget, WingetId = "VB-Audio.Voicemeeter.Potato", Profiles = Gm },
// ---- Developer tools ----
new() { FriendlyName = "Git", Category = "Developer Tools", Kind = AppKind.Winget, WingetId = "Git.Git", Profiles = Dv },
new() { FriendlyName = "GitHub CLI", Category = "Developer Tools", Kind = AppKind.Winget, WingetId = "GitHub.cli", Profiles = Dv },
new() { FriendlyName = "GitHub Desktop", Category = "Developer Tools", Kind = AppKind.Winget, WingetId = "GitHub.GitHubDesktop", Profiles = Dv },
new() { FriendlyName = "Windows Terminal", Category = "Developer Tools", Kind = AppKind.Winget, WingetId = "Microsoft.WindowsTerminal", Profiles = Dv },
new() { FriendlyName = "Visual Studio 2022 Community (large download)", Category = "Developer Tools", Kind = AppKind.Winget, WingetId = "Microsoft.VisualStudio.2022.Community", Profiles = Dv },
new() { FriendlyName = "JetBrains Toolbox", Category = "Developer Tools", Kind = AppKind.Winget, WingetId = "JetBrains.Toolbox", Profiles = Dv },
new() { FriendlyName = "Postman (API testing)", Category = "Developer Tools", Kind = AppKind.Winget, WingetId = "Postman.Postman", Profiles = Dv },
new() { FriendlyName = "DBeaver (database client)", Category = "Developer Tools", Kind = AppKind.Winget, WingetId = "DBeaver.DBeaver.Community", Profiles = Dv },
new() { FriendlyName = "Neovim (modal text editor)", Category = "Developer Tools", Kind = AppKind.Winget, WingetId = "Neovim.Neovim", Profiles = Dv },
new() { FriendlyName = "Fork (Git client)", Category = "Developer Tools", Kind = AppKind.Winget, WingetId = "Fork.Fork", Profiles = Dv },
new() { FriendlyName = "Insomnia (API client)", Category = "Developer Tools", Kind = AppKind.Winget, WingetId = "Insomnia.Insomnia", Profiles = Dv },
new() { FriendlyName = "WinMerge (compare files and folders)", Category = "Developer Tools", Kind = AppKind.Winget, WingetId = "WinMerge.WinMerge", Profiles = Dv },
new() { FriendlyName = "MobaXterm (SSH + remote tools)", Category = "Developer Tools", Kind = AppKind.Winget, WingetId = "Mobatek.MobaXterm", Profiles = Dv },
new() { FriendlyName = "CMake", Category = "Developer Tools", Kind = AppKind.Winget, WingetId = "Kitware.CMake", Profiles = Dv },
new() { FriendlyName = "Visual Studio 2022 Build Tools (C++/.NET compilers)", Category = "Developer Tools", Kind = AppKind.Winget, WingetId = "Microsoft.VisualStudio.2022.BuildTools", Profiles = Dv },
new() { FriendlyName = "Zed (fast code editor)", Category = "Developer Tools", Kind = AppKind.Winget, WingetId = "ZedIndustries.Zed", Profiles = Dv },
new() { FriendlyName = "Cursor (AI code editor)", Category = "Developer Tools", Kind = AppKind.Winget, WingetId = "Anysphere.Cursor", Profiles = Dv },
new() { FriendlyName = "Bruno (offline API client)", Category = "Developer Tools", Kind = AppKind.Winget, WingetId = "Bruno.Bruno", Profiles = Dv },
new() { FriendlyName = "HxD (hex editor)", Category = "Developer Tools", Kind = AppKind.Winget, WingetId = "MHNexus.HxD", Profiles = Dv },
new() { FriendlyName = "Android Studio", Category = "Developer Tools", Kind = AppKind.Winget, WingetId = "Google.AndroidStudio", Profiles = Dv },
// ---- Command-line tools ----
new() { FriendlyName = "lazygit (Git in the terminal)", Category = "Command-line Tools", Kind = AppKind.Winget, WingetId = "JesseDuffield.lazygit", Profiles = Dv },
new() { FriendlyName = "Starship (nicer shell prompt)", Category = "Command-line Tools", Kind = AppKind.Winget, WingetId = "Starship.Starship", Profiles = Dv },
new() { FriendlyName = "ripgrep (very fast text search)", Category = "Command-line Tools", Kind = AppKind.Winget, WingetId = "BurntSushi.ripgrep.MSVC", Profiles = Dv },
new() { FriendlyName = "fzf (fuzzy finder)", Category = "Command-line Tools", Kind = AppKind.Winget, WingetId = "junegunn.fzf", Profiles = Dv },
new() { FriendlyName = "jq (read JSON in the terminal)", Category = "Command-line Tools", Kind = AppKind.Winget, WingetId = "jqlang.jq", Profiles = Dv },
// ---- Databases ----
new() { FriendlyName = "PostgreSQL 16", Category = "Databases", Kind = AppKind.Winget, WingetId = "PostgreSQL.PostgreSQL.16", Profiles = Dv },
new() { FriendlyName = "MongoDB Compass", Category = "Databases", Kind = AppKind.Winget, WingetId = "MongoDB.Compass.Full", Profiles = Dv },
new() { FriendlyName = "HeidiSQL", Category = "Databases", Kind = AppKind.Winget, WingetId = "HeidiSQL.HeidiSQL", Profiles = Dv },
// ---- Languages & runtimes ----
new() { FriendlyName = "Node.js (LTS)", Category = "Languages & Runtimes", Kind = AppKind.Winget, WingetId = "OpenJS.NodeJS.LTS", Profiles = Dv },
new() { FriendlyName = ".NET SDK 8", Category = "Languages & Runtimes", Kind = AppKind.Winget, WingetId = "Microsoft.DotNet.SDK.8", Profiles = Dv },
new() { FriendlyName = "Go", Category = "Languages & Runtimes", Kind = AppKind.Winget, WingetId = "GoLang.Go", Profiles = Dv },
new() { FriendlyName = "Rust (rustup)", Category = "Languages & Runtimes", Kind = AppKind.Winget, WingetId = "Rustlang.Rustup", Profiles = Dv },
new() { FriendlyName = "Java 21 (Temurin JDK)", Category = "Languages & Runtimes", Kind = AppKind.Winget, WingetId = "EclipseAdoptium.Temurin.21.JDK", Profiles = Dv },
new() { FriendlyName = "Deno (JavaScript/TypeScript runtime)", Category = "Languages & Runtimes", Kind = AppKind.Winget, WingetId = "DenoLand.Deno", Profiles = Dv },
new() { FriendlyName = "Bun (fast JavaScript runtime)", Category = "Languages & Runtimes", Kind = AppKind.Winget, WingetId = "Oven-sh.Bun", Profiles = Dv },
new() { FriendlyName = "uv (fast Python package manager)", Category = "Languages & Runtimes", Kind = AppKind.Winget, WingetId = "astral-sh.uv", Profiles = Dv },
new() { FriendlyName = ".NET SDK 9", Category = "Languages & Runtimes", Kind = AppKind.Winget, WingetId = "Microsoft.DotNet.SDK.9", Profiles = Dv },
// ---- Containers & cloud (Docker and WSL need virtualization switched on in
// the BIOS/UEFI and usually a restart afterwards) ----
new() { FriendlyName = "Docker Desktop", Category = "Containers & Cloud", Kind = AppKind.Winget, WingetId = "Docker.DockerDesktop", Profiles = Dv },
new() { FriendlyName = "WSL (Windows Subsystem for Linux)", Category = "Containers & Cloud", Kind = AppKind.Winget, WingetId = "Microsoft.WSL", Profiles = Dv },
new() { FriendlyName = "Azure CLI", Category = "Containers & Cloud", Kind = AppKind.Winget, WingetId = "Microsoft.AzureCLI", Profiles = Dv },
new() { FriendlyName = "kubectl", Category = "Containers & Cloud", Kind = AppKind.Winget, WingetId = "Kubernetes.kubectl", Profiles = Dv },
new() { FriendlyName = "Terraform", Category = "Containers & Cloud", Kind = AppKind.Winget, WingetId = "Hashicorp.Terraform", Profiles = Dv },
new() { FriendlyName = "Helm (Kubernetes packages)", Category = "Containers & Cloud", Kind = AppKind.Winget, WingetId = "Helm.Helm", Profiles = Dv },
new() { FriendlyName = "minikube (local Kubernetes)", Category = "Containers & Cloud", Kind = AppKind.Winget, WingetId = "Kubernetes.minikube", Profiles = Dv },
new() { FriendlyName = "Bicep (Azure infrastructure)", Category = "Containers & Cloud", Kind = AppKind.Winget, WingetId = "Microsoft.Bicep", Profiles = Dv },
new() { FriendlyName = "Vagrant", Category = "Containers & Cloud", Kind = AppKind.Winget, WingetId = "Hashicorp.Vagrant", Profiles = Dv },
new() { FriendlyName = "Ubuntu 24.04 for WSL", Category = "Containers & Cloud", Kind = AppKind.Winget, WingetId = "Canonical.Ubuntu.2404", Profiles = Dv },
new() { FriendlyName = "Podman Desktop (containers without Docker)", Category = "Containers & Cloud", Kind = AppKind.Winget, WingetId = "RedHat.Podman-Desktop", Profiles = Dv },
// ---- Home lab & network ----
new() { FriendlyName = "Tailscale (private network)", Category = "Home Lab & Network", Kind = AppKind.Winget, WingetId = "Tailscale.Tailscale", Profiles = Dv },
new() { FriendlyName = "Wireshark", Category = "Home Lab & Network", Kind = AppKind.Winget, WingetId = "WiresharkFoundation.Wireshark", Profiles = Dv },
new() { FriendlyName = "PuTTY (SSH)", Category = "Home Lab & Network", Kind = AppKind.Winget, WingetId = "PuTTY.PuTTY", Profiles = Dv },
new() { FriendlyName = "WinSCP (file transfer)", Category = "Home Lab & Network", Kind = AppKind.Winget, WingetId = "WinSCP.WinSCP", Profiles = Dv },
new() { FriendlyName = "Sysinternals Suite", Category = "Home Lab & Network", Kind = AppKind.Winget, WingetId = "Microsoft.Sysinternals.Suite", Profiles = Dv },
new() { FriendlyName = "VirtualBox", Category = "Home Lab & Network", Kind = AppKind.Winget, WingetId = "Oracle.VirtualBox", Profiles = Dv },
new() { FriendlyName = "Balena Etcher (flash USB/SD images)", Category = "Home Lab & Network", Kind = AppKind.Winget, WingetId = "Balena.Etcher", Profiles = Dv },
new() { FriendlyName = "Rufus (bootable USB drives)", Category = "Home Lab & Network", Kind = AppKind.Winget, WingetId = "Rufus.Rufus", Profiles = Dv },
new() { FriendlyName = "Ventoy (multi-boot USB)", Category = "Home Lab & Network", Kind = AppKind.Winget, WingetId = "Ventoy.Ventoy", Profiles = Dv },
new() { FriendlyName = "WireGuard (VPN)", Category = "Home Lab & Network", Kind = AppKind.Winget, WingetId = "WireGuard.WireGuard", Profiles = Dv },
new() { FriendlyName = "Nmap (network scanner)", Category = "Home Lab & Network", Kind = AppKind.Winget, WingetId = "Insecure.Nmap", Profiles = Dv },
new() { FriendlyName = "Advanced IP Scanner", Category = "Home Lab & Network", Kind = AppKind.Winget, WingetId = "Famatech.AdvancedIPScanner", Profiles = Dv },
new() { FriendlyName = "Angry IP Scanner", Category = "Home Lab & Network", Kind = AppKind.Winget, WingetId = "angryziber.AngryIPScanner", Profiles = Dv },
new() { FriendlyName = "Syncthing (private file sync)", Category = "Home Lab & Network", Kind = AppKind.Winget, WingetId = "Syncthing.Syncthing", Profiles = Dv },
// ---- General utilities ----
new() { FriendlyName = "VS Code", Category = "General Utilities", Kind = AppKind.Winget, WingetId = "Microsoft.VisualStudioCode", Profiles = Everyone },
new() { FriendlyName = "PowerShell 7", Category = "General Utilities", Kind = AppKind.Winget, WingetId = "Microsoft.PowerShell", Profiles = Gm | Dv },
new() { FriendlyName = "Python 3", Category = "General Utilities", Kind = AppKind.Winget, WingetId = "Python.Python.3.13", Profiles = Gm | Dv },
new() { FriendlyName = "PowerToys", Category = "General Utilities", Kind = AppKind.Winget, WingetId = "Microsoft.PowerToys", Profiles = Everyone },
new() { FriendlyName = "VLC Media Player", Category = "General Utilities", Kind = AppKind.Winget, WingetId = "VideoLAN.VLC", Profiles = Everyone },
new() { FriendlyName = "7-Zip", Category = "General Utilities", Kind = AppKind.Winget, WingetId = "7zip.7zip", Profiles = Everyone },
new() { FriendlyName = "Bitwarden (password manager)", Category = "General Utilities", Kind = AppKind.Winget, WingetId = "Bitwarden.Bitwarden", Profiles = Everyone },
new() { FriendlyName = "Everything (instant file search)", Category = "General Utilities", Kind = AppKind.Winget, WingetId = "voidtools.Everything", Profiles = Of | Dv },
new() { FriendlyName = "WizTree (see what's filling a drive)", Category = "General Utilities", Kind = AppKind.Winget, WingetId = "AntibodySoftware.WizTree", Profiles = Everyone },
new() { FriendlyName = "ShareX (screenshots + screen recording)", Category = "General Utilities", Kind = AppKind.Winget, WingetId = "ShareX.ShareX", Profiles = Everyone },
new() { FriendlyName = "EarTrumpet (per-app volume mixer)", Category = "General Utilities", Kind = AppKind.Winget, WingetId = "File-New-Project.EarTrumpet", Profiles = Everyone },
new() { FriendlyName = "Ditto (clipboard history)", Category = "General Utilities", Kind = AppKind.Winget, WingetId = "Ditto.Ditto", Profiles = Everyone },
new() { FriendlyName = "AnyDesk (remote support)", Category = "General Utilities", Kind = AppKind.Winget, WingetId = "AnyDesk.AnyDesk", Profiles = Of },
new() { FriendlyName = "Spotify", Category = "General Utilities", Kind = AppKind.Winget, WingetId = "Spotify.Spotify", Profiles = Gm | Of },
new() { FriendlyName = "Malwarebytes (on-demand malware scanner)", Category = "Security & Privacy", Kind = AppKind.Winget, WingetId = "Malwarebytes.Malwarebytes", Profiles = Everyone },
new() { FriendlyName = "Proton VPN", Category = "Security & Privacy", Kind = AppKind.Winget, WingetId = "Proton.ProtonVPN", Profiles = Of | Gm },
new() { FriendlyName = "Paint.NET (image editor)", Category = "Creative", Kind = AppKind.Winget, WingetId = "dotPDN.PaintDotNet", Profiles = Of | Gm },
new() { FriendlyName = "GIMP (advanced image editor)", Category = "Creative", Kind = AppKind.Winget, WingetId = "GIMP.GIMP.3", Profiles = Of | Gm },
new() { FriendlyName = "Inkscape (vector graphics)", Category = "Creative", Kind = AppKind.Winget, WingetId = "Inkscape.Inkscape", Profiles = Of },
new() { FriendlyName = "HandBrake (video converter)", Category = "Creative", Kind = AppKind.Winget, WingetId = "HandBrake.HandBrake", Profiles = Of | Gm },
new() { FriendlyName = "Audacity (audio editor)", Category = "Creative", Kind = AppKind.Winget, WingetId = "Audacity.Audacity", Profiles = Of | Gm },
new() { FriendlyName = "AutoHotkey (automation scripts)", Category = "General Utilities", Kind = AppKind.Winget, WingetId = "AutoHotkey.AutoHotkey", Profiles = Dv | Gm },
new() { FriendlyName = "Rainmeter (desktop widgets)", Category = "Customisation & Mods", Kind = AppKind.Winget, WingetId = "Rainmeter.Rainmeter", Profiles = Gm },
new() { FriendlyName = "Lively Wallpaper (animated wallpapers)", Category = "Customisation & Mods", Kind = AppKind.Winget, WingetId = "rocksdanister.LivelyWallpaper", Profiles = Gm },
new() { FriendlyName = "Mod Organizer 2", Category = "Customisation & Mods", Kind = AppKind.Winget, WingetId = "ModOrganizer2.modorganizer", Profiles = Gm },
new() { FriendlyName = "ReShade (post-processing filters for games)", Category = "Customisation & Mods", Kind = AppKind.Winget, WingetId = "Reshade.Setup", Profiles = Gm },
new() { FriendlyName = "Special K (frame pacing, HDR and game fixes)", Category = "Customisation & Mods", Kind = AppKind.Winget, WingetId = "SpecialK.SpecialK", Profiles = Gm },
new() { FriendlyName = "Overwolf (in-game overlay apps, opens page)", Category = "Customisation & Mods", Kind = AppKind.Link, PageUrl = "https://www.overwolf.com/", Profiles = Gm },
new() { FriendlyName = "Lossless Scaling (frame generation, opens its Steam page)", Category = "Customisation & Mods", Kind = AppKind.Link, PageUrl = "https://store.steampowered.com/app/993090/Lossless_Scaling/", Profiles = Gm },
new() { FriendlyName = "Vortex Mod Manager", Category = "General Utilities", Kind = AppKind.Winget, WingetId = "NexusMods.Vortex" },
// ---- Redistributables - the entries everyone should just say yes to. A
// single catalog line that silently installs every runtime version games and
// creator apps commonly expect, so people stop hitting "missing MSVCP140.dll"
// errors. See InstallBundleAsync for how a Bundle entry actually installs. ----
new() { FriendlyName = "VC++ Redistributables Pack (all versions)", Category = "Redistributables", Kind = AppKind.Bundle, Profiles = Everyone,
BundleWingetIds = new[]
{
"Microsoft.VCRedist.2005.x86", "Microsoft.VCRedist.2005.x64",
"Microsoft.VCRedist.2008.x86", "Microsoft.VCRedist.2008.x64",
"Microsoft.VCRedist.2010.x86", "Microsoft.VCRedist.2010.x64",
"Microsoft.VCRedist.2012.x86", "Microsoft.VCRedist.2012.x64",
"Microsoft.VCRedist.2013.x86", "Microsoft.VCRedist.2013.x64",
"Microsoft.VCRedist.2015+.x86", "Microsoft.VCRedist.2015+.x64"
} },
new() { FriendlyName = ".NET Desktop Runtimes (8 + 9)", Category = "Redistributables", Kind = AppKind.Bundle, Profiles = Everyone,
BundleWingetIds = new[] { "Microsoft.DotNet.DesktopRuntime.8", "Microsoft.DotNet.DesktopRuntime.9" } },
// Older DirectX 9/10/11 helper DLLs (d3dx9_43.dll and friends) that plenty of
// older games still ask for and Windows 11 doesn't ship.
new() { FriendlyName = "DirectX End-User Runtime (older game DLLs)", Category = "Redistributables", Kind = AppKind.Winget, WingetId = "Microsoft.DirectX" },
// ---- Deep uninstallers: remove a program AND the folders, registry entries and leftovers
// it leaves behind (the normal Windows uninstaller doesn't). ----
new() { FriendlyName = "Bulk Crap Uninstaller (deep uninstaller, finds leftovers)", Category = "Uninstall & Clean-up Tools", Kind = AppKind.Winget, WingetId = "Klocman.BulkCrapUninstaller", Profiles = Everyone, Note = "Free, open-source. Removes many programs at once and scans for leftover files and registry entries." },
new() { FriendlyName = "Revo Uninstaller Free (deep uninstaller)", Category = "Uninstall & Clean-up Tools", Kind = AppKind.Winget, WingetId = "RevoUninstaller.RevoUninstaller", Profiles = Everyone, Note = "Watches an uninstall, then scans for what it left behind. The free version is enough for most people." },
new() { FriendlyName = "Geek Uninstaller (small, fast uninstaller)", Category = "Uninstall & Clean-up Tools", Kind = AppKind.Winget, WingetId = "GeekUninstaller.GeekUninstaller", Profiles = Everyone, Note = "A tiny portable uninstaller with a forced-removal option for stubborn programs." },
new() { FriendlyName = "BleachBit (clears junk and temporary files)", Category = "Uninstall & Clean-up Tools", Kind = AppKind.Winget, WingetId = "BleachBit.BleachBit", Profiles = Everyone, Note = "Open-source cleaner for temporary files, caches and logs. It shows what it will remove before it does." },
new() { FriendlyName = "WinDirStat (what is filling your drive)", Category = "Uninstall & Clean-up Tools", Kind = AppKind.Winget, WingetId = "WinDirStat.WinDirStat", Profiles = Everyone },
// ---- RGB / peripheral ecosystems - manufacturer control software. The lighting
// programs (ExclusiveGroup = "lighting-brand") are PICK-ONE: running several fights over the same
// LEDs and they are hard to remove cleanly. Nobody owns all of these, so they're skippable. OpenRGB and SignalRGB are the odd
// ones out: single apps that talk to hardware from many vendors at once. ----
new() { FriendlyName = "Corsair iCUE", Category = "RGB & Peripheral Control", Kind = AppKind.Winget, WingetId = "Corsair.iCUE.4", ExclusiveGroup = "lighting-brand" },
// Synapse 4 is the current version (the old "Razer.Synapse.3" ID doesn't exist).
new() { FriendlyName = "Razer Synapse", Category = "RGB & Peripheral Control", Kind = AppKind.Winget, WingetId = "RazerInc.RazerInstaller.Synapse4", ExclusiveGroup = "lighting-brand" },
new() { FriendlyName = "Logitech G HUB", Category = "RGB & Peripheral Control", Kind = AppKind.Winget, WingetId = "Logitech.GHUB", ExclusiveGroup = "lighting-brand" },
new() { FriendlyName = "SteelSeries GG", Category = "RGB & Peripheral Control", Kind = AppKind.Winget, WingetId = "SteelSeries.GG", ExclusiveGroup = "lighting-brand" },
new() { FriendlyName = "OpenRGB (universal, multi-vendor)", Category = "RGB & Peripheral Control", Kind = AppKind.Winget, WingetId = "OpenRGB.OpenRGB", ExclusiveGroup = "lighting-universal" },
new() { FriendlyName = "SignalRGB (universal, multi-vendor)", Category = "RGB & Peripheral Control", Kind = AppKind.Winget, WingetId = "WhirlwindFX.SignalRgb", ExclusiveGroup = "lighting-universal" },
new() { FriendlyName = "NZXT CAM (NZXT cooling + lighting control)", Category = "RGB & Peripheral Control", Kind = AppKind.Winget, WingetId = "NZXT.CAM", Profiles = Gm, ExclusiveGroup = "lighting-brand" },
new() { FriendlyName = "Logitech Options+ (MX mice and keyboards)", Category = "RGB & Peripheral Control", Kind = AppKind.Winget, WingetId = "Logitech.OptionsPlus", Profiles = Gm | Of },
new() { FriendlyName = "Hyte Nexus (HYTE case/AIO control)", Category = "RGB & Peripheral Control", Kind = AppKind.Manual, ExclusiveGroup = "lighting-brand",
ManualFileName = "HyteNexusInstaller.exe", ManualUrl = "https://hyte.co/nexus-download", PageUrl = "https://hyte.com/" },
new() { FriendlyName = "L-Connect 3 (Lian Li fan/lighting control)", Category = "RGB & Peripheral Control", Kind = AppKind.Manual, ExclusiveGroup = "lighting-brand",
ManualFileName = "LConnect3.zip",
ManualUrl = "https://lianli-update-2025.lianli-cn.com/L3_CX/20260422-L-Connect%203-x64-v2.1.20-fde9a570.zip", PageUrl = "https://lian-li.com/l-connect3/" },
// ---- Retro computing. 86Box emulates the real period chipsets/sound/graphics
// Windows 98 games expect. It only installs the emulator: Windows 98 itself and
// the ROM files stay firmly "bring your own" (see WriteRetroVmReadme). ----
new() { FriendlyName = "86Box (Windows 98 VM, BYO ISO/ROMs)", Category = "Retro Computing", Kind = AppKind.Winget, WingetId = "86Box.86Box" },
new() { FriendlyName = "RetroArch (all-in-one retro game emulator)", Category = "Retro Computing", Kind = AppKind.Winget, WingetId = "Libretro.RetroArch", Profiles = Gm },
new() { FriendlyName = "PCSX2 (PlayStation 2 emulator, BYO games)", Category = "Retro Computing", Kind = AppKind.Winget, WingetId = "PCSX2Team.PCSX2", Profiles = Gm },
new() { FriendlyName = "DOSBox-X (old DOS games)", Category = "Retro Computing", Kind = AppKind.Winget, WingetId = "joncampbell123.DOSBox-X", Profiles = Gm },
new() { FriendlyName = "ScummVM (classic point-and-click adventures)", Category = "Retro Computing", Kind = AppKind.Winget, WingetId = "ScummVM.ScummVM", Profiles = Gm },
// ---- Game console emulators. Legal to install; you supply your own games and any BIOS files
// (dumped from consoles you own). GamingStack never downloads games. ----
new() { FriendlyName = "Dolphin (GameCube and Wii)", Category = "Console Emulators (bring your own games)", Kind = AppKind.Winget, WingetId = "DolphinEmulator.Dolphin", Profiles = Gm },
new() { FriendlyName = "DuckStation (PlayStation 1)", Category = "Console Emulators (bring your own games)", Kind = AppKind.Winget, WingetId = "Stenzek.DuckStation", Profiles = Gm },
new() { FriendlyName = "PPSSPP (PlayStation Portable)", Category = "Console Emulators (bring your own games)", Kind = AppKind.Winget, WingetId = "PPSSPPTeam.PPSSPP", Profiles = Gm },
new() { FriendlyName = "Cemu (Wii U)", Category = "Console Emulators (bring your own games)", Kind = AppKind.Winget, WingetId = "Cemu.Cemu", Profiles = Gm },
new() { FriendlyName = "melonDS (Nintendo DS)", Category = "Console Emulators (bring your own games)", Kind = AppKind.Winget, WingetId = "melonDS.melonDS", Profiles = Gm },
new() { FriendlyName = "Azahar (Nintendo 3DS)", Category = "Console Emulators (bring your own games)", Kind = AppKind.Winget, WingetId = "AzaharEmu.Azahar", Profiles = Gm },
new() { FriendlyName = "mGBA (Game Boy, Game Boy Color, Game Boy Advance)", Category = "Console Emulators (bring your own games)", Kind = AppKind.Winget, WingetId = "JeffreyPfau.mGBA", Profiles = Gm },
new() { FriendlyName = "xemu (original Xbox)", Category = "Console Emulators (bring your own games)", Kind = AppKind.Winget, WingetId = "xemu-project.xemu", Profiles = Gm },
new() { FriendlyName = "MAME (arcade machines)", Category = "Console Emulators (bring your own games)", Kind = AppKind.Winget, WingetId = "MAMEdev.MAME", Profiles = Gm },
new() { FriendlyName = "RPCS3 (PlayStation 3, opens download page)", Category = "Console Emulators (bring your own games)", Kind = AppKind.Link, PageUrl = "https://rpcs3.net/download", Profiles = Gm },
new() { FriendlyName = "Flycast (Dreamcast and Naomi, opens download page)", Category = "Console Emulators (bring your own games)", Kind = AppKind.Link, PageUrl = "https://github.com/flyinghead/flycast/releases", Profiles = Gm },
new() { FriendlyName = "EmulationStation Desktop Edition (one front-end for all your emulators)", Category = "Console Emulators (bring your own games)", Kind = AppKind.Winget, WingetId = "ES-DE.EmulationStation-DE", Profiles = Gm },
new() { FriendlyName = "LaunchBox (game library front-end, opens download page)", Category = "Console Emulators (bring your own games)", Kind = AppKind.Link, PageUrl = "https://www.launchbox-app.com/download", Profiles = Gm },
// ---- Vendor software with no winget package: these open the vendor's own page in your
// default browser and you install from there. ----
new() { FriendlyName = "AMD Software: Adrenalin (opens download page)", Category = "Drivers & Vendor Software", Kind = AppKind.Link, PageUrl = "https://www.amd.com/en/support/download/drivers.html", Profiles = Gm, Hardware = HardwareTag.AmdGpu },
new() { FriendlyName = "AMD Ryzen Master (Ryzen tuning, opens download page)", Category = "Drivers & Vendor Software", Kind = AppKind.Link, PageUrl = "https://www.amd.com/en/products/software/ryzen-master.html", Profiles = Gm, Hardware = HardwareTag.AmdCpu },
new() { FriendlyName = "AMD Chipset Drivers (Ryzen motherboards, opens download page)", Category = "Drivers & Vendor Software", Kind = AppKind.Link, PageUrl = "https://www.amd.com/en/support/download/drivers.html", Profiles = Gm, Hardware = HardwareTag.AmdCpu },
new() { FriendlyName = "Intel Driver & Support Assistant (opens page)", Category = "Drivers & Vendor Software", Kind = AppKind.Link, PageUrl = "https://www.intel.com/content/www/us/en/support/detect.html", Profiles = Everyone, Hardware = HardwareTag.IntelAny },
new() { FriendlyName = "MSI Center (opens download page)", Category = "Drivers & Vendor Software", Kind = AppKind.Link, PageUrl = "https://www.msi.com/Landing/MSI-Center", Profiles = Gm },
new() { FriendlyName = "ASUS Armoury Crate (opens download page)", Category = "Drivers & Vendor Software", Kind = AppKind.Link, PageUrl = "https://rog.asus.com/armoury-crate/", Profiles = Gm },
new() { FriendlyName = "Cinebench (opens download page)", Category = "Drivers & Vendor Software", Kind = AppKind.Link, PageUrl = "https://www.maxon.net/en/cinebench", Profiles = Gm },
new() { FriendlyName = "Wallpaper Engine (opens its Steam page)", Category = "Drivers & Vendor Software", Kind = AppKind.Link, PageUrl = "https://store.steampowered.com/app/431960/Wallpaper_Engine/", Profiles = Gm },
// ---- AI assistants. "9NT1R1C2HH7J" is the Microsoft Store listing ID for the
// official ChatGPT Windows app (OpenAI documents installing it this way).
// Google Gemini (no official package) and Perplexity (package being removed
// upstream) are left out - see ROADMAP.md. ----
new() { FriendlyName = "Claude", Category = "AI Assistants", Kind = AppKind.Winget, WingetId = "Anthropic.Claude", Profiles = Everyone },
new() { FriendlyName = "ChatGPT", Category = "AI Assistants", Kind = AppKind.Winget, WingetId = "9NT1R1C2HH7J", Profiles = Everyone },
new() { FriendlyName = "Claude Code (AI coding in the terminal)", Category = "AI Assistants", Kind = AppKind.Winget, WingetId = "Anthropic.ClaudeCode", Profiles = Dv },
new() { FriendlyName = "LM Studio (run open AI models locally)", Category = "AI Assistants", Kind = AppKind.Winget, WingetId = "ElementLabs.LMStudio", Profiles = Gm | Dv },
new() { FriendlyName = "Ollama (run open AI models locally)", Category = "AI Assistants", Kind = AppKind.Winget, WingetId = "Ollama.Ollama", Profiles = Gm | Dv }
};
/// <summary>The catalog entries a given profile offers, in catalog order.</summary>
public static List<AppEntry> CatalogFor(SetupProfile profile) =>
Catalog.Where(a => (a.Profiles & profile) != 0).ToList();
// Preinstalled consumer apps the opt-in debloat screen can offer to remove.
// Never a blanket "remove everything": the screen only lists the ones actually
// found on this PC (see ScanDebloatAsync), every one starts UNticked, and
// nothing is touched unless the user ticks it - same disclosed/reversible
// rule as the tweaks. Removal goes through `winget uninstall` (a native CLI
// call, like the rest of this class - no PowerShell), using the package
// family IDs winget itself lists these apps under. Removal is for the signed-in
// user's account; the revert script reinstalls from the Microsoft Store.
// Skype is deliberately not here - Microsoft retired it in May 2025.
public static readonly IReadOnlyList<DebloatItem> DebloatCatalog = new List<DebloatItem>
{
new("news", "Microsoft News", "news feed app that nags from the widgets/taskbar",
"Microsoft.BingNews_8wekyb3d8bbwe", "9WZDNCRFHVFW"),
new("weather", "Weather", "weather app (the taskbar widget stays separate)",
"Microsoft.BingWeather_8wekyb3d8bbwe", "9WZDNCRFJ3Q2"),
new("clipchamp", "Clipchamp", "basic video editor bundled with Windows 11",
"Clipchamp.Clipchamp_yxz26nhyzhsrt", "9P1J8S7CCWWT"),
new("solitaire", "Solitaire Collection", "card games with video ads",
"Microsoft.MicrosoftSolitaireCollection_8wekyb3d8bbwe", "9WZDNCRFHWD2"),
new("teams", "Microsoft Teams (free/personal)", "the consumer chat app pinned to the taskbar",
"MicrosoftTeams_8wekyb3d8bbwe", "XP8BT8DW290MPQ"),
new("office", "Microsoft 365 trial nag (Office hub)", "the 'Get Microsoft 365' trial launcher - not Word/Excel themselves",
"Microsoft.MicrosoftOfficeHub_8wekyb3d8bbwe", "9WZDNCRD29V9"),
new("tiktok", "TikTok", "preinstalled on some PCs",
"BytedancePte.Ltd.TikTok_6yccndn6064se", "9NH2GPH4JZS4"),
new("disney", "Disney+", "preinstalled on some PCs",
"Disney.37853FC22B2CE_6rarf9sa4v8jt", "9NXQXXLFST89"),
new("spotify", "Spotify (Store version)", "preinstalled on some PCs - skip it if you use Spotify!",
"SpotifyAB.SpotifyMusic_zpdnekdrzrea0", "9NCBCSZSJRSB"),
};
// A handful of winget exit codes are common enough, and confusing enough out of
// context, that they're worth translating into plain English instead of showing
// a bare "exit code -1978335189" on the summary screen. AlreadyUpToDate codes are
// treated as a Skipped result rather than a Failed one - winget refusing to
// reinstall something that's already current isn't actually a problem. Sourced
// from AppInstallerErrors.h in the winget-cli repo, plus the HRESULT convention
// where a WinHTTP-facility code's low word is a literal HTTP status.
private static readonly Dictionary<int, (bool AlreadyUpToDate, string Friendly)> KnownWingetExitCodes = new()
{
// APPINSTALLER_CLI_ERROR_UPDATE_NOT_APPLICABLE - an equal or newer version is
// already installed, so winget refuses to reinstall it. Not a real failure.
{ unchecked((int)0x8A15002B), (true, "already installed and up to date - nothing to do") },
// APPINSTALLER_CLI_ERROR_EXEC_UNINSTALL_COMMAND_FAILED - winget tried to
// repair/replace an existing install and the uninstall step it ran first
// failed. Usually a leftover broken install; uninstalling it by hand first
// and re-running the install usually clears it.
{ unchecked((int)0x8A150030), (false, "a broken existing install is blocking this - try uninstalling it manually first, then rerun") },
// WinHTTP-facility HRESULT whose low word is a literal HTTP status code -
// 0x194 = 404. Means winget's own package manifest currently points at a dead
// download URL upstream. Nothing wrong with this app or your PC - just wait
// for the manifest to get fixed, or check "winget show <id>" another day.
{ unchecked((int)0x80190194), (false, "winget's download link for this is currently broken upstream (404) - not something this app can fix, try again another day") },
};
private static string DescribeExitCode(int exitCode) =>
KnownWingetExitCodes.TryGetValue(exitCode, out var known)
? known.Friendly
: $"exit code {exitCode} (unrecognized - check the full log for winget's own output)";
private const int MaxRetries = 2;
private readonly string _workDir = Path.Combine(Path.GetTempPath(), "GamingStack");
private string FailFile => Path.Combine(_workDir, "failed.txt");
// Every OnLog line, verbatim, written to disk as it happens - this exists
// specifically because the terminal window scrolls past faster than anyone
// can read exit codes off it, and failed.txt only ever captured the handful
// of things that called Fail(), not the full "attempt 1... attempt 2..."
// trail. One timestamped file per run, so a previous run's log is never
// overwritten by the next one. MainForm reads this back via LogFilePath.
private string? _logFilePath;
public string? LogFilePath => _logFilePath;
// The folder logs are kept in: Documents\GamingStack\logs, so people can find them.
public static string LogsFolder => Path.Combine(
Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "GamingStack", "logs");
// ---- live progress (read by the installer screen) and cancel ----
private DateTime _runStamp = DateTime.Now;
private volatile bool _cancelRequested;
public bool CancelRequested => _cancelRequested;
public string? CurrentActivity { get; private set; }
public int ItemsDone { get; private set; }
public int ItemsTotal { get; private set; }
/// <summary>Asks the run to stop after the item it is on. Nothing is rolled back; tweaks and
/// app removals that had not started yet are skipped.</summary>
public void RequestCancel()
{
if (_cancelRequested) return;
_cancelRequested = true;
Log("The user asked to stop - finishing the current item, then skipping everything else.");
}
// ---- gaming tweaks: disclosed before they happen, reversible after ----
// Set once ApplyTweaks() actually runs (i.e. the user said yes at the
// wizard's "Apply these tweaks?" prompt) - the summary screen reads these
// rather than assuming tweaks always ran, which is exactly the bug this
// whole section exists to fix (see ROADMAP.md's disclosed/reversible rule).
public bool TweaksApplied { get; private set; }
public string? TweaksRevertFilePath { get; private set; }
/// <summary>
/// One tweak GamingStack can apply, with its real current value and what it
/// would change to - built for the wizard's consent screen so nothing is a
/// surprise. Read-only: calling this never changes anything on the machine.
/// </summary>
public readonly record struct TweakPreview(string Name, string Current, string NewValue);
/// <summary>
/// Which power plan the "Power plan" tweak targets - answered once on the
/// wizard's ChoosePowerPlan screen, right before the tweaks it feeds into
/// PreviewTweaks/ApplyTweaks so the preview always matches what will actually
/// run. Ultimate is the hidden, more aggressive plan Microsoft ships but
/// doesn't surface in Settings by default.
/// </summary>
public enum PowerPlanChoice { High, Ultimate }
// Microsoft's own fixed template GUID for the hidden "Ultimate Performance"
// plan - documented in Microsoft's own Tech Community post introducing it.
// `powercfg -duplicatescheme` against this GUID creates a real, visible,
// switchable copy of it (Windows doesn't let you activate the hidden
// template directly on modern builds - it has to be duplicated first).
private const string UltimatePerformanceTemplateGuid = "e9a42b02-d5df-448d-aa00-03f14749eb61";
public const string CapturesTweakName = "Captures folder (Game Bar clips)";
public const string ScreenshotsTweakName = "Screenshots folder (Win+PrtScn)";
public static List<TweakPreview> PreviewTweaks(TweakOptions options)
{
var powerPlanChoice = options.PowerPlan;
var gaming = options.Profile == SetupProfile.Gaming;
var developer = options.Profile == SetupProfile.Developer;
var list = new List<TweakPreview>();
if (gaming)
{
string gameMode;
try
{
using var key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\GameBar");
var val = key?.GetValue("AllowAutoGameMode");
gameMode = val == null ? "not set (Windows default)" : (Convert.ToInt32(val) == 1 ? "enabled" : "disabled");
}
catch { gameMode = "unknown"; }
list.Add(new TweakPreview("Game Mode", gameMode, "enabled"));
string hags;
try
{
using var key = Registry.LocalMachine.OpenSubKey(@"SYSTEM\CurrentControlSet\Control\GraphicsDrivers");
var val = key?.GetValue("HwSchMode");
hags = val == null ? "not set (Windows default: off)" : (Convert.ToInt32(val) == 2 ? "on" : "off");
}
catch { hags = "unknown"; }
list.Add(new TweakPreview("Hardware-accelerated GPU scheduling", hags, "on"));
var (_, planName) = GetActivePowerScheme();
var powerPlanTarget = powerPlanChoice == PowerPlanChoice.Ultimate ? "Ultimate Performance" : "High performance";
list.Add(new TweakPreview("Power plan", planName ?? "unknown", powerPlanTarget));
}
try
{
using var key = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced");
var val = key?.GetValue("HideFileExt");
var current = val == null ? "hidden (Windows default)" : (Convert.ToInt32(val) == 0 ? "shown" : "hidden");
list.Add(new TweakPreview("File extensions", current, "shown"));
}
catch { list.Add(new TweakPreview("File extensions", "unknown", "shown")); }
try
{
using var key = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced");
var val = key?.GetValue("Hidden");
var current = val == null ? "hidden (Windows default)" : (Convert.ToInt32(val) == 1 ? "shown" : "hidden");
list.Add(new TweakPreview("Hidden files", current, "shown"));
}
catch { list.Add(new TweakPreview("Hidden files", "unknown", "shown")); }
try
{
var exists = Registry.CurrentUser.OpenSubKey(ClassicContextMenuKeyPath) != null;
list.Add(new TweakPreview("Right-click context menu", exists ? "already classic" : "modern (Windows 11 default)", "classic (full menu, no \"Show more options\")"));
}
catch { list.Add(new TweakPreview("Right-click context menu", "unknown", "classic")); }
try
{
using var key = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced");
var val = key?.GetValue("TaskbarDa");
var current = val == null ? "shown (Windows default)" : (Convert.ToInt32(val) == 0 ? "hidden" : "shown");
list.Add(new TweakPreview("Taskbar widgets button", current, "hidden"));
}
catch { list.Add(new TweakPreview("Taskbar widgets button", "unknown", "hidden")); }
try
{
using var key = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Search");
var val = key?.GetValue("SearchboxTaskbarMode");
var current = val == null ? "shown (Windows default)" : (Convert.ToInt32(val) == 0 ? "hidden" : "shown");
list.Add(new TweakPreview("Taskbar search box", current, "hidden"));
}
catch { list.Add(new TweakPreview("Taskbar search box", "unknown", "hidden")); }
try
{
using var key = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced");
var val = key?.GetValue("ShowCopilotButton");
var current = val == null ? "shown (Windows default)" : (Convert.ToInt32(val) == 0 ? "hidden" : "shown");
list.Add(new TweakPreview("Taskbar Copilot button", current, "hidden"));
}
catch { list.Add(new TweakPreview("Taskbar Copilot button", "unknown", "hidden")); }
if (gaming) try
{
using var key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile");
var val = key?.GetValue("SystemResponsiveness");
var current = val == null ? "20% (Windows default)" : $"{Convert.ToInt32(val)}%";
list.Add(new TweakPreview("Background task CPU reservation (MMCSS)", current, "0% (games get full priority)"));
}
catch { list.Add(new TweakPreview("Background task CPU reservation (MMCSS)", "unknown", "0%")); }
try
{
using var key = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager");
var suggestions = key?.GetValue("SystemPaneSuggestionsEnabled");
var ads = key?.GetValue("SubscribedContent-338388Enabled");
var current = (suggestions == null && ads == null)
? "shown (Windows default)"
: ((suggestions == null || Convert.ToInt32(suggestions) == 1) || (ads == null || Convert.ToInt32(ads) == 1) ? "shown" : "hidden");
list.Add(new TweakPreview("Start menu suggestions/ads", current, "hidden"));
}
catch { list.Add(new TweakPreview("Start menu suggestions/ads", "unknown", "hidden")); }
if (gaming) try
{
using var key = Registry.LocalMachine.OpenSubKey(@"SYSTEM\CurrentControlSet\Control\Session Manager\Power");
var val = key?.GetValue("HiberbootEnabled");
var current = val == null ? "on (Windows default)" : (Convert.ToInt32(val) == 1 ? "on" : "off");
list.Add(new TweakPreview("Fast Startup", current, "off"));
}
catch { list.Add(new TweakPreview("Fast Startup", "unknown", "off")); }
if (gaming) try
{
using var key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\WindowsUpdate\UX\Settings");
var start = key?.GetValue("ActiveHoursStart");
var end = key?.GetValue("ActiveHoursEnd");
var current = (start == null && end == null)
? "08:00-17:00 (Windows default)"
: $"{Convert.ToInt32(start ?? 8):D2}:00-{Convert.ToInt32(end ?? 17):D2}:00";
list.Add(new TweakPreview("Windows Update active hours", current, "16:00-23:00 (typical evening gaming window)"));
}
catch { list.Add(new TweakPreview("Windows Update active hours", "unknown", "16:00-23:00")); }
if (gaming) try
{
using var key = Registry.CurrentUser.OpenSubKey(@"System\GameConfigStore");
var val = key?.GetValue("GameDVR_Enabled");
var current = val == null ? "enabled (Windows default)" : (Convert.ToInt32(val) == 1 ? "enabled" : "disabled");
list.Add(new TweakPreview("Xbox Game Bar / Game DVR", current, "disabled"));
}
catch { list.Add(new TweakPreview("Xbox Game Bar / Game DVR", "unknown", "disabled")); }
if (gaming) try
{
var ifacePath = GetActiveNetworkInterfaceRegistryPath();
if (ifacePath == null)
{
list.Add(new TweakPreview("Network latency (Nagle's algorithm)", "no active network adapter found", "disabled"));
}
else
{
using var key = Registry.LocalMachine.OpenSubKey(ifacePath);
var ack = key?.GetValue("TcpAckFrequency");
var noDelay = key?.GetValue("TCPNoDelay");
var current = (ack == null && noDelay == null)
? "not set (Windows default, Nagle's algorithm enabled)"
: (Convert.ToInt32(ack) == 1 && Convert.ToInt32(noDelay) == 1 ? "disabled" : "partially set");
list.Add(new TweakPreview("Network latency (Nagle's algorithm)", current, "disabled"));
}
}
catch { list.Add(new TweakPreview("Network latency (Nagle's algorithm)", "unknown", "disabled")); }
if (gaming) try
{
using var key = Registry.CurrentUser.OpenSubKey(@"Control Panel\Mouse");
var speed = key?.GetValue("MouseSpeed") as string;
var current = speed == null ? "enabled (Windows default)" : (speed == "0" ? "disabled" : "enabled");
list.Add(new TweakPreview("Mouse acceleration (\"Enhance pointer precision\")", current, "disabled"));
}
catch { list.Add(new TweakPreview("Mouse acceleration (\"Enhance pointer precision\")", "unknown", "disabled")); }
if (gaming) try
{
var (ac, dc) = GetPowerSettingValueIndex("SCHEME_CURRENT", CoreParkingSubgroupGuid, CoreParkingSettingGuid);
var current = (ac == null && dc == null) ? "not set (Windows default - cores may park when idle)" : $"{ac ?? dc}% minimum unparked";
list.Add(new TweakPreview("CPU core parking (minimum unparked)", current, "0% (all cores stay available)"));
}
catch { list.Add(new TweakPreview("CPU core parking (minimum unparked)", "unknown", "0%")); }
if (gaming) try
{
using var key = Registry.LocalMachine.OpenSubKey(@"SYSTEM\CurrentControlSet\Control\PriorityControl");
var val = key?.GetValue("Win32PrioritySeparation");
var current = val == null ? "2 (Windows default)" : $"{Convert.ToInt32(val)}";
list.Add(new TweakPreview("Foreground app priority (Win32PrioritySeparation)", current, "26 (short, fixed, high foreground boost)"));
}
catch { list.Add(new TweakPreview("Foreground app priority (Win32PrioritySeparation)", "unknown", "26")); }
try
{
using var key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Policies\Microsoft\Windows\DeliveryOptimization");
var val = key?.GetValue("DODownloadMode");
var current = val == null ? "not set (Windows default - peer sharing may be used)" : $"{Convert.ToInt32(val)}";
list.Add(new TweakPreview("Delivery Optimization (P2P update sharing)", current, "0 (HTTP only, no peer-to-peer)"));
}
catch { list.Add(new TweakPreview("Delivery Optimization (P2P update sharing)", "unknown", "0")); }
try
{
using var key = Registry.LocalMachine.OpenSubKey(@"SYSTEM\CurrentControlSet\Services\DiagTrack");
var val = key?.GetValue("Start");
var current = val == null ? "unknown" : Convert.ToInt32(val) switch
{
2 => "automatic",
3 => "manual",
4 => "disabled",
_ => "unknown"
};
list.Add(new TweakPreview("Telemetry (DiagTrack service)", current, "disabled"));
}
catch { list.Add(new TweakPreview("Telemetry (DiagTrack service)", "unknown", "disabled")); }
if (!string.IsNullOrWhiteSpace(options.CapturesPath))
{
list.Add(new TweakPreview(CapturesTweakName, CapturesFolder.GetPath(CapturesFolder.CapturesId) ?? "unknown", options.CapturesPath!));
list.Add(new TweakPreview(ScreenshotsTweakName, CapturesFolder.GetPath(CapturesFolder.ScreenshotsId) ?? "unknown", CapturesFolder.ScreenshotsFor(options.CapturesPath!)));
}
if (developer)
{
try
{
using var key = Registry.LocalMachine.OpenSubKey(@"SYSTEM\CurrentControlSet\Control\FileSystem");
var val = key?.GetValue("LongPathsEnabled");
var current = val == null ? "off (Windows default)" : (Convert.ToInt32(val) == 1 ? "on" : "off");
list.Add(new TweakPreview("Long file paths (over 260 characters)", current, "on"));
}
catch { list.Add(new TweakPreview("Long file paths (over 260 characters)", "unknown", "on")); }
try
{
using var key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock");
var val = key?.GetValue("AllowDevelopmentWithoutDevLicense");
var current = val == null ? "off (Windows default)" : (Convert.ToInt32(val) == 1 ? "on" : "off");
list.Add(new TweakPreview("Developer Mode", current, "on (lets you sideload and debug your own apps)"));
}
catch { list.Add(new TweakPreview("Developer Mode", "unknown", "on")); }
}
// Only shown when the user picked a provider on the ChooseDns screen -
// "Skip" means this row (and its change) simply doesn't exist.
if (options.Dns != DnsChoice.Skip)
{
var (_, label) = GetDnsServers(options.Dns);
try
{
var adapter = GetActiveAdapter();
list.Add(new TweakPreview("DNS servers (IPv4)", adapter == null
? "no active network adapter found"
: adapter.Describe(), label));
}
catch { list.Add(new TweakPreview("DNS servers (IPv4)", "unknown", label)); }
}
return list;
}
// ---- DNS ----
// The two IPv4 servers (primary, secondary) for each provider, plus the text
// the consent screen/log shows. IPv6 DNS is deliberately left alone.
private static (string[] Servers, string Label) GetDnsServers(DnsChoice choice) => choice switch
{
DnsChoice.Cloudflare => (new[] { "1.1.1.1", "1.0.0.1" }, "Cloudflare (1.1.1.1 / 1.0.0.1)"),
DnsChoice.Google => (new[] { "8.8.8.8", "8.8.4.4" }, "Google (8.8.8.8 / 8.8.4.4)"),
DnsChoice.Quad9 => (new[] { "9.9.9.9", "149.112.112.112" }, "Quad9 (9.9.9.9 / 149.112.112.112)"),
_ => (Array.Empty<string>(), "unchanged")
};
/// <summary>
/// The network adapter actually in use (has an IP and a default gateway), with
/// what its IPv4 DNS is set to right now. <see cref="StaticDns"/> is non-empty
/// only when someone set DNS by hand - empty means it comes from DHCP (the
/// router/ISP), which is what a revert has to put back.
/// </summary>
private sealed class ActiveAdapter
{
public string SettingId = "";
public string? ConnectionName;
public string[] EffectiveDns = Array.Empty<string>();
public string[] StaticDns = Array.Empty<string>();
public string Describe() =>
StaticDns.Length > 0
? $"custom ({string.Join(" / ", StaticDns)})"
: EffectiveDns.Length > 0
? $"automatic from your router ({string.Join(" / ", EffectiveDns)})"
: "automatic from your router";
}
private static ActiveAdapter? GetActiveAdapter()
{
try
{
using var searcher = new ManagementObjectSearcher(
"SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = True AND DefaultIPGateway IS NOT NULL");
foreach (var obj in searcher.Get())
{
var settingId = obj["SettingID"]?.ToString();
if (string.IsNullOrWhiteSpace(settingId)) continue;
var adapter = new ActiveAdapter
{
SettingId = settingId,
EffectiveDns = (obj["DNSServerSearchOrder"] as string[]) ?? Array.Empty<string>()
};
// A hand-set DNS list lives in the per-interface NameServer value;
// blank/missing means DHCP is supplying it.
using var key = Registry.LocalMachine.OpenSubKey(
$@"SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{settingId}");
var nameServer = key?.GetValue("NameServer") as string;
if (!string.IsNullOrWhiteSpace(nameServer))
adapter.StaticDns = nameServer.Split(new[] { ',', ' ' }, StringSplitOptions.RemoveEmptyEntries);
// The friendly connection name ("Ethernet", "Wi-Fi") is what netsh
// needs for the revert script; it lives on the Win32_NetworkAdapter
// twin of this config object.
var index = obj["InterfaceIndex"]?.ToString();
if (!string.IsNullOrWhiteSpace(index))
{
using var nameSearcher = new ManagementObjectSearcher(
$"SELECT NetConnectionID FROM Win32_NetworkAdapter WHERE InterfaceIndex = {index}");
foreach (var a in nameSearcher.Get())
{
adapter.ConnectionName = a["NetConnectionID"]?.ToString();
break;
}
}
return adapter;
}
}
catch { /* falls through to null below */ }
return null;
}
// Power setting GUIDs for the "Processor power management > Processor
// performance core parking min cores" setting - the documented way to stop
// Windows parking CPU cores when it thinks they're idle.
private const string CoreParkingSubgroupGuid = "54533251-82be-4824-96c1-47b60b740d00";
private const string CoreParkingSettingGuid = "0cc5b647-c1df-4637-891a-dec35c318583";
/// <summary>
/// Reads a power setting's current AC/DC value index via `powercfg /q`,
/// parsing the plain-text output - there's no WMI/registry shortcut for this,
/// `powercfg` is the documented way to read and write these. Returns (null,
/// null) if the setting can't be found or parsed (e.g. an unusual scheme).
/// </summary>
private static (int? Ac, int? Dc) GetPowerSettingValueIndex(string schemeGuid, string subgroupGuid, string settingGuid)
{
try
{
var psi = new ProcessStartInfo("powercfg", $"/q {schemeGuid} {subgroupGuid} {settingGuid}")
{
UseShellExecute = false,
RedirectStandardOutput = true,
CreateNoWindow = true
};
using var p = Process.Start(psi);
if (p == null) return (null, null);
var output = p.StandardOutput.ReadToEnd();
p.WaitForExit(3000);
var acMatch = System.Text.RegularExpressions.Regex.Match(output, @"Current AC Power Setting Index:\s*0x([0-9a-fA-F]+)");
var dcMatch = System.Text.RegularExpressions.Regex.Match(output, @"Current DC Power Setting Index:\s*0x([0-9a-fA-F]+)");
int? ac = acMatch.Success ? Convert.ToInt32(acMatch.Groups[1].Value, 16) : null;
int? dc = dcMatch.Success ? Convert.ToInt32(dcMatch.Groups[1].Value, 16) : null;
return (ac, dc);
}
catch
{
return (null, null);
}
}
/// <summary>
/// Fires a `powercfg` command and waits for it, ignoring output - used for
/// the apply-side core-parking/power-plan writes where we only care that it
/// ran, not what it printed (reads go through GetPowerSettingValueIndex).
/// </summary>
private static void RunPowercfg(string args)
{
try
{
var psi = new ProcessStartInfo("powercfg", args)
{
UseShellExecute = false,
CreateNoWindow = true
};
using var p = Process.Start(psi);
p?.WaitForExit(5000);
}
catch { /* best-effort; failure is surfaced by the caller's own catch */ }
}