更新后删除配置

This commit is contained in:
Pan Qiancheng 2025-04-23 20:11:16 +08:00
parent a373ac8a2f
commit b95678b745
1 changed files with 7 additions and 4 deletions

View File

@ -139,14 +139,19 @@ func checkAndUpdate() {
return
}
// 删除info文件下次再试
err = handler.RemoveUpdateInfo(exePath)
if err != nil {
logger.Error("Error removing update info: %v", err)
return
}
exeDir := filepath.Dir(exePath)
// 先更新so文件
logger.Debug("Updating so file...")
err = handler.ExecuteUpdate(exeDir, info.SoFileNewPath, info.SoFileOldPath, info.SoTargetPath, false)
if err != nil {
logger.Error("Error updating so file: %v", err)
// 删除info文件下次再试
handler.RemoveUpdateInfo(exePath)
return
}
// 更新exe程序
@ -155,8 +160,6 @@ func checkAndUpdate() {
err = handler.ExecuteUpdate(exeDir, info.ExeFileNewPath, info.ExeFileOldPath, info.ExeTargetPath, true)
if err != nil {
logger.Error("Error updating exe file: %v", err)
// 删除info文件下次再试
handler.RemoveUpdateInfo(exePath)
return
}
}