Skip to content

Commit

Permalink
feat: 崩铁不关闭现存的进程
Browse files Browse the repository at this point in the history
  • Loading branch information
huiyadanli committed May 26, 2023
1 parent a941ce5 commit 6743246
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions MiHoYoStarter/GameFormControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -238,11 +238,13 @@ private void btnhStartClick(object sender, EventArgs e)

try
{
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.UseShellExecute = true;
startInfo.WorkingDirectory = Environment.CurrentDirectory;
startInfo.FileName = txtPath.Text;
startInfo.Verb = "runas";
ProcessStartInfo startInfo = new ProcessStartInfo
{
UseShellExecute = true,
WorkingDirectory = Environment.CurrentDirectory,
FileName = txtPath.Text,
Verb = "runas"
};
if (txtStartParam != null && !string.IsNullOrEmpty(txtStartParam.Text))
{
startInfo.Arguments = txtStartParam.Text;
Expand Down Expand Up @@ -339,7 +341,7 @@ private void Switch(string name)
formMain.UpdateBottomLabel($"账户切换至【{name}】成功!");
if (chkAutoStart.Checked)
{
if (pros.Any())
if (pros.Any() && ProcessName != "StarRail")
{
pros[0].Kill();
Thread.Sleep(200);
Expand Down

0 comments on commit 6743246

Please sign in to comment.