Attempt to locate SL client in LaunchSLClient under other Unices.

0.6.0-stable
Jeff Ames 2008-05-01 18:49:42 +00:00
parent 70f7672dad
commit 239228abd8
3 changed files with 26 additions and 9 deletions

View File

@ -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;
}
}
}

View File

@ -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;
}
}
}

View File

@ -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();
}
}
}
}