add automatic copy of System.Drawing.Common.dll for the current platform, that is still needed

This commit is contained in:
UbitUmarov
2023-01-26 18:52:02 +00:00
parent 306df20003
commit 4358ab54b0
2 changed files with 46 additions and 1 deletions

View File

@@ -91,7 +91,7 @@ namespace OpenSim
// Configure Log4Net
configSource.AddSwitch("Startup", "logconfig");
string logConfigFile = configSource.Configs["Startup"].GetString("logconfig", String.Empty);
if (logConfigFile != String.Empty)
if (!string.IsNullOrEmpty(logConfigFile))
{
XmlConfigurator.Configure(new System.IO.FileInfo(logConfigFile));
m_log.InfoFormat("[OPENSIM MAIN]: configured log4net using \"{0}\" as configuration file",
@@ -103,6 +103,28 @@ namespace OpenSim
m_log.Info("[OPENSIM MAIN]: configured log4net using default OpenSim.exe.config");
}
// temporay set the platform dependent System.Drawing.Common.dll
string targetdll = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location),
"System.Drawing.Common.dll");
string src = targetdll + (Util.IsWindows() ? ".win" : ".linux");
try
{
if (!File.Exists(targetdll))
File.Copy(src, targetdll);
else
{
FileInfo targetInfo = new(targetdll);
FileInfo srcInfo = new(src);
if(targetInfo.Length != srcInfo.Length)
File.Copy(src, targetdll, true);
}
}
catch (Exception e)
{
m_log.Error("Failed to copy System.Drawing.Common.dll for current platform" + e.Message);
throw;
}
m_log.InfoFormat(
"[OPENSIM MAIN]: System Locale is {0}", System.Threading.Thread.CurrentThread.CurrentCulture);
if(!Util.IsWindows())

View File

@@ -141,6 +141,29 @@ namespace OpenSim.Server
connList = string.Join(",", servicesList.ToArray());
}
// temporay set the platform dependent System.Drawing.Common.dll
string targetdll = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location),
"System.Drawing.Common.dll");
string src = targetdll + (Util.IsWindows() ? ".win" : ".linux");
try
{
if (!File.Exists(targetdll))
File.Copy(src, targetdll);
else
{
FileInfo targetInfo = new(targetdll);
FileInfo srcInfo = new(src);
if (targetInfo.Length != srcInfo.Length)
File.Copy(src, targetdll, true);
}
}
catch (Exception e)
{
m_log.Error("Failed to copy System.Drawing.Common.dll for current platform" + e.Message);
throw;
}
string[] conns = connList.Split(new char[] {',', ' ', '\n', '\r', '\t'});
foreach (string c in conns)