diff --git a/v2rayN/v2rayN/Handler/CoreHandler.cs b/v2rayN/v2rayN/Handler/CoreHandler.cs index f07b39fc..c611b53f 100644 --- a/v2rayN/v2rayN/Handler/CoreHandler.cs +++ b/v2rayN/v2rayN/Handler/CoreHandler.cs @@ -20,6 +20,9 @@ namespace v2rayN.Handler public CoreHandler(Action update) { _updateFunc = update; + + Environment.SetEnvironmentVariable("v2ray.location.asset", Utils.GetBinPath(""), EnvironmentVariableTarget.Process); + Environment.SetEnvironmentVariable("xray.location.asset", Utils.GetBinPath(""), EnvironmentVariableTarget.Process); } public void LoadCore(Config config) diff --git a/v2rayN/v2rayN/Handler/UpdateHandle.cs b/v2rayN/v2rayN/Handler/UpdateHandle.cs index 7b44ae3d..ab1eab67 100644 --- a/v2rayN/v2rayN/Handler/UpdateHandle.cs +++ b/v2rayN/v2rayN/Handler/UpdateHandle.cs @@ -278,11 +278,13 @@ namespace v2rayN.Handler string fileName = Utils.GetTempPath(Utils.GetDownloadFileName(url)); if (File.Exists(fileName)) { - Global.coreTypes.ForEach(it => - { - string targetPath = Utils.GetBinPath($"{geoName}.dat", (ECoreType)Enum.Parse(typeof(ECoreType), it)); - File.Copy(fileName, targetPath, true); - }); + //Global.coreTypes.ForEach(it => + //{ + // string targetPath = Utils.GetBinPath($"{geoName}.dat", (ECoreType)Enum.Parse(typeof(ECoreType), it)); + // File.Copy(fileName, targetPath, true); + //}); + string targetPath = Utils.GetBinPath($"{geoName}.dat"); + File.Copy(fileName, targetPath, true); File.Delete(fileName); //_updateFunc(true, ""); diff --git a/v2rayN/v2rayN/Mode/Config.cs b/v2rayN/v2rayN/Mode/Config.cs index cfcc9668..85e92a2c 100644 --- a/v2rayN/v2rayN/Mode/Config.cs +++ b/v2rayN/v2rayN/Mode/Config.cs @@ -116,10 +116,7 @@ get; set; } - public bool ignoreGeoUpdateCore - { - get; set; - } + public bool ignoreGeoUpdateCore { get; set; } = true; /// /// systemProxyExceptions diff --git a/v2rayN/v2rayN/Tool/Utils.cs b/v2rayN/v2rayN/Tool/Utils.cs index c25d77f6..337cad86 100644 --- a/v2rayN/v2rayN/Tool/Utils.cs +++ b/v2rayN/v2rayN/Tool/Utils.cs @@ -1117,7 +1117,14 @@ namespace v2rayN Directory.CreateDirectory(_tempPath); } } - return Path.Combine(_tempPath, filename); + if (string.IsNullOrEmpty(filename)) + { + return _tempPath; + } + else + { + return Path.Combine(_tempPath, filename); + } } public static string GetLogPath(string filename = "") {