From f756b1ee1c93e842ae7ad4c64d1115586cac7382 Mon Sep 17 00:00:00 2001 From: mingchen Date: Fri, 19 Oct 2007 19:20:18 +0000 Subject: *Added -useexecutepath to use the path of the .exe as the path to find configuration and libraries and not the current working directory. --- OpenSim/Framework/General/Util.cs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'OpenSim/Framework') 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 private static object XferLock = new object(); private static Dictionary capsURLS = new Dictionary(); + private static bool m_useExecutePath; + public static ulong UIntsToLong(uint X, uint Y) { return Helpers.UIntsToLong(X, Y); @@ -295,12 +297,22 @@ namespace OpenSim.Framework.Utilities // // directory locations // + + public static void changeUseExecutePathSetting(bool setting) + { + m_useExecutePath = setting; + } + public static string homeDir() { string temp; // string personal=(Environment.GetFolderPath(Environment.SpecialFolder.Personal)); // temp = Path.Combine(personal,".OpenSim"); temp="."; + if (m_useExecutePath) + { + temp = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location); + } return temp; } @@ -308,6 +320,10 @@ namespace OpenSim.Framework.Utilities { string temp; temp = "."; + if (m_useExecutePath) + { + temp = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location); + } return temp; } @@ -315,6 +331,10 @@ namespace OpenSim.Framework.Utilities { string temp; temp = "."; + if (m_useExecutePath) + { + temp = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location); + } return temp; } @@ -322,6 +342,10 @@ namespace OpenSim.Framework.Utilities { string temp; temp = "."; + if (m_useExecutePath) + { + temp = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location); + } return temp; } -- cgit v1.1