|
|
@ -200,6 +200,7 @@ namespace v2rayN.Handler |
|
|
|
WorkingDirectory = Utils.StartupPath(), |
|
|
|
WorkingDirectory = Utils.StartupPath(), |
|
|
|
UseShellExecute = false, |
|
|
|
UseShellExecute = false, |
|
|
|
RedirectStandardOutput = true, |
|
|
|
RedirectStandardOutput = true, |
|
|
|
|
|
|
|
RedirectStandardError = true, |
|
|
|
CreateNoWindow = true, |
|
|
|
CreateNoWindow = true, |
|
|
|
StandardOutputEncoding = Encoding.UTF8 |
|
|
|
StandardOutputEncoding = Encoding.UTF8 |
|
|
|
} |
|
|
|
} |
|
|
@ -217,6 +218,11 @@ namespace v2rayN.Handler |
|
|
|
//processId = p.Id; |
|
|
|
//processId = p.Id; |
|
|
|
_process = p; |
|
|
|
_process = p; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (p.WaitForExit(1000)) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
throw new Exception(p.StandardError.ReadToEnd()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Global.processJob.AddProcess(p.Handle); |
|
|
|
Global.processJob.AddProcess(p.Handle); |
|
|
|
} |
|
|
|
} |
|
|
|
catch (Exception ex) |
|
|
|
catch (Exception ex) |
|
|
@ -248,6 +254,7 @@ namespace v2rayN.Handler |
|
|
|
UseShellExecute = false, |
|
|
|
UseShellExecute = false, |
|
|
|
RedirectStandardInput = true, |
|
|
|
RedirectStandardInput = true, |
|
|
|
RedirectStandardOutput = true, |
|
|
|
RedirectStandardOutput = true, |
|
|
|
|
|
|
|
RedirectStandardError = true, |
|
|
|
CreateNoWindow = true, |
|
|
|
CreateNoWindow = true, |
|
|
|
StandardOutputEncoding = Encoding.UTF8 |
|
|
|
StandardOutputEncoding = Encoding.UTF8 |
|
|
|
} |
|
|
|
} |
|
|
@ -266,6 +273,11 @@ namespace v2rayN.Handler |
|
|
|
p.StandardInput.Write(configStr); |
|
|
|
p.StandardInput.Write(configStr); |
|
|
|
p.StandardInput.Close(); |
|
|
|
p.StandardInput.Close(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (p.WaitForExit(1000)) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
throw new Exception(p.StandardError.ReadToEnd()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Global.processJob.AddProcess(p.Handle); |
|
|
|
Global.processJob.AddProcess(p.Handle); |
|
|
|
return p.Id; |
|
|
|
return p.Id; |
|
|
|
} |
|
|
|
} |
|
|
@ -273,7 +285,7 @@ namespace v2rayN.Handler |
|
|
|
{ |
|
|
|
{ |
|
|
|
Utils.SaveLog(ex.Message, ex); |
|
|
|
Utils.SaveLog(ex.Message, ex); |
|
|
|
string msg = ex.Message; |
|
|
|
string msg = ex.Message; |
|
|
|
ShowMsg(true, msg); |
|
|
|
ShowMsg(false, msg); |
|
|
|
return -1; |
|
|
|
return -1; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|