From c23d06eec8d94ae641c8140276262224407b9859 Mon Sep 17 00:00:00 2001 From: huiyadanli Date: Thu, 27 May 2021 23:32:15 +0800 Subject: [PATCH] =?UTF-8?q?[+]=20=E6=B7=BB=E5=8A=A0=E8=A1=A5=E4=B8=81?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- RevokeMsgPatcher/FormMain.cs | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/RevokeMsgPatcher/FormMain.cs b/RevokeMsgPatcher/FormMain.cs index d268df4..1dad97d 100644 --- a/RevokeMsgPatcher/FormMain.cs +++ b/RevokeMsgPatcher/FormMain.cs @@ -24,6 +24,7 @@ namespace RevokeMsgPatcher private string thisVersion; private bool needUpdate = false; + private string getPatchJsonStatus = "GETTING"; // GETTING FAIL SUCCESS private GAHelper ga = new GAHelper(); // Google Analytics 记录 @@ -117,6 +118,18 @@ namespace RevokeMsgPatcher string version = modifier.GetVersion(); // 应用版本 ga.RequestPageView($"{enName}/{version}/patch", "点击防撤回"); + //if (getPatchJsonStatus != "SUCCESS") + //{ + // if (MessageBox.Show("当前程序未获取到最新补丁信息(或者正在获取中,如果成功请无视本提示),可能会出现补丁安装失败的情况,你可以通过以下方法重试:" + Environment.NewLine + // + "1. 重新启动本程序,重新获取最新补丁信息" + Environment.NewLine + // + "2. 如果每次都是[获取最新补丁信息失败],请检查自身网络是否有问题,或者等一段时间后重试" + Environment.NewLine + // + "点击 \"确定\" 继续安装补丁。", + // "提示", MessageBoxButtons.OKCancel) != DialogResult.OK) + // { + // return; + // } + //} + EnableAllButton(false); // a.重新初始化编辑器 modifier.InitEditors(txtPath.Text); @@ -165,7 +178,7 @@ namespace RevokeMsgPatcher modifier.Patch(); ga.RequestPageView($"{enName}/{version}/patch/succ", "补丁安装成功"); MessageBox.Show("补丁安装成功!"); - + } catch (BusinessException ex) { @@ -254,6 +267,8 @@ namespace RevokeMsgPatcher if (string.IsNullOrEmpty(json)) { lblUpdatePachJson.Text = "[ 获取最新补丁信息失败 ]"; + ga.RequestPageView($"/main/json/fail", $"获取最新补丁信息失败"); + getPatchJsonStatus = "FAIL"; } else { @@ -279,12 +294,15 @@ namespace RevokeMsgPatcher lblUpdatePachJson.Text = "[ 获取成功,点击查看更多信息 ]"; lblUpdatePachJson.ForeColor = Color.RoyalBlue; } + getPatchJsonStatus = "SUCCESS"; InitControls(); } catch (Exception ex) { Console.WriteLine(ex.Message); lblUpdatePachJson.Text = "[ 更换新配置时异常 ]"; + ga.RequestPageView($"/main/json/exception", $"更换新配置时异常"); + getPatchJsonStatus = "FAIL"; } } }