Skip to content

Commit a562353

Browse files
authored
Add files via upload
1 parent 6e398a8 commit a562353

4 files changed

Lines changed: 287 additions & 0 deletions

File tree

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<RootNamespace>NoVgkInstaller</RootNamespace>
6+
<TargetFramework>net8.0</TargetFramework>
7+
<ImplicitUsings>enable</ImplicitUsings>
8+
<Nullable>enable</Nullable>
9+
<PublishAot>false</PublishAot>
10+
<InvariantGlobalization>true</InvariantGlobalization>
11+
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
12+
</PropertyGroup>
13+
14+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
15+
<Optimize>True</Optimize>
16+
<DebugType>none</DebugType>
17+
</PropertyGroup>
18+
19+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
20+
<DebugType>none</DebugType>
21+
</PropertyGroup>
22+
23+
<ItemGroup>
24+
<PackageReference Include="System.ServiceProcess.ServiceController" Version="9.0.5" />
25+
</ItemGroup>
26+
27+
</Project>

NoVgkInstaller/NoVgkInstaller.sln

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.13.35806.99 d17.13
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NoVgkInstaller", "NoVgkInstaller.csproj", "{77496DD6-EFAA-4893-B20A-B56F234F7F2B}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{77496DD6-EFAA-4893-B20A-B56F234F7F2B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{77496DD6-EFAA-4893-B20A-B56F234F7F2B}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{77496DD6-EFAA-4893-B20A-B56F234F7F2B}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{77496DD6-EFAA-4893-B20A-B56F234F7F2B}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
GlobalSection(ExtensibilityGlobals) = postSolution
23+
SolutionGuid = {727FA139-6268-4834-94F7-BB281101C913}
24+
EndGlobalSection
25+
EndGlobal

NoVgkInstaller/Program.cs

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
namespace NoVgkInstaller;
2+
3+
class Program
4+
{
5+
private static void Main(string[] args)
6+
{
7+
if (!Setup.RemoveVanguard())
8+
{
9+
while (true)
10+
{
11+
Console.ForegroundColor = ConsoleColor.Red;
12+
Console.WriteLine(" [ERROR] Vanguard uninstall failed. Please manually uninstall Vanguard with Revo uninstaller or similar tool.");
13+
Console.ResetColor();
14+
Console.WriteLine(" ----------------------------------------------------");
15+
Console.WriteLine(" [1] Go back");
16+
Console.WriteLine(" [0] Exit");
17+
Console.WriteLine(" ====================================================");
18+
Console.ForegroundColor = ConsoleColor.White;
19+
Console.Write(" Select an option: ");
20+
Console.ResetColor();
21+
22+
var choice = Console.ReadLine();
23+
24+
if (choice == "1")
25+
{
26+
Console.Clear();
27+
return;
28+
}
29+
else if (choice == "0")
30+
{
31+
Environment.Exit(0);
32+
}
33+
else
34+
{
35+
Console.Clear();
36+
Console.ForegroundColor = ConsoleColor.Yellow;
37+
Console.WriteLine(" [WARN] Invalid input. Please enter a valid option.");
38+
Console.ResetColor();
39+
}
40+
}
41+
}
42+
43+
if (!Setup.EnsurevServiceInstalled())
44+
{
45+
while (true)
46+
{
47+
Console.ForegroundColor = ConsoleColor.Red;
48+
Console.WriteLine(" [ERROR] Failed to register zombie Vanguard Client. Please make sure FakeVgc.exe is placed in same directory as this app and try running this app as administrator if issue persist.");
49+
Console.ResetColor();
50+
Console.WriteLine(" ----------------------------------------------------");
51+
Console.WriteLine(" [1] Go back");
52+
Console.WriteLine(" [0] Exit");
53+
Console.WriteLine(" ====================================================");
54+
Console.ForegroundColor = ConsoleColor.White;
55+
Console.Write(" Select an option: ");
56+
Console.ResetColor();
57+
58+
var choice = Console.ReadLine();
59+
60+
if (choice == "1")
61+
{
62+
Console.Clear();
63+
return;
64+
}
65+
else if (choice == "0")
66+
{
67+
Environment.Exit(0);
68+
}
69+
else
70+
{
71+
Console.Clear();
72+
Console.ForegroundColor = ConsoleColor.Yellow;
73+
Console.WriteLine(" [WARN] Invalid input. Please enter a valid option.");
74+
Console.ResetColor();
75+
}
76+
}
77+
}
78+
}
79+
}

NoVgkInstaller/Setup.cs

Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
using System.Diagnostics;
2+
using System.ServiceProcess;
3+
4+
namespace NoVgkInstaller;
5+
6+
internal class Setup
7+
{
8+
public static void TerminateRiotServices()
9+
{
10+
string[] riotProcesses = ["RiotClientServices", "LeagueClient", "VALORANT-Win64-Shipping", "Lion-Win64-Shipping"];
11+
12+
foreach (var processName in riotProcesses)
13+
{
14+
try
15+
{
16+
var processes = Process.GetProcessesByName(processName);
17+
18+
foreach (var process in processes)
19+
{
20+
process.Kill();
21+
process.WaitForExit();
22+
}
23+
}
24+
catch (Exception)
25+
{
26+
Console.ForegroundColor = ConsoleColor.DarkYellow;
27+
Console.WriteLine($" [WARN] Could not terminate {processName}, try running this app as administrator.");
28+
Console.ResetColor();
29+
}
30+
}
31+
}
32+
33+
internal static bool EnsurevServiceInstalled()
34+
{
35+
if (!RemoveVanguard())
36+
{
37+
Console.ForegroundColor = ConsoleColor.Red;
38+
Console.WriteLine(" [ERROR] Cannot install zombie Vanguard Client because real Vanguard failed to uninstall. Please manually uninstall Vanguard with Revo uninstaller before continuing.");
39+
Console.ResetColor();
40+
return false;
41+
}
42+
43+
try
44+
{
45+
if (ServiceController.GetServices().Any(s => s.ServiceName == "vgc"))
46+
return true;
47+
48+
Console.WriteLine(" [INFO] Registering vService.exe...");
49+
50+
string exePath = Path.Combine(AppContext.BaseDirectory, "vService.exe");
51+
52+
if (!File.Exists(exePath))
53+
{
54+
Console.ForegroundColor = ConsoleColor.Red;
55+
Console.WriteLine($" [ERROR] vService.exe not found in {exePath}");
56+
Console.ResetColor();
57+
return false;
58+
}
59+
60+
string scCreate = $"sc create vgc binPath= \"{exePath}\" start= demand DisplayName= \"vService\"";
61+
string scSdset = "sc sdset vgc D:(A;;CCLCSWRPWPDTLOCRRC;;;SY)" +
62+
"(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)" +
63+
"(A;;CCLCSWLOCRRC;;;IU)(A;;CCLCSWLOCRRC;;;SU)" +
64+
"(A;;RPLOCRRC;;;S-1-5-32-545)";
65+
66+
var psi = new ProcessStartInfo
67+
{
68+
FileName = "cmd.exe",
69+
Arguments = $"/c \"{scCreate} && {scSdset}\"",
70+
Verb = "runas",
71+
UseShellExecute = true,
72+
WindowStyle = ProcessWindowStyle.Hidden
73+
};
74+
75+
using var process = Process.Start(psi);
76+
process?.WaitForExit();
77+
78+
bool serviceExists = ServiceController.GetServices().Any(s => s.ServiceName == "vgc");
79+
if (serviceExists)
80+
{
81+
Console.ForegroundColor = ConsoleColor.Green;
82+
Console.WriteLine(" [SUCCESS] vService successfully registered.");
83+
Console.ResetColor();
84+
return true;
85+
}
86+
else
87+
{
88+
Console.ForegroundColor = ConsoleColor.Red;
89+
Console.WriteLine(" [ERROR] Failed to register vService.");
90+
Console.ResetColor();
91+
return false;
92+
}
93+
}
94+
catch (Exception ex)
95+
{
96+
Console.ForegroundColor = ConsoleColor.Red;
97+
Console.WriteLine($" [ERROR] Failed to create or verify zombie Vanguard Client registration: {ex.Message}");
98+
Console.ResetColor();
99+
return false;
100+
}
101+
}
102+
103+
public static bool RemoveVanguard()
104+
{
105+
string vgkpath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), "Riot Vanguard", "installer.exe");
106+
107+
if (!File.Exists(vgkpath))
108+
{
109+
return true;
110+
}
111+
112+
try
113+
{
114+
using var process = Process.Start(vgkpath, "--quiet");
115+
if (process != null)
116+
{
117+
Console.WriteLine(" [INFO] Attempting to uninstall Vanguard...");
118+
119+
process.WaitForExit();
120+
Thread.Sleep(5000);
121+
122+
for (int i = 0; i < 30; i++)
123+
{
124+
if (!File.Exists(vgkpath))
125+
{
126+
Console.ForegroundColor = ConsoleColor.Green;
127+
Console.WriteLine(" [SUCCESS] Vanguard uninstallation completed, starting now...");
128+
Console.ResetColor();
129+
return true;
130+
}
131+
132+
Thread.Sleep(1000);
133+
}
134+
135+
Console.ForegroundColor = ConsoleColor.DarkYellow;
136+
Console.WriteLine(" [WARN] Vanguard uninstallation failed, try running this app as administrator.");
137+
Console.ResetColor();
138+
return false;
139+
}
140+
else
141+
{
142+
Console.ForegroundColor = ConsoleColor.Red;
143+
Console.WriteLine(" [ERROR] Failed to start Vanguard uninstallation process.");
144+
Console.ResetColor();
145+
return false;
146+
}
147+
}
148+
catch (Exception ex)
149+
{
150+
Console.ForegroundColor = ConsoleColor.Red;
151+
Console.WriteLine($" [ERROR] Vanguard uninstallation aborted: {ex}");
152+
Console.ResetColor();
153+
return false;
154+
}
155+
}
156+
}

0 commit comments

Comments
 (0)