Skip to content

Commit

Permalink
testMac
Browse files Browse the repository at this point in the history
  • Loading branch information
Mossimos committed May 5, 2022
1 parent 057d5c0 commit 02717fe
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
21 changes: 21 additions & 0 deletions src/Common.CoreLib/Process2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,27 @@ public static class Process2
{
const string TAG = "Process2";

static readonly Lazy<string> _bin_bash = new(() => string.Format("{0}bin{0}bash", Path.DirectorySeparatorChar));

/// <summary>
/// /bin/bash
/// </summary>
public static string BinBash => _bin_bash.Value;

public static Process? StartThis(uint appId, string fileName)
{
using var p = new Process();
p.StartInfo.FileName = BinBash;
p.StartInfo.Arguments = "";
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.RedirectStandardInput = true;
p.StartInfo.UseShellExecute = false;
p.Start();
p.StandardInput.WriteLine($"SteamAppId={appId}");
p.StandardInput.WriteLine(fileName);
return p;
}

/// <summary>
/// 通过指定应用程序的名称和路径参数来启动一个进程资源,并将该资源与新的 Process 组件相关联
/// </summary>
Expand Down
6 changes: 5 additions & 1 deletion src/ST.Client/Models/Steam/SteamApp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -555,10 +555,14 @@ public string GetIdAndName()
IApplication.ProgramPath,
$"-clt app -silence -id {AppId}");
}
else
else if (OperatingSystem2.IsLinux)
{
return Process = Process2.Start($" SteamAppId={AppId} | {IApplication.ProgramPath} -clt app -silence -id {AppId}");
}
else
{
return Process = Process2.StartThis(AppId, $"{IApplication.ProgramPath} -clt app -silence -id {AppId}");
}
}

#region Replace DLSS dll files methods
Expand Down

0 comments on commit 02717fe

Please sign in to comment.