inital SK upload
This commit is contained in:
parent
27d6e530e0
commit
5edb6915ed
125 changed files with 2659 additions and 107 deletions
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using RynthCore;
|
||||
|
||||
namespace RynthCore.Injector;
|
||||
|
||||
|
|
@ -15,6 +16,14 @@ internal static class Program
|
|||
Console.ForegroundColor = ConsoleColor.Red;
|
||||
Console.WriteLine();
|
||||
Console.WriteLine($"FATAL EXCEPTION: {ex}");
|
||||
try
|
||||
{
|
||||
DesktopRollingLog.AppendLine(DesktopRollingLog.StemInjector,
|
||||
$"FATAL: {ex.GetType().Name}: {ex.Message}");
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
Console.ResetColor();
|
||||
return 99;
|
||||
}
|
||||
|
|
@ -29,36 +38,50 @@ internal static class Program
|
|||
private static int Run(string[] args)
|
||||
{
|
||||
var service = new EngineInjectionService();
|
||||
void Line(string s)
|
||||
{
|
||||
Console.WriteLine(s);
|
||||
try
|
||||
{
|
||||
string t = DateTime.Now.ToString("HH:mm:ss.fff");
|
||||
DesktopRollingLog.AppendLine(DesktopRollingLog.StemInjector, $"[{t}] {s}");
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
Console.WriteLine("========================================");
|
||||
Console.WriteLine(" RynthCore Injector Console ");
|
||||
Console.WriteLine("========================================");
|
||||
Console.WriteLine();
|
||||
Line("========================================");
|
||||
Line(" RynthCore Injector Console ");
|
||||
Line("========================================");
|
||||
Line("");
|
||||
|
||||
string? enginePath = service.TryResolveEnginePath(args.Length > 0 ? args[0] : null);
|
||||
if (enginePath == null)
|
||||
{
|
||||
Console.ForegroundColor = ConsoleColor.Red;
|
||||
Console.WriteLine($"Could not locate {EngineInjectionService.EngineDllName}.");
|
||||
Console.WriteLine("Copy it next to the injector or pass the full path as the first argument.");
|
||||
Line($"Could not locate {EngineInjectionService.EngineDllName}.");
|
||||
Line("Copy it next to the injector or pass the full path as the first argument.");
|
||||
Console.ResetColor();
|
||||
return 1;
|
||||
}
|
||||
|
||||
InjectionResult result = service.InjectFirstRunning(enginePath, Console.WriteLine);
|
||||
Console.WriteLine();
|
||||
InjectionResult result = service.InjectFirstRunning(enginePath, Line);
|
||||
Line("");
|
||||
|
||||
if (result.Success)
|
||||
{
|
||||
Console.ForegroundColor = ConsoleColor.Green;
|
||||
Console.WriteLine(result.Summary);
|
||||
Console.WriteLine("Check Desktop\\RynthCore.log for in-process status.");
|
||||
Line(result.Summary);
|
||||
Line("Check Desktop\\RynthCore.log for in-process engine output. " +
|
||||
"RynthCore-Launcher.log and RynthCore-Injector.log list launcher/injector. " +
|
||||
"Each file rolls at 10 MB; up to 10 roll segments per day per file under Desktop\\RynthLogs.");
|
||||
Console.ResetColor();
|
||||
return 0;
|
||||
}
|
||||
|
||||
Console.ForegroundColor = ConsoleColor.Red;
|
||||
Console.WriteLine(result.Summary);
|
||||
Line(result.Summary);
|
||||
Console.ResetColor();
|
||||
return result.ExitCode;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,11 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\RynthCore.DesktopLog\RynthCore.DesktopLog.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<!-- Build-Installer.ps1 publishes this project self-contained for the bundle (see BUILD.md). -->
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net10.0-windows</TargetFramework>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
|
|
|
|||
Loading…
Reference in a new issue