Skip to content

Commit

Permalink
交互模式直接运行
Browse files Browse the repository at this point in the history
  • Loading branch information
nnhy committed Nov 25, 2024
1 parent dc750b3 commit 54a6900
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions Stardust/Managers/ServiceController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -399,9 +399,18 @@ public Boolean Start()
// Windows桌面用户运行
if (Runtime.Windows && service.UserName == "$")
{
var desktop = new Desktop { Log = Log };
var pid = desktop.StartProcess(si.FileName, si.Arguments, si.WorkingDirectory);
p = Process.GetProcessById((Int32)pid);
// 交互模式直接运行
if (Environment.UserInteractive)
{
p = Process.Start(si);
}
else
{
// 桌面用户运行
var desktop = new Desktop { Log = Log };
var pid = desktop.StartProcess(si.FileName, si.Arguments, si.WorkingDirectory);
p = Process.GetProcessById((Int32)pid);
}
}
else
{
Expand Down

0 comments on commit 54a6900

Please sign in to comment.