mirror of
https://github.com/opensim/opensim.git
synced 2026-08-13 05:05:43 +08:00
add automatic copy of System.Drawing.Common.dll for the current platform, that is still needed
This commit is contained in:
@@ -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())
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user