aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authormingchen2007-10-19 19:20:18 +0000
committermingchen2007-10-19 19:20:18 +0000
commitf756b1ee1c93e842ae7ad4c64d1115586cac7382 (patch)
tree270c44d31d957fc9b662501378f2e88034b88b31
parent* normalized line endings... (diff)
downloadopensim-SC-f756b1ee1c93e842ae7ad4c64d1115586cac7382.zip
opensim-SC-f756b1ee1c93e842ae7ad4c64d1115586cac7382.tar.gz
opensim-SC-f756b1ee1c93e842ae7ad4c64d1115586cac7382.tar.bz2
opensim-SC-f756b1ee1c93e842ae7ad4c64d1115586cac7382.tar.xz
*Added -useexecutepath to use the path of the .exe as the path to find configuration and libraries and not the current working directory.
-rw-r--r--OpenSim/Framework/General/Util.cs24
-rw-r--r--OpenSim/Region/Application/Application.cs1
-rw-r--r--OpenSim/Region/Application/OpenSimMain.cs8
3 files changed, 33 insertions, 0 deletions
diff --git a/OpenSim/Framework/General/Util.cs b/OpenSim/Framework/General/Util.cs
index fe4ce29..0c9a290 100644
--- a/OpenSim/Framework/General/Util.cs
+++ b/OpenSim/Framework/General/Util.cs
@@ -44,6 +44,8 @@ namespace OpenSim.Framework.Utilities
44 private static object XferLock = new object(); 44 private static object XferLock = new object();
45 private static Dictionary<LLUUID, string> capsURLS = new Dictionary<LLUUID, string>(); 45 private static Dictionary<LLUUID, string> capsURLS = new Dictionary<LLUUID, string>();
46 46
47 private static bool m_useExecutePath;
48
47 public static ulong UIntsToLong(uint X, uint Y) 49 public static ulong UIntsToLong(uint X, uint Y)
48 { 50 {
49 return Helpers.UIntsToLong(X, Y); 51 return Helpers.UIntsToLong(X, Y);
@@ -295,12 +297,22 @@ namespace OpenSim.Framework.Utilities
295 // 297 //
296 // directory locations 298 // directory locations
297 // 299 //
300
301 public static void changeUseExecutePathSetting(bool setting)
302 {
303 m_useExecutePath = setting;
304 }
305
298 public static string homeDir() 306 public static string homeDir()
299 { 307 {
300 string temp; 308 string temp;
301// string personal=(Environment.GetFolderPath(Environment.SpecialFolder.Personal)); 309// string personal=(Environment.GetFolderPath(Environment.SpecialFolder.Personal));
302// temp = Path.Combine(personal,".OpenSim"); 310// temp = Path.Combine(personal,".OpenSim");
303 temp="."; 311 temp=".";
312 if (m_useExecutePath)
313 {
314 temp = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
315 }
304 return temp; 316 return temp;
305 } 317 }
306 318
@@ -308,6 +320,10 @@ namespace OpenSim.Framework.Utilities
308 { 320 {
309 string temp; 321 string temp;
310 temp = "."; 322 temp = ".";
323 if (m_useExecutePath)
324 {
325 temp = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
326 }
311 return temp; 327 return temp;
312 } 328 }
313 329
@@ -315,6 +331,10 @@ namespace OpenSim.Framework.Utilities
315 { 331 {
316 string temp; 332 string temp;
317 temp = "."; 333 temp = ".";
334 if (m_useExecutePath)
335 {
336 temp = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
337 }
318 return temp; 338 return temp;
319 } 339 }
320 340
@@ -322,6 +342,10 @@ namespace OpenSim.Framework.Utilities
322 { 342 {
323 string temp; 343 string temp;
324 temp = "."; 344 temp = ".";
345 if (m_useExecutePath)
346 {
347 temp = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
348 }
325 return temp; 349 return temp;
326 } 350 }
327 351
diff --git a/OpenSim/Region/Application/Application.cs b/OpenSim/Region/Application/Application.cs
index ec7c43d..8e2793e 100644
--- a/OpenSim/Region/Application/Application.cs
+++ b/OpenSim/Region/Application/Application.cs
@@ -65,6 +65,7 @@ namespace OpenSim
65 configSource.AddSwitch("Startup", "gridmode"); 65 configSource.AddSwitch("Startup", "gridmode");
66 configSource.AddSwitch("Startup", "physics"); 66 configSource.AddSwitch("Startup", "physics");
67 configSource.AddSwitch("Startup", "noverbose"); 67 configSource.AddSwitch("Startup", "noverbose");
68 configSource.AddSwitch("Startup", "useexecutepath");
68 69
69 OpenSimMain sim = new OpenSimMain(configSource); 70 OpenSimMain sim = new OpenSimMain(configSource);
70 71
diff --git a/OpenSim/Region/Application/OpenSimMain.cs b/OpenSim/Region/Application/OpenSimMain.cs
index 4753145..5fb514f 100644
--- a/OpenSim/Region/Application/OpenSimMain.cs
+++ b/OpenSim/Region/Application/OpenSimMain.cs
@@ -91,6 +91,14 @@ namespace OpenSim
91 { 91 {
92 IConfigSource startupSource = configSource; 92 IConfigSource startupSource = configSource;
93 string iniFile = startupSource.Configs["Startup"].GetString("inifile", "OpenSim.ini"); 93 string iniFile = startupSource.Configs["Startup"].GetString("inifile", "OpenSim.ini");
94 string useExecutePathString = startupSource.Configs["Startup"].GetString("useexecutepath", "false").ToLower();
95 bool useExecutePath = false;
96 if (useExecutePathString == "true" || useExecutePathString == "" || useExecutePathString == "1" || useExecutePathString == "yes")
97 {
98 useExecutePath = true;
99 }
100
101 Util.changeUseExecutePathSetting(useExecutePath);
94 102
95 //check for .INI file (either default or name passed in command line) 103 //check for .INI file (either default or name passed in command line)
96 string iniFilePath = Path.Combine(Util.configDir(), iniFile); 104 string iniFilePath = Path.Combine(Util.configDir(), iniFile);