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)
|
public CoreHandler(Action<bool, string> update)
|
||||||
{
|
{
|
||||||
_updateFunc = 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)
|
public void LoadCore(Config config)
|
||||||
|
|
|
@ -278,11 +278,13 @@ namespace v2rayN.Handler
|
||||||
string fileName = Utils.GetTempPath(Utils.GetDownloadFileName(url));
|
string fileName = Utils.GetTempPath(Utils.GetDownloadFileName(url));
|
||||||
if (File.Exists(fileName))
|
if (File.Exists(fileName))
|
||||||
{
|
{
|
||||||
Global.coreTypes.ForEach(it =>
|
//Global.coreTypes.ForEach(it =>
|
||||||
{
|
//{
|
||||||
string targetPath = Utils.GetBinPath($"{geoName}.dat", (ECoreType)Enum.Parse(typeof(ECoreType), 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.Copy(fileName, targetPath, true);
|
||||||
});
|
|
||||||
|
|
||||||
File.Delete(fileName);
|
File.Delete(fileName);
|
||||||
//_updateFunc(true, "");
|
//_updateFunc(true, "");
|
||||||
|
|
|
@ -116,10 +116,7 @@
|
||||||
get; set;
|
get; set;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool ignoreGeoUpdateCore
|
public bool ignoreGeoUpdateCore { get; set; } = true;
|
||||||
{
|
|
||||||
get; set;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// systemProxyExceptions
|
/// systemProxyExceptions
|
||||||
|
|
|
@ -1117,8 +1117,15 @@ namespace v2rayN
|
||||||
Directory.CreateDirectory(_tempPath);
|
Directory.CreateDirectory(_tempPath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (string.IsNullOrEmpty(filename))
|
||||||
|
{
|
||||||
|
return _tempPath;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
return Path.Combine(_tempPath, filename);
|
return Path.Combine(_tempPath, filename);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
public static string GetLogPath(string filename = "")
|
public static string GetLogPath(string filename = "")
|
||||||
{
|
{
|
||||||
string _tempPath = Path.Combine(StartupPath(), "guiLogs");
|
string _tempPath = Path.Combine(StartupPath(), "guiLogs");
|
||||||
|
|
Loading…
Reference in New Issue