|
@ -95,10 +95,13 @@ namespace IPA |
|
|
AppDomain.CurrentDomain.AssemblyResolve += AssemblyLibLoader; |
|
|
AppDomain.CurrentDomain.AssemblyResolve += AssemblyLibLoader; |
|
|
|
|
|
|
|
|
var argExeName = Arguments.CmdLine.PositionalArgs.FirstOrDefault(s => s.EndsWith(".exe")); |
|
|
var argExeName = Arguments.CmdLine.PositionalArgs.FirstOrDefault(s => s.EndsWith(".exe")); |
|
|
|
|
|
argExeName ??= new DirectoryInfo(Directory.GetCurrentDirectory()).GetFiles() |
|
|
|
|
|
.FirstOrDefault(o => o.Extension == ".exe" && o.FullName != Assembly.GetEntryAssembly().Location) |
|
|
|
|
|
?.FullName; |
|
|
if (argExeName == null) |
|
|
if (argExeName == null) |
|
|
context = PatchContext.Create(new DirectoryInfo(Directory.GetCurrentDirectory()).GetFiles() |
|
|
|
|
|
.First(o => o.Extension == ".exe" && o.FullName != Assembly.GetEntryAssembly().Location) |
|
|
|
|
|
.FullName); |
|
|
|
|
|
|
|
|
{ |
|
|
|
|
|
Fail("Could not locate game executable"); |
|
|
|
|
|
} |
|
|
else |
|
|
else |
|
|
context = PatchContext.Create(argExeName); |
|
|
context = PatchContext.Create(argExeName); |
|
|
|
|
|
|
|
@ -341,7 +344,7 @@ namespace IPA |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[DoesNotReturn] |
|
|
private static void Fail(string message) |
|
|
private static void Fail(string message) |
|
|
{ |
|
|
{ |
|
|
Console.Error.WriteLine("ERROR: " + message); |
|
|
Console.Error.WriteLine("ERROR: " + message); |
|
|