From 3d55bad323c02c7e31ecf89df50397e44af1b4d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=99=BA=E8=83=BD=E5=A4=A7=E7=9F=B3=E5=A4=B4?= Date: Mon, 18 Sep 2023 01:06:40 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=85=AC=E5=BC=80FixGdi?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Stardust/StarClient.cs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/Stardust/StarClient.cs b/Stardust/StarClient.cs index 7f5edf21..6dbca22c 100644 --- a/Stardust/StarClient.cs +++ b/Stardust/StarClient.cs @@ -274,7 +274,9 @@ public NodeInfo GetNodeInfo() } #if NETCOREAPP || NETSTANDARD - private void FixGdi(NodeInfo di) + /// 更新分辨率信息 + /// + public static void FixGdi(NodeInfo di) { try { @@ -283,10 +285,10 @@ private void FixGdi(NodeInfo di) if (num == 0) { var xx = new Single[1]; - var numx = NativeMethods.GdipGetDpiX(new HandleRef(this, graphics), xx); + var numx = NativeMethods.GdipGetDpiX(new HandleRef(di, graphics), xx); var yy = new Single[1]; - var numy = NativeMethods.GdipGetDpiY(new HandleRef(this, graphics), yy); + var numy = NativeMethods.GdipGetDpiY(new HandleRef(di, graphics), yy); if (numx == 0 && numy == 0) di.Dpi = $"{xx[0]}*{yy[0]}"; } @@ -501,10 +503,7 @@ public async Task Ping() if (dt.Year > 2000) _span = dt.AddMilliseconds(Delay / 2) - DateTime.UtcNow; // 令牌 - if (!rs.Token.IsNullOrEmpty()) - { - Token = rs.Token; - } + if (!rs.Token.IsNullOrEmpty()) Token = rs.Token; // 推队列 if (rs.Commands != null && rs.Commands.Length > 0) From dcff7c39f4a67782ee06c2940a390c37750fa517 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=99=BA=E8=83=BD=E5=A4=A7=E7=9F=B3=E5=A4=B4?= Date: Mon, 18 Sep 2023 23:58:25 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=8D=87=E7=BA=A7=E5=9F=BA=E7=A1=80?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=EF=BC=8C=E5=BC=95=E5=85=A5net8.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ClientTest/ClientTest.csproj | 2 +- StarAgent/Properties/PublishProfiles/win-x64.pubxml | 7 ++++--- StarAgent/StarAgent.csproj | 9 ++++++++- Stardust.Data/Stardust.Data.csproj | 2 +- Stardust.Server/Stardust.Server.csproj | 2 +- Stardust.Web/Stardust.Web.csproj | 4 ++-- Stardust/AppClient.cs | 1 + Stardust/DingTalk/DingTalkClient.cs | 3 ++- Stardust/LocalStarClient.cs | 1 + Stardust/Managers/ServiceManager.cs | 3 ++- Stardust/Monitors/StarTracer.cs | 1 + Stardust/StarClient.cs | 1 + Stardust/Stardust.csproj | 2 +- Stardust/Web/Upgrade.cs | 1 + Stardust/WeiXin/WeiXinClient.cs | 3 ++- Test/Test.csproj | 2 +- 16 files changed, 30 insertions(+), 14 deletions(-) diff --git a/ClientTest/ClientTest.csproj b/ClientTest/ClientTest.csproj index 59eb01f8..b2af7281 100644 --- a/ClientTest/ClientTest.csproj +++ b/ClientTest/ClientTest.csproj @@ -21,7 +21,7 @@ - + diff --git a/StarAgent/Properties/PublishProfiles/win-x64.pubxml b/StarAgent/Properties/PublishProfiles/win-x64.pubxml index 43ca3107..579a0e69 100644 --- a/StarAgent/Properties/PublishProfiles/win-x64.pubxml +++ b/StarAgent/Properties/PublishProfiles/win-x64.pubxml @@ -6,12 +6,13 @@ https://go.microsoft.com/fwlink/?LinkID=208121. Release Any CPU - ..\Bin\Agent\net6.0\publish\win-x64\ + ..\Bin\Agent\publish\win-x64\ FileSystem - net6.0 - false + net7.0 + true win-x64 false false + true \ No newline at end of file diff --git a/StarAgent/StarAgent.csproj b/StarAgent/StarAgent.csproj index b8c30b7c..e2b4e245 100644 --- a/StarAgent/StarAgent.csproj +++ b/StarAgent/StarAgent.csproj @@ -24,6 +24,13 @@ 1701;1702;NU5104;NETSDK1138;CS7035 + + true + Size + true + false + + @@ -33,7 +40,7 @@ - + diff --git a/Stardust.Data/Stardust.Data.csproj b/Stardust.Data/Stardust.Data.csproj index 3662b93b..2c752452 100644 --- a/Stardust.Data/Stardust.Data.csproj +++ b/Stardust.Data/Stardust.Data.csproj @@ -39,7 +39,7 @@ - + diff --git a/Stardust.Server/Stardust.Server.csproj b/Stardust.Server/Stardust.Server.csproj index 6814f5d5..d49b2849 100644 --- a/Stardust.Server/Stardust.Server.csproj +++ b/Stardust.Server/Stardust.Server.csproj @@ -32,7 +32,7 @@ - + diff --git a/Stardust.Web/Stardust.Web.csproj b/Stardust.Web/Stardust.Web.csproj index 30f24e7d..2b0148bd 100644 --- a/Stardust.Web/Stardust.Web.csproj +++ b/Stardust.Web/Stardust.Web.csproj @@ -42,8 +42,8 @@ - - + + diff --git a/Stardust/AppClient.cs b/Stardust/AppClient.cs index ce1e60dc..903d7311 100644 --- a/Stardust/AppClient.cs +++ b/Stardust/AppClient.cs @@ -12,6 +12,7 @@ using Stardust.Services; using NewLife.Caching; using System; +using System.Net.Http; #if NET45_OR_GREATER || NETCOREAPP || NETSTANDARD using System.Net.WebSockets; using TaskEx = System.Threading.Tasks.Task; diff --git a/Stardust/DingTalk/DingTalkClient.cs b/Stardust/DingTalk/DingTalkClient.cs index 2c521261..e38fd308 100644 --- a/Stardust/DingTalk/DingTalkClient.cs +++ b/Stardust/DingTalk/DingTalkClient.cs @@ -1,4 +1,5 @@ -using NewLife; +using System.Net.Http; +using NewLife; using NewLife.Log; using NewLife.Remoting; using Stardust.WeiXin; diff --git a/Stardust/LocalStarClient.cs b/Stardust/LocalStarClient.cs index 066d644e..e6a809b9 100644 --- a/Stardust/LocalStarClient.cs +++ b/Stardust/LocalStarClient.cs @@ -1,6 +1,7 @@ using System.ComponentModel; using System.Diagnostics; using System.Net; +using System.Net.Http; using System.Net.NetworkInformation; using System.Net.Sockets; using NewLife; diff --git a/Stardust/Managers/ServiceManager.cs b/Stardust/Managers/ServiceManager.cs index b5c7a1f4..d13c7abe 100644 --- a/Stardust/Managers/ServiceManager.cs +++ b/Stardust/Managers/ServiceManager.cs @@ -1,4 +1,5 @@ -using NewLife; +using System.Net.Http; +using NewLife; using NewLife.Http; using NewLife.IO; using NewLife.Log; diff --git a/Stardust/Monitors/StarTracer.cs b/Stardust/Monitors/StarTracer.cs index f60a87f2..335b7a72 100644 --- a/Stardust/Monitors/StarTracer.cs +++ b/Stardust/Monitors/StarTracer.cs @@ -1,5 +1,6 @@ using System.Collections.Concurrent; using System.Diagnostics; +using System.Net.Http; using System.Net.Sockets; using System.Reflection; using NewLife; diff --git a/Stardust/StarClient.cs b/Stardust/StarClient.cs index 6dbca22c..f89fd555 100644 --- a/Stardust/StarClient.cs +++ b/Stardust/StarClient.cs @@ -15,6 +15,7 @@ using Stardust.Models; using Stardust.Services; using System; +using System.Net.Http; #if NET45_OR_GREATER || NETCOREAPP || NETSTANDARD using System.Net.WebSockets; using WebSocket = System.Net.WebSockets.WebSocket; diff --git a/Stardust/Stardust.csproj b/Stardust/Stardust.csproj index f58f3466..e67aae82 100644 --- a/Stardust/Stardust.csproj +++ b/Stardust/Stardust.csproj @@ -86,7 +86,7 @@ - + diff --git a/Stardust/Web/Upgrade.cs b/Stardust/Web/Upgrade.cs index 4b0675d5..c1f28e46 100644 --- a/Stardust/Web/Upgrade.cs +++ b/Stardust/Web/Upgrade.cs @@ -1,4 +1,5 @@ using System.Diagnostics; +using System.Net.Http; using System.Reflection; using NewLife; using NewLife.Log; diff --git a/Stardust/WeiXin/WeiXinClient.cs b/Stardust/WeiXin/WeiXinClient.cs index e0f8cdd7..15187548 100644 --- a/Stardust/WeiXin/WeiXinClient.cs +++ b/Stardust/WeiXin/WeiXinClient.cs @@ -1,4 +1,5 @@ -using NewLife; +using System.Net.Http; +using NewLife; using NewLife.Log; using NewLife.Remoting; diff --git a/Test/Test.csproj b/Test/Test.csproj index 54e56b67..bbd18cc0 100644 --- a/Test/Test.csproj +++ b/Test/Test.csproj @@ -25,7 +25,7 @@ - + From 33b053648d8f38f87370d6dcf2539ba33a618510 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8C=BF=E4=BA=BA=E6=98=93?= Date: Tue, 19 Sep 2023 17:16:08 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=85=A8=E5=B1=80?= =?UTF-8?q?=E5=91=BD=E4=BB=A4=E5=92=8C=E6=96=87=E4=BB=B6=E6=89=A7=E8=A1=8C?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E6=8B=89=E8=B5=B7=E7=9A=84Bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Stardust/Managers/ServiceController.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Stardust/Managers/ServiceController.cs b/Stardust/Managers/ServiceController.cs index 744b6e42..d24662e7 100644 --- a/Stardust/Managers/ServiceController.cs +++ b/Stardust/Managers/ServiceController.cs @@ -282,9 +282,16 @@ private Process RunZip(String file, String args, String workDir, ServiceInfo ser private Process RunExe(String file, String args, String workDir, ServiceInfo service) { //WriteLog("拉起进程:{0} {1}", file, args); + + var fileName = workDir.CombinePath(file).GetFullPath(); + if (!fileName.AsFile().Exists) + { + fileName = file; + } + var si = new ProcessStartInfo { - FileName = workDir.CombinePath(file).GetFullPath(), + FileName = fileName, Arguments = args, WorkingDirectory = workDir,