Skip to content

Commit

Permalink
Merge pull request #19 from Fat-Snail/master
Browse files Browse the repository at this point in the history
fix:修复了安装服务需要加更多启动参数时,导致获取不了主程序dll路径的bug
  • Loading branch information
nnhy authored Sep 9, 2024
2 parents 3c90dd0 + 7aa20e6 commit d9ac8e8
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 d9ac8e8

Please sign in to comment.