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)!, Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!,
"EpicRerouter.exe" "EpicRerouter.exe"
); );
Log($"process path = {processPath}");
var args = new[] var args = new[]
{ {
Application.productName, Application.productName,
Application.version, Application.version,
Path.GetDirectoryName(typeof(EpicPlatformManager).Assembly.Location) 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 var process = Process.Start(new ProcessStartInfo
{ {
FileName = processPath, FileName = processPath,
WorkingDirectory = Path.GetDirectoryName(processPath)!, WorkingDirectory = workingDirectory,
Arguments = args.Join(x => $"\"{x}\"", " "), Arguments = args.Join(x => $"\"{x}\"", " "),
UseShellExecute = false UseShellExecute = false
}); });