Fixed handling GM's working_directory

pull/6/head
Miepee 5 years ago
parent 4777f34374
commit 7fb1f09609

@ -641,10 +641,12 @@ namespace AM2RLauncher
ProcessStartInfo proc = new ProcessStartInfo();
proc.WorkingDirectory = Environment.CurrentDirectory;
proc.FileName = CrossPlatformOperations.CURRENTPATH + "/Profiles/" + profile.Name + "/AM2R.exe";
proc.WorkingDirectory = CrossPlatformOperations.CURRENTPATH + "/Profiles/" + profile.Name;
proc.FileName = proc.WorkingDirectory + "/AM2R.exe";
proc.Arguments = arguments;
log.Info("CWD of Profile is " + proc.WorkingDirectory);
using (var p = Process.Start(proc))
{
SetForegroundWindow(p.MainWindowHandle);
@ -694,9 +696,11 @@ namespace AM2RLauncher
}
}
startInfo.WorkingDirectory = Environment.CurrentDirectory;
startInfo.UseShellExecute = false;
startInfo.FileName = CrossPlatformOperations.CURRENTPATH + "/Profiles/" + profile.Name + "/AM2R.AppImage";
startInfo.WorkingDirectory = CrossPlatformOperations.CURRENTPATH + "/Profiles/" + profile.Name;
startInfo.FileName = startInfo.WorkingDirectory + "/AM2R.AppImage";
log.Info("CWD of Profile is " + startInfo.WorkingDirectory);
log.Info("Launching game with following variables: ");
foreach(System.Collections.DictionaryEntry item in startInfo.EnvironmentVariables)

@ -166,6 +166,7 @@ namespace AM2RLauncher
// Set the Current Directory to the path the Launcher is located. Fixes some relative path issues.
Environment.CurrentDirectory = CrossPlatformOperations.CURRENTPATH;
log.Info("Set Launcher CWD to " + Environment.CurrentDirectory);
//Set the language to what User wanted or choose local language
string userLanguage = CrossPlatformOperations.ReadFromConfig("Language").ToLower();

Loading…
Cancel
Save