Skip to content

Commit

Permalink
fix:修复了安装服务需要加更多启动参数时,导致获取不了主程序dll路径的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
fat-snail committed Sep 6, 2024
1 parent e7bf7e2 commit 7aa20e6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions NewLife.Agent/CommandHandler/Install.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ public override void Process(String[] args)
if (exe.Contains(' ')) exe = $"\"{exe}\"";

var dll = args[0].GetFullPath();
if (!dll.Contains(".dll"))//没有获得到主程的dll
{
dll = Environment.CommandLine?.Split(' ')[0];//Assembly.GetExecutingAssembly().Location;
}

if (dll.Contains(' ')) dll = $"\"{dll}\"";

if (fileName.EqualIgnoreCase("dotnet", "dotnet.exe", "java"))
Expand Down

0 comments on commit 7aa20e6

Please sign in to comment.