This commit is contained in:
2dust
2022-04-04 10:31:31 +08:00
parent 4ef1a518e0
commit bfea4df940
4 changed files with 19 additions and 0 deletions

View File

@@ -38,6 +38,12 @@ namespace clashN.Handler
return;
}
if (item.enableTun && !Utils.IsAdministrator())
{
ShowMsg(false, ResUI.EnableTunModeFailed);
return;
}
SetCore(config, item);
string fileName = Utils.GetPath(coreConfigRes);
if (CoreConfigHandler.GenerateClientConfig(item, fileName, false, out string msg) != 0)

View File

@@ -1010,5 +1010,12 @@ namespace clashN.Resx
return ResourceManager.GetString("NotRunAsAdmin", resourceCulture);
}
}
internal static string EnableTunModeFailed
{
get
{
return ResourceManager.GetString("EnableTunModeFailed", resourceCulture);
}
}
}
}

View File

@@ -376,4 +376,7 @@
<data name="RunAsAdmin" xml:space="preserve">
<value>Run As Admin</value>
</data>
<data name="EnableTunModeFailed" xml:space="preserve">
<value>Failed to enable tun mode, please run as administrator</value>
</data>
</root>

View File

@@ -376,4 +376,7 @@
<data name="RunAsAdmin" xml:space="preserve">
<value>以管理员身份运行</value>
</data>
<data name="EnableTunModeFailed" xml:space="preserve">
<value>启用 tun 模式失败, 请以管理员身份运行</value>
</data>
</root>