更新完自动关闭程序

This commit is contained in:
snltty
2024-07-21 16:36:39 +08:00
parent 406de15f67
commit 762da7d51b
3 changed files with 7 additions and 11 deletions

View File

@@ -57,7 +57,8 @@ jobs:
2. 自动更新,客户端和服务端 2. 自动更新,客户端和服务端
3. 更多的消息提醒,需要重启时提醒 3. 更多的消息提醒,需要重启时提醒
4. 脑抽 4. 脑抽
5. 更新服务端 5. 更新完自动重启
6. 请更新服务端
- name: upload win x64 - name: upload win x64
id: upload-win-x64 id: upload-win-x64

View File

@@ -2,7 +2,6 @@
using linker.config; using linker.config;
using linker.plugins.client; using linker.plugins.client;
using linker.plugins.messenger; using linker.plugins.messenger;
using linker.plugins.server;
using linker.plugins.updater.messenger; using linker.plugins.updater.messenger;
using MemoryPack; using MemoryPack;
using System.Collections.Concurrent; using System.Collections.Concurrent;

View File

@@ -46,8 +46,9 @@ namespace linker.plugins.updater
updateInfo.Status = UpdateStatus.Checked; updateInfo.Status = UpdateStatus.Checked;
} }
catch (Exception) catch (Exception ex)
{ {
LoggerHelper.Instance.Error(ex);
updateInfo.Status = status; updateInfo.Status = status;
} }
} }
@@ -95,10 +96,7 @@ namespace linker.plugins.updater
} }
catch (Exception ex) catch (Exception ex)
{ {
if (LoggerHelper.Instance.LoggerLevel <= LoggerTypes.DEBUG) LoggerHelper.Instance.Error(ex);
{
LoggerHelper.Instance.Error(ex);
}
try try
{ {
File.Delete("updater.zip"); File.Delete("updater.zip");
@@ -183,10 +181,7 @@ namespace linker.plugins.updater
} }
catch (Exception ex) catch (Exception ex)
{ {
if (LoggerHelper.Instance.LoggerLevel <= LoggerTypes.DEBUG) LoggerHelper.Instance.Error(ex);
{
LoggerHelper.Instance.Error(ex);
}
updateInfo.Status = status; updateInfo.Status = status;
} }
} }
@@ -197,6 +192,7 @@ namespace linker.plugins.updater
{ {
await DownloadUpdate(updateInfo, version); await DownloadUpdate(updateInfo, version);
await ExtractUpdate(updateInfo); await ExtractUpdate(updateInfo);
Environment.Exit(1);
}); });
} }