Skip to content

Commit

Permalink
feat: 支持windows下桌面自启动,用于守护桌面应用。Windows自启动。自启动需要用户登录桌面,默认false使用系统服务
Browse files Browse the repository at this point in the history
  • Loading branch information
nnhy committed Aug 29, 2023
1 parent 70eb8d7 commit 389f2c1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 4 additions & 1 deletion StarAgent/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,13 @@ private static void Main(String[] args)
set.Save();
}

var set2 = StarAgentSetting.Current;
var svc = new MyService
{
StarSetting = set,
AgentSetting = StarAgentSetting.Current,
AgentSetting = set2,
UseAutorun = set2.UseAutorun,

Log = XTrace.Log,
};

Expand Down
4 changes: 4 additions & 0 deletions StarAgent/Setting.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ public class StarAgentSetting : Config<StarAgentSetting>
[Description("更新通道。默认Release")]
public String Channel { get; set; } = "Release";

/// <summary>Windows自启动。自启动需要用户登录桌面,默认false使用系统服务</summary>
[Description("Windows自启动。自启动需要用户登录桌面,默认false使用系统服务")]
public Boolean UseAutorun { get; set; }

/// <summary>延迟时间。重启进程或服务的延迟时间,默认3000ms</summary>
[Description("延迟时间。重启进程或服务的延迟时间,默认3000ms")]
public Int32 Delay { get; set; } = 3000;
Expand Down

0 comments on commit 389f2c1

Please sign in to comment.