mirror of https://github.com/2dust/v2rayN
Add environment variables to geo files
parent
dec722e693
commit
9b05736746
|
@ -20,6 +20,9 @@ namespace v2rayN.Handler
|
|||
public CoreHandler(Action<bool, string> 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)
|
||||
|
|
|
@ -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, "");
|
||||
|
|
|
@ -116,10 +116,7 @@
|
|||
get; set;
|
||||
}
|
||||
|
||||
public bool ignoreGeoUpdateCore
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
public bool ignoreGeoUpdateCore { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// systemProxyExceptions
|
||||
|
|
|
@ -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 = "")
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue