diff --git a/ProxySuper.Core/Services/ServiceBase.cs b/ProxySuper.Core/Services/ServiceBase.cs index 75f677a..d3dbd80 100644 --- a/ProxySuper.Core/Services/ServiceBase.cs +++ b/ProxySuper.Core/Services/ServiceBase.cs @@ -327,7 +327,7 @@ namespace ProxySuper.Core.Services var result = RunCmd("id -u"); if (!result.Equals("0\n")) { - throw new Exception("ProxySU需要使用Root用户进行安装!"); + throw new Exception("请使用Root权限账户登录!"); } } @@ -365,6 +365,9 @@ namespace ProxySuper.Core.Services public void InstallSystemTools() { + Progress.Desc = ("更新安装包"); + RunUpdateCmd(); + Progress.Desc = ("安装sudo工具"); InstallSoftware("sudo"); @@ -768,6 +771,22 @@ namespace ProxySuper.Core.Services } } + private void RunUpdateCmd() + { + if (CmdType == CmdType.Apt) + { + RunCmd($"apt update -y"); + } + else if (CmdType == CmdType.Yum) + { + RunCmd($"yum update -y"); + } + else + { + RunCmd($"dnf update -y"); + } + } + private ConnectionInfo CreateConnectionInfo() {