public ManagedProgram(string monodistribution, string profile, string executable, string arguments, bool setMonoEnvironmentVariables, Action <ProcessStartInfo> setupStartInfo)
{
string text = ManagedProgram.PathCombine(new string[]
{
monodistribution,
"bin",
"mono"
});
string value = ManagedProgram.PathCombine(new string[]
{
monodistribution,
"lib",
"mono",
profile
});
if (Application.platform == RuntimePlatform.WindowsEditor)
{
text = CommandLineFormatter.PrepareFileName(text + ".exe");
}
ProcessStartInfo processStartInfo = new ProcessStartInfo
{
Arguments = CommandLineFormatter.PrepareFileName(executable) + " " + arguments,
CreateNoWindow = true,
FileName = text,
RedirectStandardError = true,
RedirectStandardOutput = true,
WorkingDirectory = Application.dataPath + "/..",
UseShellExecute = false
};
if (setMonoEnvironmentVariables)
{
processStartInfo.EnvironmentVariables["MONO_PATH"] = value;
processStartInfo.EnvironmentVariables["MONO_CFG_DIR"] = ManagedProgram.PathCombine(new string[]
{
monodistribution,
"etc"
});
}
if (setupStartInfo != null)
{
setupStartInfo(processStartInfo);
}
this._process.StartInfo = processStartInfo;
}