mirror of
https://github.com/2dust/v2rayN.git
synced 2025-07-01 20:42:10 +00:00
Determine .exe suffix based on OS in GenRoutingDirectExe
This commit is contained in:
parent
4f8648cbc9
commit
d696e8acde
1 changed files with 18 additions and 13 deletions
|
@ -1048,28 +1048,33 @@ public class CoreConfigSingboxService
|
||||||
|
|
||||||
private void GenRoutingDirectExe(out List<string> lstDnsExe, out List<string> lstDirectExe)
|
private void GenRoutingDirectExe(out List<string> lstDnsExe, out List<string> lstDirectExe)
|
||||||
{
|
{
|
||||||
lstDnsExe = new();
|
var dnsExeSet = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
|
||||||
lstDirectExe = new();
|
var directExeSet = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
|
||||||
var coreInfo = CoreInfoHandler.Instance.GetCoreInfo();
|
|
||||||
foreach (var it in coreInfo)
|
var coreInfoResult = CoreInfoHandler.Instance.GetCoreInfo();
|
||||||
|
var fileSuffix = Utils.IsWindows() ? ".exe" : "";
|
||||||
|
|
||||||
|
foreach (var coreConfig in coreInfoResult)
|
||||||
{
|
{
|
||||||
if (it.CoreType == ECoreType.v2rayN)
|
if (coreConfig.CoreType == ECoreType.v2rayN)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
foreach (var it2 in it.CoreExes)
|
|
||||||
{
|
|
||||||
if (!lstDnsExe.Contains(it2) && it.CoreType != ECoreType.sing_box)
|
|
||||||
{
|
|
||||||
lstDnsExe.Add($"{it2}.exe");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!lstDirectExe.Contains(it2))
|
foreach (var baseExeName in coreConfig.CoreExes)
|
||||||
|
{
|
||||||
|
var executableName = $"{baseExeName}{fileSuffix}";
|
||||||
|
|
||||||
|
if (coreConfig.CoreType != ECoreType.sing_box)
|
||||||
{
|
{
|
||||||
lstDirectExe.Add($"{it2}.exe");
|
dnsExeSet.Add(executableName);
|
||||||
}
|
}
|
||||||
|
directExeSet.Add(executableName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
lstDnsExe = new List<string>(dnsExeSet);
|
||||||
|
lstDirectExe = new List<string>(directExeSet);
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task<int> GenRoutingUserRule(RulesItem item, List<Rule4Sbox> rules)
|
private async Task<int> GenRoutingUserRule(RulesItem item, List<Rule4Sbox> rules)
|
||||||
|
|
Loading…
Reference in a new issue