Skip to content

Commit

Permalink
!2 修复全局命令和文件执行无法拉起的Bug
Browse files Browse the repository at this point in the history
Merge pull request !2 from DengHao/master
  • Loading branch information
nnhy authored and gitee-org committed Sep 19, 2023
2 parents 946e6e2 + 33b0536 commit 2555c91
Show file tree
Hide file tree
Showing 17 changed files with 44 additions and 22 deletions.
2 changes: 1 addition & 1 deletion ClientTest/ClientTest.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="NewLife.Redis" Version="5.5.2023.828-beta1607" />
<PackageReference Include="NewLife.Redis" Version="5.5.2023.915-beta0733" />
<PackageReference Include="NewLife.UnitTest" Version="1.0.2023.905" />
<PackageReference Include="xunit" Version="2.5.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.0">
Expand Down
7 changes: 4 additions & 3 deletions StarAgent/Properties/PublishProfiles/win-x64.pubxml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<PropertyGroup>
<Configuration>Release</Configuration>
<Platform>Any CPU</Platform>
<PublishDir>..\Bin\Agent\net6.0\publish\win-x64\</PublishDir>
<PublishDir>..\Bin\Agent\publish\win-x64\</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>
<TargetFramework>net6.0</TargetFramework>
<SelfContained>false</SelfContained>
<TargetFramework>net7.0</TargetFramework>
<SelfContained>true</SelfContained>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<PublishSingleFile>false</PublishSingleFile>
<PublishReadyToRun>false</PublishReadyToRun>
<PublishTrimmed>true</PublishTrimmed>
</PropertyGroup>
</Project>
9 changes: 8 additions & 1 deletion StarAgent/StarAgent.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@
<NoWarn>1701;1702;NU5104;NETSDK1138;CS7035</NoWarn>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)'=='net8.0'">
<PublishAot>true</PublishAot>
<OptimizationPreference>Size</OptimizationPreference>
<InvariantGlobalization>true</InvariantGlobalization>
<StackTraceSupport>false</StackTraceSupport>
</PropertyGroup>

<ItemGroup>
<Compile Remove="StarService2.cs" />
</ItemGroup>
Expand All @@ -33,7 +40,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="NewLife.Agent" Version="10.5.2023.910-beta0910" />
<PackageReference Include="NewLife.Agent" Version="10.5.2023.912-beta1050" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion Stardust.Data/Stardust.Data.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="NewLife.XCode" Version="11.9.2023.909-beta0001" />
<PackageReference Include="NewLife.XCode" Version="11.9.2023.914-beta0845" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion Stardust.Server/Stardust.Server.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="NewLife.Redis" Version="5.5.2023.828-beta1607" />
<PackageReference Include="NewLife.Redis" Version="5.5.2023.915-beta0733" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions Stardust.Web/Stardust.Web.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="NewLife.Cube.Core" Version="5.5.2023.901-beta1627" />
<PackageReference Include="NewLife.Redis" Version="5.5.2023.828-beta1607" />
<PackageReference Include="NewLife.Cube.Core" Version="5.5.2023.913-beta1139" />
<PackageReference Include="NewLife.Redis" Version="5.5.2023.915-beta0733" />
</ItemGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions Stardust/AppClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion Stardust/DingTalk/DingTalkClient.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using NewLife;
using System.Net.Http;
using NewLife;
using NewLife.Log;
using NewLife.Remoting;
using Stardust.WeiXin;
Expand Down
1 change: 1 addition & 0 deletions Stardust/LocalStarClient.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
9 changes: 8 additions & 1 deletion Stardust/Managers/ServiceController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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,

Expand Down
3 changes: 2 additions & 1 deletion Stardust/Managers/ServiceManager.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using NewLife;
using System.Net.Http;
using NewLife;
using NewLife.Http;
using NewLife.IO;
using NewLife.Log;
Expand Down
1 change: 1 addition & 0 deletions Stardust/Monitors/StarTracer.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Collections.Concurrent;
using System.Diagnostics;
using System.Net.Http;
using System.Net.Sockets;
using System.Reflection;
using NewLife;
Expand Down
14 changes: 7 additions & 7 deletions Stardust/StarClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -274,7 +275,9 @@ public NodeInfo GetNodeInfo()
}

#if NETCOREAPP || NETSTANDARD
private void FixGdi(NodeInfo di)
/// <summary>更新分辨率信息</summary>
/// <param name="di"></param>
public static void FixGdi(NodeInfo di)
{
try
{
Expand All @@ -283,10 +286,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]}";
}
Expand Down Expand Up @@ -501,10 +504,7 @@ public async Task<Object> 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)
Expand Down
2 changes: 1 addition & 1 deletion Stardust/Stardust.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)'!='net40'">
<PackageReference Include="NewLife.Core" Version="10.5.2023.903" />
<PackageReference Include="NewLife.Core" Version="10.6.2023.917-beta1405" />
<PackageReference Include="NewLife.Remoting" Version="2.3.2023.907" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)'=='net40'">
Expand Down
1 change: 1 addition & 0 deletions Stardust/Web/Upgrade.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Diagnostics;
using System.Net.Http;
using System.Reflection;
using NewLife;
using NewLife.Log;
Expand Down
3 changes: 2 additions & 1 deletion Stardust/WeiXin/WeiXinClient.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using NewLife;
using System.Net.Http;
using NewLife;
using NewLife.Log;
using NewLife.Remoting;

Expand Down
2 changes: 1 addition & 1 deletion Test/Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="NewLife.Core" Version="10.5.2023.906-beta0624" />
<PackageReference Include="NewLife.Core" Version="10.6.2023.917-beta1405" />
<PackageReference Include="SSH.NET" Version="2020.0.2" />
</ItemGroup>

Expand Down

0 comments on commit 2555c91

Please sign in to comment.