From dade426ff720e3c9336270df37a96f2ece32ed24 Mon Sep 17 00:00:00 2001 From: proxysu Date: Sat, 27 Nov 2021 11:50:58 +0800 Subject: [PATCH] update --- ProxySuper.Core/Services/ServiceBase.cs | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) 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() {