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() { diff --git a/ProxySuper.Core/Services/XrayService.cs b/ProxySuper.Core/Services/XrayService.cs index dce2df3..4c62dc9 100644 --- a/ProxySuper.Core/Services/XrayService.cs +++ b/ProxySuper.Core/Services/XrayService.cs @@ -268,7 +268,7 @@ namespace ProxySuper.Core.Services } - #region 似有方法 + #region 私有方法 private void DoUploadCert(object sender, CancelEventArgs e) { @@ -424,7 +424,6 @@ namespace ProxySuper.Core.Services WriteToFile(configJson, "/etc/caddy/Caddyfile"); } - private void UninstallXray() { Progress.Desc = "关闭Xray服务"; diff --git a/ProxySuper.WPF/Views/V2ray/V2rayConfigView.xaml b/ProxySuper.WPF/Views/V2ray/V2rayConfigView.xaml index 1bd3a07..728e2ab 100644 --- a/ProxySuper.WPF/Views/V2ray/V2rayConfigView.xaml +++ b/ProxySuper.WPF/Views/V2ray/V2rayConfigView.xaml @@ -22,6 +22,7 @@ BorderThickness="1,0,1,0" BorderBrush="#DDD" TabStripPlacement="Left" + x:Name="TabCtrl" SelectionChanged="BuildQrCode">