From 239228abd8dc1553577eaf4167a49f64fa50814c Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Thu, 1 May 2008 18:49:42 +0000 Subject: Attempt to locate SL client in LaunchSLClient under other Unices. --- .../Tools/LaunchSLClient/LaunchSLClient/OSXConfig.cs | 6 +++--- .../Tools/LaunchSLClient/LaunchSLClient/UnixConfig.cs | 18 ++++++++++++++---- .../LaunchSLClient/LaunchSLClient/WindowsConfig.cs | 11 +++++++++-- 3 files changed, 26 insertions(+), 9 deletions(-) (limited to 'OpenSim/Tools') diff --git a/OpenSim/Tools/LaunchSLClient/LaunchSLClient/OSXConfig.cs b/OpenSim/Tools/LaunchSLClient/LaunchSLClient/OSXConfig.cs index 0d866af..177d7e8 100644 --- a/OpenSim/Tools/LaunchSLClient/LaunchSLClient/OSXConfig.cs +++ b/OpenSim/Tools/LaunchSLClient/LaunchSLClient/OSXConfig.cs @@ -43,13 +43,13 @@ namespace LaunchSLClient exePath = "/Applications/Second Life Release Candidate.app/Contents/MacOS"; } - runLine = exePath + "/Second Life"; - exeFlags = ""; + runLine = Path.Combine(exePath, "Second Life"); + exeFlags = string.Empty; } public override string GetConfigDir() { - return ""; + return string.Empty; } } } diff --git a/OpenSim/Tools/LaunchSLClient/LaunchSLClient/UnixConfig.cs b/OpenSim/Tools/LaunchSLClient/LaunchSLClient/UnixConfig.cs index 220ad82..c285066 100644 --- a/OpenSim/Tools/LaunchSLClient/LaunchSLClient/UnixConfig.cs +++ b/OpenSim/Tools/LaunchSLClient/LaunchSLClient/UnixConfig.cs @@ -34,14 +34,24 @@ namespace LaunchSLClient { public override void GetClient(ref string exePath, ref string runLine, ref string exeFlags) { - exePath = ""; - runLine = "secondlife"; - exeFlags = ""; + exePath = string.Empty; + exeFlags = string.Empty; + + foreach (string path in Environment.GetEnvironmentVariable("PATH").Split(':')) + { + if (File.Exists(Path.Combine(path, "secondlife"))) + { + exePath = path; + break; + } + } + + runLine = Path.Combine(exePath, "secondlife"); } public override string GetConfigDir() { - return ""; + return string.Empty; } } } diff --git a/OpenSim/Tools/LaunchSLClient/LaunchSLClient/WindowsConfig.cs b/OpenSim/Tools/LaunchSLClient/LaunchSLClient/WindowsConfig.cs index df56bfe..7988d96 100644 --- a/OpenSim/Tools/LaunchSLClient/LaunchSLClient/WindowsConfig.cs +++ b/OpenSim/Tools/LaunchSLClient/LaunchSLClient/WindowsConfig.cs @@ -47,7 +47,7 @@ namespace LaunchSLClient string exe = regKey.GetValue("Exe").ToString(); exeFlags = regKey.GetValue("Flags").ToString(); exePath = regKey.GetValue("").ToString(); - runLine = exePath + "\\" + exe; + runLine = Path.Combine(exePath, exe); Registry.LocalMachine.Flush(); Registry.LocalMachine.Close(); } @@ -56,7 +56,14 @@ namespace LaunchSLClient { RegistryKey key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\OpenSim\OpenSim"); - return key == null ? "" : key.GetValue("Path").ToString(); + if (key == null) + { + return string.Empty; + } + else + { + return key.GetValue("Path").ToString(); + } } } } -- cgit v1.1