mirror of
https://github.com/SpaceTimee/Sheas-Cealer.git
synced 2025-07-13 12:52:08 +08:00
1.1.3 -> 1.1.4 第81次更新
This commit is contained in:
parent
aa5765d168
commit
e962850d05
@ -91,7 +91,15 @@ public partial class MainWin : Window
|
||||
UpdateUpstreamHostButton_Click(null!, null!);
|
||||
});
|
||||
}
|
||||
private void MainWin_Closing(object sender, CancelEventArgs e) => Application.Current.Shutdown();
|
||||
private void MainWin_Closing(object sender, CancelEventArgs e)
|
||||
{
|
||||
if (MainPres.IsNginxIniting)
|
||||
File.WriteAllText(MainConst.NginxConfPath, ExtraNginxConfs);
|
||||
if (MainPres.IsMihomoIniting)
|
||||
File.WriteAllText(MainConst.MihomoConfPath, ExtraMihomoConfs);
|
||||
|
||||
Application.Current.Shutdown();
|
||||
}
|
||||
|
||||
private void MainWin_DragEnter(object sender, DragEventArgs e)
|
||||
{
|
||||
@ -263,6 +271,8 @@ public partial class MainWin : Window
|
||||
File.AppendAllText(MainConst.HostsConfPath, hostsConfAppendContent);
|
||||
#endregion Child Cert & Hosts
|
||||
|
||||
try
|
||||
{
|
||||
MainPres.IsNginxIniting = true;
|
||||
NginxConfWatcher.EnableRaisingEvents = false;
|
||||
NginxConfs!.Save(MainConst.NginxConfPath);
|
||||
@ -294,11 +304,14 @@ public partial class MainWin : Window
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
finally
|
||||
{
|
||||
File.WriteAllText(MainConst.NginxConfPath, ExtraNginxConfs);
|
||||
NginxConfWatcher.EnableRaisingEvents = true;
|
||||
MainPres.IsNginxIniting = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (Process nginxProcess in Process.GetProcessesByName(Path.GetFileNameWithoutExtension(MainConst.NginxPath)))
|
||||
@ -339,6 +352,8 @@ public partial class MainWin : Window
|
||||
if (!File.Exists(MainConst.MihomoConfPath))
|
||||
File.Create(MainConst.MihomoConfPath).Dispose();
|
||||
|
||||
try
|
||||
{
|
||||
MainPres.IsMihomoIniting = true;
|
||||
MihomoConfWatcher.EnableRaisingEvents = false;
|
||||
File.WriteAllText(MainConst.MihomoConfPath, MihomoConfs);
|
||||
@ -369,11 +384,14 @@ public partial class MainWin : Window
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
finally
|
||||
{
|
||||
File.WriteAllText(MainConst.MihomoConfPath, ExtraMihomoConfs);
|
||||
MihomoConfWatcher.EnableRaisingEvents = true;
|
||||
MainPres.IsMihomoIniting = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (Process mihomoProcess in Process.GetProcessesByName(Path.GetFileNameWithoutExtension(MainConst.MihomoPath)))
|
||||
|
Loading…
Reference in New Issue
Block a user