static string AssemblyUpdaterPath() { var unescapedAssemblyUpdaterPath = EditorApplication.applicationContentsPath + "/Tools/ScriptUpdater/AssemblyUpdater.exe"; return(Application.platform == RuntimePlatform.WindowsEditor ? CommandLineFormatter.EscapeCharsWindows(unescapedAssemblyUpdaterPath) : CommandLineFormatter.EscapeCharsQuote(unescapedAssemblyUpdaterPath)); }
private string EscapeSpacesInPath(string path) { if (Application.platform == RuntimePlatform.WindowsEditor) { return(CommandLineFormatter.EscapeCharsWindows(path)); } return(CommandLineFormatter.EscapeCharsQuote(path)); }
internal static int Run(string arguments, string workingDir, out string stdOut, out string stdErr) { var assemblyUpdaterPath = EditorApplication.applicationContentsPath + "/Tools/ScriptUpdater/AssemblyUpdater.exe"; var monodistribution = MonoInstallationFinder.GetMonoInstallation("MonoBleedingEdge"); var monoexe = Path.Combine(monodistribution, "bin/mono"); if (Application.platform == RuntimePlatform.WindowsEditor) { monoexe = Application.platform == RuntimePlatform.WindowsEditor ? CommandLineFormatter.EscapeCharsWindows(monoexe + ".exe") : CommandLineFormatter.EscapeCharsQuote(monoexe + ".exe"); } var startInfo = new ProcessStartInfo { Arguments = assemblyUpdaterPath + " " + arguments, CreateNoWindow = true, FileName = monoexe, RedirectStandardError = true, RedirectStandardOutput = true, WorkingDirectory = workingDir, UseShellExecute = false }; var assemblyUpdaterProcess = new Program(startInfo); assemblyUpdaterProcess.LogProcessStartInfo(); assemblyUpdaterProcess.Start(); assemblyUpdaterProcess.WaitForExit(); stdOut = assemblyUpdaterProcess.GetStandardOutputAsString(); stdErr = string.Join("\r\n", assemblyUpdaterProcess.GetErrorOutput()); return(assemblyUpdaterProcess.ExitCode); }