aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Tools
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Tools')
-rw-r--r--OpenSim/Tools/LaunchSLClient/LaunchSLClient/Form1.cs25
-rw-r--r--OpenSim/Tools/LaunchSLClient/LaunchSLClient/MachineConfig.cs1
-rw-r--r--OpenSim/Tools/LaunchSLClient/LaunchSLClient/OSXConfig.cs5
-rw-r--r--OpenSim/Tools/LaunchSLClient/LaunchSLClient/UnixConfig.cs5
-rw-r--r--OpenSim/Tools/LaunchSLClient/LaunchSLClient/WindowsConfig.cs7
5 files changed, 29 insertions, 14 deletions
diff --git a/OpenSim/Tools/LaunchSLClient/LaunchSLClient/Form1.cs b/OpenSim/Tools/LaunchSLClient/LaunchSLClient/Form1.cs
index 700c004..a0eca6e 100644
--- a/OpenSim/Tools/LaunchSLClient/LaunchSLClient/Form1.cs
+++ b/OpenSim/Tools/LaunchSLClient/LaunchSLClient/Form1.cs
@@ -36,7 +36,6 @@ using System.Drawing;
36using System.Text; 36using System.Text;
37using System.Text.RegularExpressions; 37using System.Text.RegularExpressions;
38using System.Windows.Forms; 38using System.Windows.Forms;
39using Microsoft.Win32;
40 39
41namespace LaunchSLClient 40namespace LaunchSLClient
42{ 41{
@@ -96,9 +95,9 @@ namespace LaunchSLClient
96 95
97 private void addLocalSandbox(ref ArrayList menuItems) 96 private void addLocalSandbox(ref ArrayList menuItems)
98 { 97 {
99 // build sandbox URL from Regions\default.xml 98 // build sandbox URL from Regions/default.xml
100 // this is highly dependant on a standard default.xml 99 // this is highly dependant on a standard default.xml
101 if (File.Exists(@"Regions\default.xml")) 100 if (File.Exists("Regions/default.xml"))
102 { 101 {
103 string sandboxHostName = ""; 102 string sandboxHostName = "";
104 string sandboxPort = ""; 103 string sandboxPort = "";
@@ -106,7 +105,7 @@ namespace LaunchSLClient
106 105
107 Regex myRegex = new Regex(".*internal_ip_port=\\\"(?<port>.*?)\\\".*external_host_name=\\\"(?<name>.*?)\\\".*"); 106 Regex myRegex = new Regex(".*internal_ip_port=\\\"(?<port>.*?)\\\".*external_host_name=\\\"(?<name>.*?)\\\".*");
108 107
109 FileInfo defaultFile = new FileInfo(@"Regions\default.xml"); 108 FileInfo defaultFile = new FileInfo("Regions/default.xml");
110 StreamReader stream = defaultFile.OpenText(); 109 StreamReader stream = defaultFile.OpenText();
111 do 110 do
112 { 111 {
@@ -136,10 +135,10 @@ namespace LaunchSLClient
136 { 135 {
137 //build local grid URL from network_servers_information.xml 136 //build local grid URL from network_servers_information.xml
138 // this is highly dependant on a standard default.xml 137 // this is highly dependant on a standard default.xml
139 if (File.Exists(@"network_servers_information.xml")) 138 if (File.Exists("network_servers_information.xml"))
140 { 139 {
141 string text; 140 string text;
142 FileInfo defaultFile = new FileInfo(@"network_servers_information.xml"); 141 FileInfo defaultFile = new FileInfo("network_servers_information.xml");
143 Regex myRegex = new Regex(".*UserServerURL=\\\"(?<url>.*?)\\\".*"); 142 Regex myRegex = new Regex(".*UserServerURL=\\\"(?<url>.*?)\\\".*");
144 StreamReader stream = defaultFile.OpenText(); 143 StreamReader stream = defaultFile.OpenText();
145 144
@@ -168,13 +167,11 @@ namespace LaunchSLClient
168 167
169 private void addLocalSims(ref ArrayList menuItems) 168 private void addLocalSims(ref ArrayList menuItems)
170 { 169 {
171 // find opensim directory 170 string configDir = m_machineConfig.GetConfigDir();
172 RegistryKey exeKey = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\OpenSim\OpenSim");
173 if (exeKey != null)
174 {
175 Object simPath = exeKey.GetValue("Path");
176 171
177 Directory.SetCurrentDirectory(simPath.ToString()); //this should be set to wherever we decide to put the binaries 172 if (!string.IsNullOrEmpty(configDir))
173 {
174 Directory.SetCurrentDirectory(configDir);
178 175
179 addLocalSandbox(ref menuItems); 176 addLocalSandbox(ref menuItems);
180 addLocalGrid(ref menuItems); 177 addLocalGrid(ref menuItems);
@@ -193,10 +190,10 @@ namespace LaunchSLClient
193 190
194 System.Diagnostics.Process proc = new System.Diagnostics.Process(); 191 System.Diagnostics.Process proc = new System.Diagnostics.Process();
195 proc.StartInfo.FileName = runLine; 192 proc.StartInfo.FileName = runLine;
196 proc.StartInfo.Arguments = exeFlags.ToString() + " " + runUrl; 193 proc.StartInfo.Arguments = exeFlags + " " + runUrl;
197 proc.StartInfo.UseShellExecute = false; 194 proc.StartInfo.UseShellExecute = false;
198 proc.StartInfo.RedirectStandardOutput = false; 195 proc.StartInfo.RedirectStandardOutput = false;
199 proc.StartInfo.WorkingDirectory = exePath.ToString(); 196 proc.StartInfo.WorkingDirectory = exePath;
200 proc.Start(); 197 proc.Start();
201 proc.WaitForExit(); 198 proc.WaitForExit();
202 } 199 }
diff --git a/OpenSim/Tools/LaunchSLClient/LaunchSLClient/MachineConfig.cs b/OpenSim/Tools/LaunchSLClient/LaunchSLClient/MachineConfig.cs
index 68a86c4..fea8d50 100644
--- a/OpenSim/Tools/LaunchSLClient/LaunchSLClient/MachineConfig.cs
+++ b/OpenSim/Tools/LaunchSLClient/LaunchSLClient/MachineConfig.cs
@@ -33,5 +33,6 @@ namespace LaunchSLClient
33 public abstract class MachineConfig 33 public abstract class MachineConfig
34 { 34 {
35 public abstract void GetClient(ref string exePath, ref string runLine, ref string exeFlags); 35 public abstract void GetClient(ref string exePath, ref string runLine, ref string exeFlags);
36 public abstract string GetConfigDir();
36 } 37 }
37} 38}
diff --git a/OpenSim/Tools/LaunchSLClient/LaunchSLClient/OSXConfig.cs b/OpenSim/Tools/LaunchSLClient/LaunchSLClient/OSXConfig.cs
index 60e5e48..0d866af 100644
--- a/OpenSim/Tools/LaunchSLClient/LaunchSLClient/OSXConfig.cs
+++ b/OpenSim/Tools/LaunchSLClient/LaunchSLClient/OSXConfig.cs
@@ -46,5 +46,10 @@ namespace LaunchSLClient
46 runLine = exePath + "/Second Life"; 46 runLine = exePath + "/Second Life";
47 exeFlags = ""; 47 exeFlags = "";
48 } 48 }
49
50 public override string GetConfigDir()
51 {
52 return "";
53 }
49 } 54 }
50} 55}
diff --git a/OpenSim/Tools/LaunchSLClient/LaunchSLClient/UnixConfig.cs b/OpenSim/Tools/LaunchSLClient/LaunchSLClient/UnixConfig.cs
index eb5342f..220ad82 100644
--- a/OpenSim/Tools/LaunchSLClient/LaunchSLClient/UnixConfig.cs
+++ b/OpenSim/Tools/LaunchSLClient/LaunchSLClient/UnixConfig.cs
@@ -38,5 +38,10 @@ namespace LaunchSLClient
38 runLine = "secondlife"; 38 runLine = "secondlife";
39 exeFlags = ""; 39 exeFlags = "";
40 } 40 }
41
42 public override string GetConfigDir()
43 {
44 return "";
45 }
41 } 46 }
42} 47}
diff --git a/OpenSim/Tools/LaunchSLClient/LaunchSLClient/WindowsConfig.cs b/OpenSim/Tools/LaunchSLClient/LaunchSLClient/WindowsConfig.cs
index f3b797c..df56bfe 100644
--- a/OpenSim/Tools/LaunchSLClient/LaunchSLClient/WindowsConfig.cs
+++ b/OpenSim/Tools/LaunchSLClient/LaunchSLClient/WindowsConfig.cs
@@ -51,5 +51,12 @@ namespace LaunchSLClient
51 Registry.LocalMachine.Flush(); 51 Registry.LocalMachine.Flush();
52 Registry.LocalMachine.Close(); 52 Registry.LocalMachine.Close();
53 } 53 }
54
55 public override string GetConfigDir()
56 {
57 RegistryKey key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\OpenSim\OpenSim");
58
59 return key == null ? "" : key.GetValue("Path").ToString();
60 }
54 } 61 }
55} 62}