更新完自动关闭程序

This commit is contained in:
snltty
2024-07-21 17:35:33 +08:00
parent 58a4aabe84
commit 3a66aee95c
6 changed files with 13 additions and 11 deletions

View File

@@ -39,7 +39,9 @@ namespace linker.service
{
if (Process.GetProcessesByName(mainExeName).Any() == false)
{
if (File.Exists($"{mainExeName}.exe.temp"))
string filename = Process.GetCurrentProcess().MainModule.FileName;
string dir = Path.GetDirectoryName(filename);
if (File.Exists(Path.Combine(dir, $"{mainExeName}.exe.temp")))
{
RestartService();
}