Portable Mode

This commit is contained in:
2dust
2022-04-13 19:58:15 +08:00
parent 88cfb8fcd5
commit 364586fac8

View File

@@ -179,12 +179,19 @@ namespace clashN.Handler
string fileName = FindCoreExe(coreInfo.coreExes); string fileName = FindCoreExe(coreInfo.coreExes);
if (fileName == "") return; if (fileName == "") return;
//Portable Mode
var arguments = coreInfo.arguments;
if (Directory.Exists(Utils.GetPath("data")))
{
arguments += $" -d {Utils.GetPath("")}";
}
Process p = new Process Process p = new Process
{ {
StartInfo = new ProcessStartInfo StartInfo = new ProcessStartInfo
{ {
FileName = fileName, FileName = fileName,
Arguments = coreInfo.arguments, Arguments = arguments,
WorkingDirectory = Utils.StartupPath(), WorkingDirectory = Utils.StartupPath(),
UseShellExecute = false, UseShellExecute = false,
RedirectStandardOutput = true, RedirectStandardOutput = true,