Improve clone custom configuration

pull/2295/head
2dust 2022-04-18 18:59:41 +08:00
parent 7eafae98d4
commit 8f5bb3591b
3 changed files with 14 additions and 4 deletions

View File

@ -152,7 +152,7 @@ namespace v2rayN.Forms
return;
}
address = Path.Combine(Utils.GetConfigPath(), address);
address = Utils.GetConfigPath(address);
Process.Start(address);
}
}

View File

@ -284,7 +284,17 @@ namespace v2rayN.Handler
vmessItem.indexId = string.Empty;
vmessItem.remarks = string.Format("{0}-clone", item.remarks);
AddServerCommon(ref config, vmessItem);
if (vmessItem.configType == EConfigType.Custom)
{
vmessItem.address = Utils.GetConfigPath(vmessItem.address);
if (AddCustomServer(ref config, vmessItem, false) == 0)
{
}
}
else
{
AddServerCommon(ref config, vmessItem);
}
}
ToJsonFile(config);
@ -442,7 +452,7 @@ namespace v2rayN.Handler
try
{
File.Copy(fileName, Path.Combine(Utils.GetConfigPath(), newFileName));
File.Copy(fileName, Utils.GetConfigPath(newFileName));
if (blDelete)
{
File.Delete(fileName);

View File

@ -941,7 +941,7 @@ namespace v2rayN.Handler
string addressFileName = node.address;
if (!File.Exists(addressFileName))
{
addressFileName = Path.Combine(Utils.GetConfigPath(), addressFileName);
addressFileName = Utils.GetConfigPath(addressFileName);
}
if (!File.Exists(addressFileName))
{