mirror of
https://github.com/2dust/v2rayN.git
synced 2026-04-14 19:45:45 +00:00
Replace GetOptCore with GetOptBinPath for getting /opt/v2rayN/bin/ paths
This commit is contained in:
parent
33b9f15415
commit
f72f9df967
2 changed files with 12 additions and 3 deletions
|
|
@ -1093,14 +1093,23 @@ public class Utils
|
|||
}
|
||||
}
|
||||
|
||||
public static string GetOptCorePath(string filename = "")
|
||||
public static string GetOptBinPath(string filename, string? coreType = null)
|
||||
{
|
||||
var tempPath = Path.Combine("/opt/v2rayn-core");
|
||||
var tempPath = Path.Combine("/opt/v2rayN/","bin");
|
||||
if (!Directory.Exists(tempPath))
|
||||
{
|
||||
Directory.CreateDirectory(tempPath);
|
||||
}
|
||||
|
||||
if (coreType != null)
|
||||
{
|
||||
tempPath = Path.Combine(tempPath, coreType.ToLower().ToString());
|
||||
if (!Directory.Exists(tempPath))
|
||||
{
|
||||
Directory.CreateDirectory(tempPath);
|
||||
}
|
||||
}
|
||||
|
||||
if (filename.IsNullOrEmpty())
|
||||
{
|
||||
return tempPath;
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ public sealed class CoreInfoManager
|
|||
msg = string.Empty;
|
||||
foreach (var name in coreInfo?.CoreExes)
|
||||
{
|
||||
var vName = Utils.GetBinPath(Utils.GetExeName(name), coreInfo.CoreType.ToString());
|
||||
var vName = Utils.GetOptBinPath(Utils.GetExeName(name), coreInfo.CoreType.ToString());
|
||||
if (File.Exists(vName))
|
||||
{
|
||||
fileName = vName;
|
||||
|
|
|
|||
Loading…
Reference in a new issue