public static void Run(string commaSeparatedListOfAssemblies) { string[] array = commaSeparatedListOfAssemblies.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); APIUpdaterLogger.WriteToFile("Started to update {0} assemblie(s)", new object[] { array.Count <string>() }); Stopwatch stopwatch = new Stopwatch(); stopwatch.Start(); string[] array2 = array; for (int i = 0; i < array2.Length; i++) { string text = array2[i]; if (AssemblyHelper.IsManagedAssembly(text)) { string text2 = APIUpdaterHelper.ResolveAssemblyPath(text); string text3; string text4; int num = APIUpdaterHelper.RunUpdatingProgram("AssemblyUpdater.exe", string.Concat(new string[] { "-u -a ", text2, APIUpdaterHelper.APIVersionArgument(), APIUpdaterHelper.AssemblySearchPathArgument(), APIUpdaterHelper.ConfigurationProviderAssembliesPathArgument() }), out text3, out text4); if (text3.Length > 0) { APIUpdaterLogger.WriteToFile("Assembly update output ({0})\r\n{1}", new object[] { text2, text3 }); } if (APIUpdaterHelper.IsError(num)) { APIUpdaterLogger.WriteErrorToConsole("Error {0} running AssemblyUpdater. Its output is: `{1}`", new object[] { num, text4 }); } } } APIUpdaterLogger.WriteToFile("Update finished in {0}s", new object[] { stopwatch.Elapsed.TotalSeconds }); }
public static bool DoesAssemblyRequireUpgrade(string assemblyFullPath) { bool result; if (!File.Exists(assemblyFullPath)) { result = false; } else if (!AssemblyHelper.IsManagedAssembly(assemblyFullPath)) { result = false; } else if (!APIUpdaterHelper.MayContainUpdatableReferences(assemblyFullPath)) { result = false; } else { string text; string text2; int num = APIUpdaterHelper.RunUpdatingProgram("AssemblyUpdater.exe", string.Concat(new string[] { APIUpdaterHelper.TimeStampArgument(), APIUpdaterHelper.APIVersionArgument(), "--check-update-required -a ", CommandLineFormatter.PrepareFileName(assemblyFullPath), APIUpdaterHelper.AssemblySearchPathArgument(), APIUpdaterHelper.ConfigurationProviderAssembliesPathArgument() }), out text, out text2); Console.WriteLine("{0}{1}", text, text2); switch (num) { case 0: case 1: result = false; break; case 2: result = true; break; default: UnityEngine.Debug.LogError(text + Environment.NewLine + text2); result = false; break; } } return(result); }
public static bool DoesAssemblyRequireUpgrade(string assetFullPath) { if (!File.Exists(assetFullPath)) { return(false); } if (!InternalEditorUtility.DetectDotNetDll(assetFullPath)) { return(false); } string text; string text2; int num = APIUpdaterHelper.RunUpdatingProgram("AssemblyUpdater.exe", string.Concat(new string[] { APIUpdaterHelper.TimeStampArgument(), APIUpdaterHelper.APIVersionArgument(), "--check-update-required -a ", CommandLineFormatter.PrepareFileName(assetFullPath), APIUpdaterHelper.AssemblySearchPathArgument() }), out text, out text2); Console.WriteLine("{0}{1}", text, text2); switch (num) { case 0: case 1: return(false); case 2: return(true); default: UnityEngine.Debug.LogError(text + Environment.NewLine + text2); return(false); } }
public static bool DoesAssemblyRequireUpgrade(string assemblyFullPath) { if (!File.Exists(assemblyFullPath) || !AssemblyHelper.IsManagedAssembly(assemblyFullPath) || !APIUpdaterHelper.MayContainUpdatableReferences(assemblyFullPath)) { return(false); } string stdOut; string stdErr; int num = APIUpdaterHelper.RunUpdatingProgram("AssemblyUpdater.exe", APIUpdaterHelper.TimeStampArgument() + APIUpdaterHelper.APIVersionArgument() + "--check-update-required -a " + CommandLineFormatter.PrepareFileName(assemblyFullPath) + APIUpdaterHelper.AssemblySearchPathArgument() + APIUpdaterHelper.ConfigurationProviderAssembliesPathArgument(), out stdOut, out stdErr); Console.WriteLine("{0}{1}", (object)stdOut, (object)stdErr); switch (num) { case 0: case 1: return(false); case 2: return(true); default: UnityEngine.Debug.LogError((object)(stdOut + Environment.NewLine + stdErr)); return(false); } }
public static void Run(string commaSeparatedListOfAssemblies) { string[] strArray = commaSeparatedListOfAssemblies.Split(new char[1] { ',' }, StringSplitOptions.RemoveEmptyEntries); APIUpdaterLogger.WriteToFile("Started to update {0} assemblie(s)", (object)((IEnumerable <string>)strArray).Count <string>()); Stopwatch stopwatch = new Stopwatch(); stopwatch.Start(); foreach (string str1 in strArray) { if (AssemblyHelper.IsManagedAssembly(str1)) { string str2 = APIUpdaterHelper.ResolveAssemblyPath(str1); string stdOut; string stdErr; int num = APIUpdaterHelper.RunUpdatingProgram("AssemblyUpdater.exe", "-u -a " + str2 + APIUpdaterHelper.APIVersionArgument() + APIUpdaterHelper.AssemblySearchPathArgument() + APIUpdaterHelper.ConfigurationProviderAssembliesPathArgument(), out stdOut, out stdErr); if (stdOut.Length > 0) { APIUpdaterLogger.WriteToFile("Assembly update output ({0})\r\n{1}", (object)str2, (object)stdOut); } if (num < 0) { APIUpdaterLogger.WriteErrorToConsole("Error {0} running AssemblyUpdater. Its output is: `{1}`", (object)num, (object)stdErr); } } } APIUpdaterLogger.WriteToFile("Update finished in {0}s", (object)stopwatch.Elapsed.TotalSeconds); }