use plugins dir for working directory so we can get native dlls correctly

This commit is contained in:
JohnCorby 2022-02-06 23:33:58 -08:00
parent 226943cb47
commit edaf7ff84f

View File

@ -30,16 +30,20 @@ namespace EpicRerouter.ModSide
Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!,
"EpicRerouter.exe"
);
Log($"process path = {processPath}");
var args = new[]
{
Application.productName,
Application.version,
Path.GetDirectoryName(typeof(EpicPlatformManager).Assembly.Location)
};
Log($"args = {args.Join()}");
var workingDirectory = Path.GetFullPath(Path.Combine(args[2], "..", "Plugins", "x86_64"));
Log($"working dir = {workingDirectory}");
var process = Process.Start(new ProcessStartInfo
{
FileName = processPath,
WorkingDirectory = Path.GetDirectoryName(processPath)!,
WorkingDirectory = workingDirectory,
Arguments = args.Join(x => $"\"{x}\"", " "),
UseShellExecute = false
});