-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExecutable Performance Manager.ps1
More file actions
1776 lines (1650 loc) · 98.3 KB
/
Executable Performance Manager.ps1
File metadata and controls
1776 lines (1650 loc) · 98.3 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
#Requires -Version 5.1
#https://github.com/insovs
if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
Start-Process powershell -ArgumentList "-NoProfile -ExecutionPolicy Bypass -WindowStyle Hidden -File `"$PSCommandPath`"" -Verb RunAs
exit
}
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass -Force
if (-not ('Hide.Win32' -as [type])) {
Add-Type -Name Win32 -Namespace Hide -MemberDefinition '
[DllImport("kernel32.dll")] public static extern IntPtr GetConsoleWindow();
[DllImport("user32.dll")] public static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);
' -ErrorAction SilentlyContinue
}
try { [Hide.Win32]::ShowWindow([Hide.Win32]::GetConsoleWindow(), 0) } catch {}
Add-Type -AssemblyName PresentationFramework, PresentationCore, WindowsBase, System.Xaml, System.Windows.Forms
$script:BrushConv = [System.Windows.Media.BrushConverter]::new()
function New-Brush { param([string]$hex); $script:BrushConv.ConvertFromString($hex) }
function ConvertFrom-XamlString {
param([string]$s)
$xr = [System.Xml.XmlReader]::Create([System.IO.StringReader]::new($s.Trim()))
return [System.Windows.Markup.XamlReader]::Load($xr)
}
$script:PrioBase = 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options'
$script:QosBase = 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\QoS'
$script:GpuBase = 'HKCU:\SOFTWARE\Microsoft\DirectX\UserGpuPreferences'
$script:LayersBase = 'HKCU:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers'
$script:FullscreenKey = 'HKCU:\System\GameConfigStore'
$script:GraphicsKey = 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile\Tasks\Games'
$splashXaml = @'
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Executable Performance Manager" Width="520" Height="620"
WindowStartupLocation="CenterScreen"
Background="Transparent" Foreground="#E8E8F0"
FontFamily="Segoe UI" WindowStyle="None"
AllowsTransparency="True" ResizeMode="NoResize">
<Window.Resources>
<Style x:Key="WinBtn" TargetType="Button">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Foreground" Value="#4B5563"/>
<Setter Property="FontSize" Value="12"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="Width" Value="30"/>
<Setter Property="Height" Value="26"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border x:Name="bd" Background="Transparent" CornerRadius="5">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="bd" Property="Background" Value="#222222"/>
<Setter Property="Foreground" Value="#9CA3AF"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="CloseBtn" TargetType="Button">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Foreground" Value="#4B5563"/>
<Setter Property="FontSize" Value="12"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="Width" Value="30"/>
<Setter Property="Height" Value="26"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border x:Name="bd" Background="Transparent" CornerRadius="5">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="bd" Property="Background" Value="#7F1D1D"/>
<Setter Property="Foreground" Value="#EF4444"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Window.Resources>
<Grid>
<Border CornerRadius="14" Background="#0A0A0A" BorderBrush="#1F1F1F" BorderThickness="1" Margin="2">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="46"/>
<RowDefinition Height="*"/>
<RowDefinition Height="52"/>
</Grid.RowDefinitions>
<Border Grid.Row="0" Background="#0F0F0F" CornerRadius="14,14,0,0" BorderBrush="#1F1F1F" BorderThickness="0,0,0,1" ClipToBounds="True">
<Grid Margin="14,0" VerticalAlignment="Center">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
<Image Source="https://raw.githubusercontent.com/insovs/credits/main/Optimizer.png" Width="46" Height="46" Margin="0,0,9,0" VerticalAlignment="Center" RenderOptions.BitmapScalingMode="HighQuality"/>
<TextBlock Text="EXECUTABLE PERFORMANCE MANAGER" FontSize="13" FontWeight="Bold" Foreground="#C8C8C8" VerticalAlignment="Center" Margin="0,2,0,0"/>
<Border x:Name="SplashGithubBadge" Background="#141414" BorderBrush="#272727" BorderThickness="1"
CornerRadius="5" Padding="7,3" Margin="10,0,0,0" VerticalAlignment="Center" Cursor="Hand">
<TextBlock Text="github / insovs" FontSize="9" Foreground="#444444"/>
</Border>
</StackPanel>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center">
<Button x:Name="SplashMinimize" Content="—" Style="{StaticResource WinBtn}"/>
<Button x:Name="SplashClose" Content="✕" Style="{StaticResource CloseBtn}" Margin="2,0,0,0"/>
</StackPanel>
</Grid>
</Border>
<StackPanel Grid.Row="1" VerticalAlignment="Top" Margin="28,16,28,0">
<StackPanel HorizontalAlignment="Center" Margin="0,0,0,10">
<Image Source="https://raw.githubusercontent.com/insovs/credits/main/Optimizer.png"
Width="64" Height="64" HorizontalAlignment="Center" Margin="0,0,0,8"
RenderOptions.BitmapScalingMode="HighQuality"/>
<TextBlock Text="Executable Performance Manager" FontSize="17" FontWeight="Bold" Foreground="#C8C8C8"
HorizontalAlignment="Center" Margin="0,0,0,4"/>
<TextBlock Text="System-level optimizations for games and applications" FontSize="9" Foreground="#C8C8C8"
HorizontalAlignment="Center" TextAlignment="Center" TextWrapping="Wrap"/>
</StackPanel>
<Border Background="#0F0F0F" BorderBrush="#1A1A1A" BorderThickness="1" CornerRadius="10" Padding="8,8" Margin="0,0,0,12">
<StackPanel>
<Grid Margin="0,0,0,5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="5"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Button x:Name="BtnGoToCpu" Grid.Column="0" Background="#0A0A0A" BorderBrush="#1A1A1A" BorderThickness="1" Cursor="Hand">
<Button.Template>
<ControlTemplate TargetType="Button">
<Border x:Name="bd" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="6" Padding="9,7">
<StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,0,0,2">
<Ellipse Width="5" Height="5" Fill="#22C55E" Margin="0,0,6,0" VerticalAlignment="Center"/>
<TextBlock Text="Priority" FontSize="10" FontWeight="SemiBold" Foreground="#555555"/>
<Border Background="#1A1A1A" BorderBrush="#2E2E2E" BorderThickness="1"
CornerRadius="4" Padding="5,1" Margin="6,0,0,0" VerticalAlignment="Center">
<TextBlock Text="Highly Recommended" FontSize="7" FontWeight="SemiBold" Foreground="#444444"/>
</Border>
</StackPanel>
<TextBlock Text="High CPU + IO priority, better performance." FontSize="9" Foreground="#333333" Margin="11,0,0,0"/>
</StackPanel>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="bd" Property="Background" Value="#111111"/>
<Setter TargetName="bd" Property="BorderBrush" Value="#22C55E"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Button.Template>
</Button>
<Button x:Name="BtnGoToQos" Grid.Column="2" Background="#0A0A0A" BorderBrush="#1A1A1A" BorderThickness="1" Cursor="Hand">
<Button.Template>
<ControlTemplate TargetType="Button">
<Border x:Name="bd" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="6" Padding="9,7">
<StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,0,0,2">
<Ellipse Width="5" Height="5" Fill="#22C55E" Margin="0,0,6,0" VerticalAlignment="Center"/>
<TextBlock Text="QoS Network" FontSize="10" FontWeight="SemiBold" Foreground="#555555"/>
<Border Background="#1A1A1A" BorderBrush="#2E2E2E" BorderThickness="1"
CornerRadius="4" Padding="5,1" Margin="6,0,0,0" VerticalAlignment="Center">
<TextBlock Text="Highly Recommended" FontSize="7" FontWeight="SemiBold" Foreground="#444444"/>
</Border>
</StackPanel>
<TextBlock Text="Prioritizes / give the highest network priority" FontSize="9" Foreground="#333333" Margin="11,0,0,0"/>
</StackPanel>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="bd" Property="Background" Value="#111111"/>
<Setter TargetName="bd" Property="BorderBrush" Value="#22C55E"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Button.Template>
</Button>
</Grid>
<Grid Margin="0,0,0,5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="5"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Button x:Name="BtnGoToFirewall" Grid.Column="0" Background="#0A0A0A" BorderBrush="#1A1A1A" BorderThickness="1" Cursor="Hand">
<Button.Template>
<ControlTemplate TargetType="Button">
<Border x:Name="bd" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="6" Padding="9,7">
<StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,0,0,2">
<Ellipse Width="5" Height="5" Fill="#22C55E" Margin="0,0,6,0" VerticalAlignment="Center"/>
<TextBlock Text="Firewall" FontSize="10" FontWeight="SemiBold" Foreground="#555555"/>
<Border Background="#1A1A1A" BorderBrush="#2E2E2E" BorderThickness="1"
CornerRadius="4" Padding="5,1" Margin="6,0,0,0" VerticalAlignment="Center">
<TextBlock Text="Highly Recommended" FontSize="7" FontWeight="SemiBold" Foreground="#444444"/>
</Border>
</StackPanel>
<TextBlock Text="Allow rules in + out via Windows Firewall." FontSize="9" Foreground="#333333" Margin="11,0,0,0"/>
</StackPanel>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="bd" Property="Background" Value="#111111"/>
<Setter TargetName="bd" Property="BorderBrush" Value="#22C55E"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Button.Template>
</Button>
<Button x:Name="BtnGoToDefender" Grid.Column="2" Background="#0A0A0A" BorderBrush="#1A1A1A" BorderThickness="1" Cursor="Hand">
<Button.Template>
<ControlTemplate TargetType="Button">
<Border x:Name="bd" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="6" Padding="9,7">
<StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,0,0,2">
<Ellipse Width="5" Height="5" Fill="#22C55E" Margin="0,0,6,0" VerticalAlignment="Center"/>
<TextBlock Text="Defender" FontSize="10" FontWeight="SemiBold" Foreground="#555555"/>
<Border Background="#1A1A1A" BorderBrush="#2E2E2E" BorderThickness="1"
CornerRadius="4" Padding="5,1" Margin="6,0,0,0" VerticalAlignment="Center">
<TextBlock Text="Highly Recommended" FontSize="7" FontWeight="SemiBold" Foreground="#444444"/>
</Border>
</StackPanel>
<TextBlock Text="Excludes game folder from Defender scans." FontSize="9" Foreground="#333333" Margin="11,0,0,0"/>
</StackPanel>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="bd" Property="Background" Value="#111111"/>
<Setter TargetName="bd" Property="BorderBrush" Value="#22C55E"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Button.Template>
</Button>
</Grid>
<Grid Margin="0,0,0,5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="5"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Button x:Name="BtnGoToGpu" Grid.Column="0" Background="#0A0A0A" BorderBrush="#1A1A1A" BorderThickness="1" Cursor="Hand">
<Button.Template>
<ControlTemplate TargetType="Button">
<Border x:Name="bd" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="6" Padding="9,7">
<StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,0,0,2">
<Ellipse Width="5" Height="5" Fill="#22C55E" Margin="0,0,6,0" VerticalAlignment="Center"/>
<TextBlock Text="GPU Preference" FontSize="10" FontWeight="SemiBold" Foreground="#555555"/>
</StackPanel>
<TextBlock Text="Always uses the discrete GPU." FontSize="9" Foreground="#333333" Margin="11,0,0,0"/>
</StackPanel>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="bd" Property="Background" Value="#111111"/>
<Setter TargetName="bd" Property="BorderBrush" Value="#22C55E"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Button.Template>
</Button>
<Button x:Name="BtnGoToAdmin" Grid.Column="2" Background="#0A0A0A" BorderBrush="#1A1A1A" BorderThickness="1" Cursor="Hand">
<Button.Template>
<ControlTemplate TargetType="Button">
<Border x:Name="bd" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="6" Padding="9,7">
<StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,0,0,2">
<Ellipse Width="5" Height="5" Fill="#22C55E" Margin="0,0,6,0" VerticalAlignment="Center"/>
<TextBlock Text="Run As Admin" FontSize="10" FontWeight="SemiBold" Foreground="#555555"/>
</StackPanel>
<TextBlock Text="Runs as administrator for better compatibility." FontSize="9" Foreground="#333333" Margin="11,0,0,0"/>
</StackPanel>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="bd" Property="Background" Value="#111111"/>
<Setter TargetName="bd" Property="BorderBrush" Value="#22C55E"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Button.Template>
</Button>
</Grid>
<Button x:Name="BtnGoToFullscreen" Background="#0A0A0A" BorderBrush="#1A1A1A" BorderThickness="1" Cursor="Hand" HorizontalAlignment="Stretch">
<Button.Template>
<ControlTemplate TargetType="Button">
<Border x:Name="bd" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="6" Padding="9,7">
<StackPanel HorizontalAlignment="Center">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,0,0,2">
<Ellipse Width="5" Height="5" Fill="#22C55E" Margin="0,0,6,0" VerticalAlignment="Center"/>
<TextBlock Text="Fullscreen Optimization" FontSize="10" FontWeight="SemiBold" Foreground="#555555"/>
</StackPanel>
<TextBlock Text="Forces true exclusive fullscreen to cut input lag." FontSize="9" Foreground="#555555" TextAlignment="Center"/>
</StackPanel>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="bd" Property="Background" Value="#111111"/>
<Setter TargetName="bd" Property="BorderBrush" Value="#22C55E"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Button.Template>
</Button>
</StackPanel>
</Border>
<Border Background="#0D0D0D" BorderBrush="#1A1A1A" BorderThickness="1" CornerRadius="10" Padding="14,11" Margin="0,8,0,0">
<StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,0,0,8">
<Border Background="#1A1A1A" CornerRadius="4" Width="20" Height="20" Margin="0,0,8,0" VerticalAlignment="Center">
<TextBlock Text="i" FontSize="11" FontWeight="Bold" Foreground="#3B82F6" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<TextBlock Text="Why use this tool ?" FontSize="11" FontWeight="Bold" Foreground="#444444" VerticalAlignment="Center"/>
</StackPanel>
<TextBlock TextWrapping="Wrap" Foreground="#555555" FontSize="10" LineHeight="17"> This tool applies low-level system rules so your executable gets more CPU time, faster disk access, higher network priority, and a direct path to your GPU. The result: less stutter, lower input lag, and fewer background interruptions.</TextBlock>
</StackPanel>
</Border>
</StackPanel>
<Border Grid.Row="2" Background="#0F0F0F" CornerRadius="0,0,14,14" BorderBrush="#1F1F1F" BorderThickness="0,1,0,0">
<Grid Margin="20,0">
<TextBlock Text="https://github.com/insovs/Executable-Performance-Manager" FontSize="9" Foreground="#333333"
FontFamily="Consolas" VerticalAlignment="Center"/>
<Border x:Name="SplashMoreInfoBtn" Background="#141414" BorderBrush="#272727" BorderThickness="1"
CornerRadius="5" Padding="8,4" HorizontalAlignment="Right" VerticalAlignment="Center" Cursor="Hand">
<TextBlock Text="More about this" FontSize="9" Foreground="#444444"/>
</Border>
</Grid>
</Border>
</Grid>
</Border>
</Grid>
</Window>
'@
do {
$splash = ConvertFrom-XamlString $splashXaml
$splash.Add_MouseLeftButtonDown({
param($s,$e)
$src = $e.OriginalSource
if (-not ($src -is [System.Windows.Controls.Primitives.ButtonBase])) {
$splash.DragMove()
}
})
$splashClose = $splash.FindName('SplashClose')
$splashMinimize = $splash.FindName('SplashMinimize')
$splashGithubBadge = $splash.FindName('SplashGithubBadge')
$splashGithubBadge.Add_MouseLeftButtonDown({ Start-Process 'https://github.com/insovs' })
$splashGithubBadge.Add_MouseEnter({ $splashGithubBadge.Background = New-Brush '#1A1A1A' })
$splashGithubBadge.Add_MouseLeave({ $splashGithubBadge.Background = New-Brush '#141414' })
$script:ReturnToDashboard = $false
$script:ShouldLaunch = $false
$script:StartPage = 'PageCpu'
$script:StartNav = 'NavCpu'
$script:StartLoad = 'Load-CpuRules'
$splashClose.Add_Click({ $splash.Close() })
$splashMinimize.Add_Click({ $splash.WindowState = [System.Windows.WindowState]::Minimized })
$splashMoreInfo = $splash.FindName('SplashMoreInfoBtn')
$splashMoreInfo.Add_MouseLeftButtonDown({ Start-Process 'https://github.com/insovs/Executable-Performance-Manager' })
$splashMoreInfo.Add_MouseEnter({ $splashMoreInfo.Background = New-Brush '#1A1A1A' })
$splashMoreInfo.Add_MouseLeave({ $splashMoreInfo.Background = New-Brush '#141414' })
function Invoke-SplashNav { param([string]$page,[string]$nav,[string]$load)
$script:StartPage = $page; $script:StartNav = $nav; $script:StartLoad = $load
$script:ShouldLaunch = $true; $splash.Close()
}
$splash.FindName('BtnGoToCpu').Add_Click( { Invoke-SplashNav 'PageCpu' 'NavCpu' 'Load-CpuRules' })
$splash.FindName('BtnGoToQos').Add_Click( { Invoke-SplashNav 'PageQos' 'NavQos' 'Load-QosRules' })
$splash.FindName('BtnGoToGpu').Add_Click( { Invoke-SplashNav 'PageGpu' 'NavGpu' 'Load-GpuRules' })
$splash.FindName('BtnGoToAdmin').Add_Click( { Invoke-SplashNav 'PageAdmin' 'NavAdmin' 'Load-AdminRules' })
$splash.FindName('BtnGoToFirewall').Add_Click( { Invoke-SplashNav 'PageFirewall' 'NavFirewall' '' })
$splash.FindName('BtnGoToDefender').Add_Click( { Invoke-SplashNav 'PageDefender' 'NavDefender' 'Load-DefenderRules' })
$splash.FindName('BtnGoToFullscreen').Add_Click( { Invoke-SplashNav 'PageFullscreen' 'NavFullscreen' 'Load-FsoRules' })
$splash.ShowDialog() | Out-Null
if (-not $script:ShouldLaunch) { exit }
$xaml = @'
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Executable Performance Manager" Width="560" Height="660"
MinWidth="480" MinHeight="520"
WindowStartupLocation="CenterScreen"
Background="Transparent" Foreground="#E8E8F0"
FontFamily="Segoe UI" WindowStyle="None"
AllowsTransparency="True" ResizeMode="CanResize">
<Window.Resources>
<Style x:Key="NavBtn" TargetType="Button">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Foreground" Value="#333333"/>
<Setter Property="FontSize" Value="11"/>
<Setter Property="FontWeight" Value="SemiBold"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="HorizontalContentAlignment" Value="Left"/>
<Setter Property="Padding" Value="12,0"/>
<Setter Property="Height" Value="36"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border x:Name="bd" Background="{TemplateBinding Background}" CornerRadius="7" Padding="{TemplateBinding Padding}">
<ContentPresenter VerticalAlignment="Center"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="bd" Property="Background" Value="#111111"/>
<Setter Property="Foreground" Value="#555555"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="NavBtnActive" TargetType="Button">
<Setter Property="Background" Value="#111111"/>
<Setter Property="Foreground" Value="#AAAAAA"/>
<Setter Property="FontSize" Value="11"/>
<Setter Property="FontWeight" Value="SemiBold"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="HorizontalContentAlignment" Value="Left"/>
<Setter Property="Padding" Value="12,0"/>
<Setter Property="Height" Value="36"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border x:Name="bd" Background="{TemplateBinding Background}" CornerRadius="7" Padding="{TemplateBinding Padding}">
<ContentPresenter VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="BigBtn" TargetType="Button">
<Setter Property="Background" Value="#2A2A2A"/>
<Setter Property="Foreground" Value="#D0D0D0"/>
<Setter Property="FontSize" Value="13"/>
<Setter Property="FontWeight" Value="Bold"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="BorderBrush" Value="#3A3A3A"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border x:Name="bd" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="9" Padding="{TemplateBinding Padding}">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="bd" Property="Background" Value="#333333"/>
<Setter TargetName="bd" Property="BorderBrush" Value="#505050"/>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter TargetName="bd" Property="Background" Value="#1E1E1E"/>
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter TargetName="bd" Property="Background" Value="#161616"/>
<Setter TargetName="bd" Property="BorderBrush" Value="#222222"/>
<Setter Property="Foreground" Value="#303030"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="DelBtn" TargetType="Button">
<Setter Property="Background" Value="#1A1A1A"/>
<Setter Property="Foreground" Value="#4B5563"/>
<Setter Property="FontSize" Value="11"/>
<Setter Property="FontWeight" Value="SemiBold"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="BorderBrush" Value="#2A2A2A"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border x:Name="bd" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="6" Padding="{TemplateBinding Padding}">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="bd" Property="Background" Value="#450A0A"/>
<Setter TargetName="bd" Property="BorderBrush" Value="#7F1D1D"/>
<Setter Property="Foreground" Value="#FCA5A5"/>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter TargetName="bd" Property="Background" Value="#7F1D1D"/>
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter TargetName="bd" Property="Background" Value="#111111"/>
<Setter TargetName="bd" Property="BorderBrush" Value="#1E1E1E"/>
<Setter Property="Foreground" Value="#252525"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="WinBtn" TargetType="Button">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Foreground" Value="#4B5563"/>
<Setter Property="FontSize" Value="12"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="Width" Value="30"/>
<Setter Property="Height" Value="26"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border x:Name="bd" Background="Transparent" CornerRadius="5">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="bd" Property="Background" Value="#222222"/>
<Setter Property="Foreground" Value="#9CA3AF"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="CloseBtn" TargetType="Button">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Foreground" Value="#4B5563"/>
<Setter Property="FontSize" Value="12"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="Width" Value="30"/>
<Setter Property="Height" Value="26"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border x:Name="bd" Background="Transparent" CornerRadius="5">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="bd" Property="Background" Value="#7F1D1D"/>
<Setter Property="Foreground" Value="#EF4444"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="ScrollBar">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Width" Value="4"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ScrollBar">
<Grid>
<Track x:Name="PART_Track" IsDirectionReversed="True">
<Track.Thumb>
<Thumb>
<Thumb.Template>
<ControlTemplate TargetType="Thumb">
<Border Background="#2D2D2D" CornerRadius="2"/>
</ControlTemplate>
</Thumb.Template>
</Thumb>
</Track.Thumb>
</Track>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Window.Resources>
<Grid>
<Border CornerRadius="14" Background="#0A0A0A" BorderBrush="#1F1F1F" BorderThickness="1" Margin="2">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="46"/>
<RowDefinition Height="*"/>
<RowDefinition Height="42"/>
</Grid.RowDefinitions>
<Border Grid.Row="0" Background="#0F0F0F" CornerRadius="14,14,0,0" BorderBrush="#1F1F1F" BorderThickness="0,0,0,1">
<Grid Margin="14,0">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
<Image Source="https://raw.githubusercontent.com/insovs/credits/main/Optimizer.png" Width="36" Height="36" Margin="0,0,9,0" VerticalAlignment="Center" RenderOptions.BitmapScalingMode="HighQuality"/>
<TextBlock Text="EXECUTABLE PERFORMANCE MANAGER" FontSize="13" FontWeight="Bold" Foreground="#C8C8C8" VerticalAlignment="Center" Margin="0,2,0,0"/>
<Border x:Name="GithubBtn" Background="#141414" BorderBrush="#272727" BorderThickness="1"
CornerRadius="5" Padding="7,3" Margin="10,0,0,0" Cursor="Hand" VerticalAlignment="Center">
<TextBlock Text="github / insovs" FontSize="9" Foreground="#666666"/>
</Border>
</StackPanel>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center">
<Button x:Name="BtnMinimize" Content="—" Style="{StaticResource WinBtn}"/>
<Button x:Name="BtnClose" Content="✕" Style="{StaticResource CloseBtn}" Margin="2,0,0,0"/>
</StackPanel>
</Grid>
</Border>
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="148"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Border Grid.Column="0" Background="#0C0C0C" BorderBrush="#1A1A1A" BorderThickness="0,0,1,0">
<StackPanel Margin="8,12,8,0">
<Button x:Name="NavDashboard" Content="Dashboard" Style="{StaticResource NavBtn}" Margin="0,0,0,6"/>
<Rectangle Height="1" Fill="#1A1A1A" Margin="4,0,4,6"/>
<Button x:Name="NavCpu" Content="CPU Priority" Style="{StaticResource NavBtnActive}" Margin="0,0,0,2"/>
<Button x:Name="NavQos" Content="QoS Network" Style="{StaticResource NavBtn}" Margin="0,0,0,2"/>
<Button x:Name="NavGpu" Content="GPU Preference" Style="{StaticResource NavBtn}" Margin="0,0,0,2"/>
<Button x:Name="NavAdmin" Content="Run As Admin" Style="{StaticResource NavBtn}" Margin="0,0,0,2"/>
<Button x:Name="NavFirewall" Content="Firewall" Style="{StaticResource NavBtn}" Margin="0,0,0,2"/>
<Button x:Name="NavDefender" Content="Defender" Style="{StaticResource NavBtn}" Margin="0,0,0,2"/>
<Button x:Name="NavFullscreen" Content="Fullscreen" Style="{StaticResource NavBtn}" Margin="0,0,0,2"/>
</StackPanel>
</Border>
<ScrollViewer Grid.Column="1" x:Name="PageScrollViewer" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled">
<StackPanel x:Name="PageHost" Margin="14,12,14,10">
<StackPanel x:Name="PageCpu">
<Border Background="#111111" BorderBrush="#1F1F1F" BorderThickness="1" CornerRadius="10" Padding="14,11" Margin="0,0,0,10">
<StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,0,0,5">
<Border Background="#1E1E1E" CornerRadius="4" Width="20" Height="20" Margin="0,0,8,0" VerticalAlignment="Center">
<TextBlock Text="?" FontSize="11" FontWeight="Bold" Foreground="#888888" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<TextBlock Text="What is CPU priority ?" FontSize="12" FontWeight="Bold" Foreground="#666666" VerticalAlignment="Center"/>
</StackPanel>
<TextBlock TextWrapping="Wrap" Foreground="#3A3A3A" FontSize="11" LineHeight="17">
Sets CpuPriorityClass=3 (High) and IoPriority=3 (High) via Image File Execution Options. Windows will schedule the process with elevated CPU and disk access priority at every launch.
</TextBlock>
</StackPanel>
</Border>
<Button x:Name="BtnCpuBrowse" Content="+ Add a game or app" Style="{StaticResource BigBtn}" Padding="0,13" Margin="0,0,0,12"/>
<Grid Margin="0,0,0,6">
<TextBlock Text="ACTIVE RULES" FontSize="10" FontWeight="Bold" Foreground="#2E2E2E" VerticalAlignment="Center"/>
<Button x:Name="BtnCpuDelete" Content="Delete selected" Style="{StaticResource DelBtn}" Padding="10,5" HorizontalAlignment="Right" IsEnabled="False"/>
</Grid>
<Border Background="#111111" CornerRadius="10" BorderBrush="#1F1F1F" BorderThickness="1" MinHeight="70">
<Grid>
<StackPanel x:Name="CpuEmpty" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0,18,0,18">
<TextBlock Text="No rules yet" Foreground="#222222" FontSize="13" FontWeight="SemiBold" HorizontalAlignment="Center"/>
<TextBlock Text="Add your first app above" Foreground="#1A1A1A" FontSize="10" HorizontalAlignment="Center" Margin="0,3,0,0"/>
</StackPanel>
<StackPanel x:Name="CpuList" Margin="8,6,8,6"/>
</Grid>
</Border>
</StackPanel>
<StackPanel x:Name="PageQos" Visibility="Collapsed">
<Border Background="#111111" BorderBrush="#1F1F1F" BorderThickness="1" CornerRadius="10" Padding="14,11" Margin="0,0,0,10">
<StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,0,0,5">
<Border Background="#1E1E1E" CornerRadius="4" Width="20" Height="20" Margin="0,0,8,0" VerticalAlignment="Center">
<TextBlock Text="?" FontSize="11" FontWeight="Bold" Foreground="#888888" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<TextBlock Text="What is a QoS rule ?" FontSize="12" FontWeight="Bold" Foreground="#666666" VerticalAlignment="Center"/>
</StackPanel>
<TextBlock TextWrapping="Wrap" Foreground="#3A3A3A" FontSize="11" LineHeight="17">
Gives an app the highest network priority via DSCP 46. Windows and your router process its packets first, reducing ping spikes and jitter when other apps are active on the network.
</TextBlock>
</StackPanel>
</Border>
<Button x:Name="BtnQosBrowse" Content="+ Add a game or app" Style="{StaticResource BigBtn}" Padding="0,13" Margin="0,0,0,12"/>
<Grid Margin="0,0,0,6">
<TextBlock Text="ACTIVE RULES" FontSize="10" FontWeight="Bold" Foreground="#2E2E2E" VerticalAlignment="Center"/>
<Button x:Name="BtnQosDelete" Content="Delete selected" Style="{StaticResource DelBtn}" Padding="10,5" HorizontalAlignment="Right" IsEnabled="False"/>
</Grid>
<Border Background="#111111" CornerRadius="10" BorderBrush="#1F1F1F" BorderThickness="1" MinHeight="70">
<Grid>
<StackPanel x:Name="QosEmpty" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0,18,0,18">
<TextBlock Text="No rules yet" Foreground="#222222" FontSize="13" FontWeight="SemiBold" HorizontalAlignment="Center"/>
<TextBlock Text="Add your first app above" Foreground="#1A1A1A" FontSize="10" HorizontalAlignment="Center" Margin="0,3,0,0"/>
</StackPanel>
<StackPanel x:Name="QosList" Margin="8,6,8,6"/>
</Grid>
</Border>
</StackPanel>
<StackPanel x:Name="PageGpu" Visibility="Collapsed">
<Border Background="#111111" BorderBrush="#1F1F1F" BorderThickness="1" CornerRadius="10" Padding="14,11" Margin="0,0,0,10">
<StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,0,0,5">
<Border Background="#1E1E1E" CornerRadius="4" Width="20" Height="20" Margin="0,0,8,0" VerticalAlignment="Center">
<TextBlock Text="?" FontSize="11" FontWeight="Bold" Foreground="#888888" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<TextBlock Text="What is GPU preference ?" FontSize="12" FontWeight="Bold" Foreground="#666666" VerticalAlignment="Center"/>
</StackPanel>
<TextBlock TextWrapping="Wrap" Foreground="#3A3A3A" FontSize="11" LineHeight="17">
Forces Windows to use the High Performance GPU for the selected app (GpuPreference=2). Useful on laptops with hybrid GPU setups to ensure the discrete GPU is always used.
</TextBlock>
</StackPanel>
</Border>
<Button x:Name="BtnGpuBrowse" Content="+ Add a game or app" Style="{StaticResource BigBtn}" Padding="0,13" Margin="0,0,0,12"/>
<Grid Margin="0,0,0,6">
<TextBlock Text="ACTIVE RULES" FontSize="10" FontWeight="Bold" Foreground="#2E2E2E" VerticalAlignment="Center"/>
<Button x:Name="BtnGpuDelete" Content="Delete selected" Style="{StaticResource DelBtn}" Padding="10,5" HorizontalAlignment="Right" IsEnabled="False"/>
</Grid>
<Border Background="#111111" CornerRadius="10" BorderBrush="#1F1F1F" BorderThickness="1" MinHeight="70">
<Grid>
<StackPanel x:Name="GpuEmpty" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0,18,0,18">
<TextBlock Text="No rules yet" Foreground="#222222" FontSize="13" FontWeight="SemiBold" HorizontalAlignment="Center"/>
<TextBlock Text="Add your first app above" Foreground="#1A1A1A" FontSize="10" HorizontalAlignment="Center" Margin="0,3,0,0"/>
</StackPanel>
<StackPanel x:Name="GpuList" Margin="8,6,8,6"/>
</Grid>
</Border>
</StackPanel>
<StackPanel x:Name="PageAdmin" Visibility="Collapsed">
<Border Background="#111111" BorderBrush="#1F1F1F" BorderThickness="1" CornerRadius="10" Padding="14,11" Margin="0,0,0,10">
<StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,0,0,5">
<Border Background="#1E1E1E" CornerRadius="4" Width="20" Height="20" Margin="0,0,8,0" VerticalAlignment="Center">
<TextBlock Text="?" FontSize="11" FontWeight="Bold" Foreground="#888888" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<TextBlock Text="What is Run As Admin ?" FontSize="12" FontWeight="Bold" Foreground="#666666" VerticalAlignment="Center"/>
</StackPanel>
<TextBlock TextWrapping="Wrap" Foreground="#3A3A3A" FontSize="11" LineHeight="17">
Configures the app to always launch with administrator privileges via AppCompatFlags and IFEO. Grants elevated rights for better compatibility and resource access. Note: some apps may refuse to launch with this set.
</TextBlock>
</StackPanel>
</Border>
<Button x:Name="BtnAdminBrowse" Content="+ Add a game or app" Style="{StaticResource BigBtn}" Padding="0,13" Margin="0,0,0,12"/>
<Grid Margin="0,0,0,6">
<TextBlock Text="ACTIVE RULES" FontSize="10" FontWeight="Bold" Foreground="#2E2E2E" VerticalAlignment="Center"/>
<Button x:Name="BtnAdminDelete" Content="Delete selected" Style="{StaticResource DelBtn}" Padding="10,5" HorizontalAlignment="Right" IsEnabled="False"/>
</Grid>
<Border Background="#111111" CornerRadius="10" BorderBrush="#1F1F1F" BorderThickness="1" MinHeight="70">
<Grid>
<StackPanel x:Name="AdminEmpty" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0,18,0,18">
<TextBlock Text="No rules yet" Foreground="#222222" FontSize="13" FontWeight="SemiBold" HorizontalAlignment="Center"/>
<TextBlock Text="Add your first app above" Foreground="#1A1A1A" FontSize="10" HorizontalAlignment="Center" Margin="0,3,0,0"/>
</StackPanel>
<StackPanel x:Name="AdminList" Margin="8,6,8,6"/>
</Grid>
</Border>
</StackPanel>
<StackPanel x:Name="PageFirewall" Visibility="Collapsed">
<Border Background="#111111" BorderBrush="#1F1F1F" BorderThickness="1" CornerRadius="10" Padding="14,11" Margin="0,0,0,10">
<StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,0,0,5">
<Border Background="#1E1E1E" CornerRadius="4" Width="20" Height="20" Margin="0,0,8,0" VerticalAlignment="Center">
<TextBlock Text="?" FontSize="11" FontWeight="Bold" Foreground="#888888" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<TextBlock Text="What are firewall rules ?" FontSize="12" FontWeight="Bold" Foreground="#666666" VerticalAlignment="Center"/>
</StackPanel>
<TextBlock TextWrapping="Wrap" Foreground="#3A3A3A" FontSize="11" LineHeight="17">
Adds explicit Inbound and Outbound Allow rules to Windows Firewall for the selected app. Prevents the firewall from blocking connections, reducing latency and packet loss.
</TextBlock>
</StackPanel>
</Border>
<Border Background="#111111" BorderBrush="#1F1F1F" BorderThickness="1" CornerRadius="10" Padding="14,12" Margin="0,0,0,10">
<StackPanel>
<TextBlock Text="ADD FIREWALL RULE" FontSize="10" FontWeight="Bold" Foreground="#2E2E2E" Margin="0,0,0,10"/>
<TextBlock Text="Allow app through firewall" FontSize="11" FontWeight="SemiBold" Foreground="#666666"/>
<TextBlock Text="Creates Inbound + Outbound Allow rules for the selected executable" FontSize="9" Foreground="#282828" Margin="0,2,0,10" TextWrapping="Wrap"/>
<Button x:Name="BtnFirewallBrowse" Content="+ Add app" Style="{StaticResource BigBtn}" Padding="0,8" HorizontalAlignment="Stretch"/>
</StackPanel>
</Border>
</StackPanel>
<StackPanel x:Name="PageDefender" Visibility="Collapsed">
<Border Background="#111111" BorderBrush="#1F1F1F" BorderThickness="1" CornerRadius="10" Padding="14,11" Margin="0,0,0,10">
<StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,0,0,5">
<Border Background="#1E1E1E" CornerRadius="4" Width="20" Height="20" Margin="0,0,8,0" VerticalAlignment="Center">
<TextBlock Text="?" FontSize="11" FontWeight="Bold" Foreground="#888888" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<TextBlock Text="What is a Defender exclusion ?" FontSize="12" FontWeight="Bold" Foreground="#666666" VerticalAlignment="Center"/>
</StackPanel>
<TextBlock TextWrapping="Wrap" Foreground="#3A3A3A" FontSize="11" LineHeight="17">
Adds the folder containing the selected executable to Windows Defender's exclusion list. Prevents real-time background scans from impacting game performance and causing stutter.
</TextBlock>
</StackPanel>
</Border>
<Border x:Name="DefenderWarningBanner" Visibility="Collapsed"
Background="#1A0A00" BorderBrush="#7C2D12" BorderThickness="1"
CornerRadius="10" Padding="14,11" Margin="0,0,0,10">
<StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,0,0,6">
<Border Background="#2D1000" CornerRadius="4" Width="20" Height="20" Margin="0,0,8,0" VerticalAlignment="Center">
<TextBlock Text="!" FontSize="11" FontWeight="Bold" Foreground="#F97316" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<TextBlock x:Name="DefenderWarningTitle" Text="Windows Defender unavailable" FontSize="12" FontWeight="Bold" Foreground="#F97316" VerticalAlignment="Center"/>
</StackPanel>
<TextBlock x:Name="DefenderWarningMsg" TextWrapping="Wrap" Foreground="#7C3A1A" FontSize="11" LineHeight="17" Margin="28,0,0,0"/>
</StackPanel>
</Border>
<Button x:Name="BtnDefenderBrowse" Content="+ Add a game or app" Style="{StaticResource BigBtn}" Padding="0,13" Margin="0,0,0,12"/>
<Grid Margin="0,0,0,6">
<TextBlock Text="ACTIVE EXCLUSIONS" FontSize="10" FontWeight="Bold" Foreground="#2E2E2E" VerticalAlignment="Center"/>
<Button x:Name="BtnDefenderDelete" Content="Delete selected" Style="{StaticResource DelBtn}" Padding="10,5" HorizontalAlignment="Right" IsEnabled="False"/>
</Grid>
<Border Background="#111111" CornerRadius="10" BorderBrush="#1F1F1F" BorderThickness="1" MinHeight="70">
<Grid>
<StackPanel x:Name="DefenderEmpty" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0,18,0,18">
<TextBlock Text="No exclusions yet" Foreground="#222222" FontSize="13" FontWeight="SemiBold" HorizontalAlignment="Center"/>
<TextBlock Text="Add your first app above" Foreground="#1A1A1A" FontSize="10" HorizontalAlignment="Center" Margin="0,3,0,0"/>
</StackPanel>
<StackPanel x:Name="DefenderList" Margin="8,6,8,6"/>
</Grid>
</Border>
</StackPanel>
<StackPanel x:Name="PageFullscreen" Visibility="Collapsed">
<Border Background="#111111" BorderBrush="#1F1F1F" BorderThickness="1" CornerRadius="10" Padding="14,11" Margin="0,0,0,10">
<StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,0,0,5">
<Border Background="#1E1E1E" CornerRadius="4" Width="20" Height="20" Margin="0,0,8,0" VerticalAlignment="Center">
<TextBlock Text="?" FontSize="11" FontWeight="Bold" Foreground="#888888" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<TextBlock Text="What is Fullscreen Optimization ?" FontSize="12" FontWeight="Bold" Foreground="#666666" VerticalAlignment="Center"/>
</StackPanel>
<TextBlock TextWrapping="Wrap" Foreground="#3A3A3A" FontSize="11" LineHeight="17">
Disables Windows Fullscreen Optimizations (FSO) and configures the system scheduler for gaming. FSO can cause input lag and frame pacing issues — disabling it forces true exclusive fullscreen for lower latency.
</TextBlock>
</StackPanel>
</Border>
<Button x:Name="BtnFsoBrowse" Content="+ Disable FSO for a specific app" Style="{StaticResource BigBtn}" Padding="0,13" Margin="0,0,0,12"/>
<Grid Margin="0,0,0,6">
<TextBlock Text="PER-APP FSO DISABLED" FontSize="10" FontWeight="Bold" Foreground="#2E2E2E" VerticalAlignment="Center"/>
<Button x:Name="BtnFsoDelete" Content="Delete selected" Style="{StaticResource DelBtn}" Padding="10,5" HorizontalAlignment="Right" IsEnabled="False"/>
</Grid>
<Border Background="#111111" CornerRadius="10" BorderBrush="#1F1F1F" BorderThickness="1" MinHeight="70">
<Grid>
<StackPanel x:Name="FsoEmpty" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0,18,0,18">
<TextBlock Text="No per-app rules yet" Foreground="#222222" FontSize="13" FontWeight="SemiBold" HorizontalAlignment="Center"/>
<TextBlock Text="Add an app above" Foreground="#1A1A1A" FontSize="10" HorizontalAlignment="Center" Margin="0,3,0,0"/>
</StackPanel>
<StackPanel x:Name="FsoList" Margin="8,6,8,6"/>
</Grid>
</Border>
</StackPanel>
</StackPanel>
</ScrollViewer>
</Grid>
<Border Grid.Row="2" Background="#0F0F0F" CornerRadius="0,0,14,14" BorderBrush="#1F1F1F" BorderThickness="0,1,0,0">
<Grid Margin="14,0">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
<Ellipse x:Name="StatusDot" Width="6" Height="6" Fill="#1E1E1E" Margin="0,0,7,0" VerticalAlignment="Center"/>
<TextBlock x:Name="StatusLabel" Text="Ready" Foreground="#2E2E2E" FontSize="11"/>
</StackPanel>
</Grid>
</Border>
</Grid>
</Border>
<Thumb x:Name="ThumbR" Width="6" HorizontalAlignment="Right" VerticalAlignment="Stretch" Margin="0,14,0,14" Opacity="0" Cursor="SizeWE"/>
<Thumb x:Name="ThumbL" Width="6" HorizontalAlignment="Left" VerticalAlignment="Stretch" Margin="0,14,0,14" Opacity="0" Cursor="SizeWE"/>
<Thumb x:Name="ThumbB" Height="6" VerticalAlignment="Bottom" HorizontalAlignment="Stretch" Margin="14,0,14,0" Opacity="0" Cursor="SizeNS"/>
<Thumb x:Name="ThumbBR" Width="14" Height="14" HorizontalAlignment="Right" VerticalAlignment="Bottom" Opacity="0" Cursor="SizeNWSE"/>
<Path Data="M 0 9 L 9 0 M 4 9 L 9 4 M 7 9 L 9 7" Stroke="#2D2D2D" StrokeThickness="1.3"
HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0,0,8,8" IsHitTestVisible="False"/>
</Grid>
</Window>
'@
$script:Win = ConvertFrom-XamlString $xaml
$bindNames = @(
'NavDashboard',
'NavCpu','NavQos','NavGpu','NavAdmin','NavFirewall','NavDefender','NavFullscreen',
'PageCpu','PageQos','PageGpu','PageAdmin','PageFirewall','PageDefender','PageFullscreen',
'PageHost','PageScrollViewer',
'BtnCpuBrowse','BtnCpuDelete','CpuEmpty','CpuList',
'BtnQosBrowse','BtnQosDelete','QosEmpty','QosList',
'BtnGpuBrowse','BtnGpuDelete','GpuEmpty','GpuList',
'BtnAdminBrowse','BtnAdminDelete','AdminEmpty','AdminList',
'BtnFirewallBrowse',
'BtnDefenderBrowse','BtnDefenderDelete','DefenderEmpty','DefenderList',
'DefenderWarningBanner','DefenderWarningTitle','DefenderWarningMsg',
'BtnFsoBrowse','BtnFsoDelete','FsoEmpty','FsoList',
'BtnClose','BtnMinimize','StatusDot','StatusLabel',
'GithubBtn',
'ThumbR','ThumbL','ThumbB','ThumbBR'
)
foreach ($n in $bindNames) {
Set-Variable -Name $n -Scope Script -Value $script:Win.FindName($n)
}
$script:SelectedCpu = [System.Collections.Generic.List[string]]::new()
$script:SelectedQos = [System.Collections.Generic.List[string]]::new()
$script:SelectedGpu = [System.Collections.Generic.List[string]]::new()
$script:SelectedAdmin = [System.Collections.Generic.List[string]]::new()
$script:SelectedDefender = [System.Collections.Generic.List[string]]::new()
$script:SelectedFso = [System.Collections.Generic.List[string]]::new()
$script:AllPages = @('PageCpu','PageQos','PageGpu','PageAdmin','PageFirewall','PageDefender','PageFullscreen')
$script:AllNavs = @('NavCpu','NavQos','NavGpu','NavAdmin','NavFirewall','NavDefender','NavFullscreen')
function Switch-Page {
param([string]$page, [string]$nav)
foreach ($p in $script:AllPages) {
(Get-Variable -Name $p -Scope Script -ValueOnly).Visibility = [System.Windows.Visibility]::Collapsed
}
foreach ($n in $script:AllNavs) {
(Get-Variable -Name $n -Scope Script -ValueOnly).Style = $script:Win.FindResource('NavBtn')
}
(Get-Variable -Name $page -Scope Script -ValueOnly).Visibility = [System.Windows.Visibility]::Visible
(Get-Variable -Name $nav -Scope Script -ValueOnly).Style = $script:Win.FindResource('NavBtnActive')
$script:PageScrollViewer.ScrollToTop()
Set-Status 'Ready' '#2E2E2E'
}
function Set-Status {
param([string]$text, [string]$color = '#2E2E2E')
$script:StatusLabel.Text = $text
$script:StatusDot.Fill = New-Brush $color
}
function Get-PrioLabel { param([string]$v)
switch ($v) { '4'{'Realtime'} '3'{'High'} '2'{'Above Normal'} '1'{'Normal'} '0'{'Idle'} default{"Level $v"} }
}
function Get-PrioColor { param([string]$v)
switch ($v) { '4'{'#F87171'} '3'{'#22C55E'} '2'{'#F59E0B'} '1'{'#3A3A3A'} '0'{'#EF4444'} default{'#4A4A4A'} }
}
function New-PillRow {
param([string]$labelText, [string]$valueText, [string]$valueColor)
$pill = [System.Windows.Controls.Border]::new()
$pill.Background = New-Brush '#0A0A0A'
$pill.BorderBrush = New-Brush '#1F1F1F'
$pill.BorderThickness = [System.Windows.Thickness]::new(1)
$pill.CornerRadius = [System.Windows.CornerRadius]::new(4)
$pill.Padding = [System.Windows.Thickness]::new(7,3,7,3)
$pill.Margin = [System.Windows.Thickness]::new(0,0,5,0)
$inner = [System.Windows.Controls.StackPanel]::new()
$inner.Orientation = [System.Windows.Controls.Orientation]::Horizontal
$lbl = [System.Windows.Controls.TextBlock]::new()
$lbl.Text = "$labelText "; $lbl.FontSize = 9; $lbl.Foreground = New-Brush '#3A3A3A'
$val = [System.Windows.Controls.TextBlock]::new()
$val.Text = $valueText; $val.FontSize = 9; $val.FontWeight = [System.Windows.FontWeights]::SemiBold
$val.Foreground = New-Brush $valueColor
[void]$inner.Children.Add($lbl); [void]$inner.Children.Add($val)
$pill.Child = $inner
return $pill
}
function New-SimpleRow {
param([string]$listName, [string]$selListName, [string]$deleteBtnName,
[string]$displayName, [string]$keyName, [string]$subText = '')
$selList = Get-Variable -Name $selListName -Scope Script -ValueOnly
$deleteBtn = Get-Variable -Name $deleteBtnName -Scope Script -ValueOnly
$row = [System.Windows.Controls.Border]::new()
$row.CornerRadius = [System.Windows.CornerRadius]::new(8)
$row.Margin = [System.Windows.Thickness]::new(0,0,0,4)
$row.Padding = [System.Windows.Thickness]::new(10,8,10,8)