Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
96724ae9ac | ||
|
|
46b3ab5da8 |
@@ -116,30 +116,33 @@ namespace mbts.ui.shell
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
string path = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\BTS\\stunnel\\";
|
string path = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\BTS\\stunnel\\";
|
||||||
if (File.Exists(path + "config\\stunnel.conf"))
|
Log.Ui.warn($"Looking for stunnel in {path}");
|
||||||
{
|
start_stunnel_from_path(path);
|
||||||
uint job_error = BTSUINativeMethods.setup_process_job_object();
|
path = new DirectoryInfo(AppDomain.CurrentDomain.BaseDirectory).FullName + "\\stunnel\\";
|
||||||
//if we can't put this process and stunnel into a job, try to stop stunnel then restart
|
Log.Ui.warn($"Looking for stunnel in {path}");
|
||||||
if(job_error != 0)
|
start_stunnel_from_path(path);
|
||||||
kill_stunnel();
|
path = "C:\\Program Files (x86)\\BTS\\stunnel\\";
|
||||||
start_stunnel(path, job_error);
|
Log.Ui.warn($"Last Time Looking for stunnel in {path}");
|
||||||
}
|
start_stunnel_from_path(path);
|
||||||
path = AppDomain.CurrentDomain.BaseDirectory + "\\..\\stunnel\\";
|
|
||||||
if (File.Exists(path + "config\\stunnel.conf"))
|
|
||||||
{
|
|
||||||
uint job_error = BTSUINativeMethods.setup_process_job_object();
|
|
||||||
//if we can't put this process and stunnel into a job, try to stop stunnel then restart
|
|
||||||
if (job_error != 0)
|
|
||||||
kill_stunnel();
|
|
||||||
start_stunnel(path, job_error);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
catch(Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
stunnel_job_error = "Error starting stunnel: " + ex.Message;
|
stunnel_job_error = "Error starting stunnel: " + ex.Message;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void start_stunnel_from_path(string path)
|
||||||
|
{
|
||||||
|
if (File.Exists(path + "config\\stunnel.conf"))
|
||||||
|
{
|
||||||
|
uint job_error = BTSUINativeMethods.setup_process_job_object();
|
||||||
|
//if we can't put this process and stunnel into a job, try to stop stunnel then restart
|
||||||
|
if (job_error != 0)
|
||||||
|
kill_stunnel();
|
||||||
|
start_stunnel(path, job_error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public new int Run() {
|
public new int Run() {
|
||||||
var argv = Environment.GetCommandLineArgs();
|
var argv = Environment.GetCommandLineArgs();
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in new issue
Block a user