From 344f2f7e759c6ad7cf989bdc73b0412698206147 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=BE=89=E9=B8=AD=E8=9B=8B?= Date: Sat, 15 Jun 2024 00:37:39 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86=E6=96=87=E4=BB=B6=E4=B8=8D?= =?UTF-8?q?=E5=AD=98=E5=9C=A8=E4=BD=86=E6=98=AF=E5=B8=8C=E6=9C=9B=E6=89=93?= =?UTF-8?q?=E8=A1=A5=E4=B8=81=E7=9A=84=E6=83=85=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- RevokeMsgPatcher/Modifier/QQNTModifier.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/RevokeMsgPatcher/Modifier/QQNTModifier.cs b/RevokeMsgPatcher/Modifier/QQNTModifier.cs index 95816cb..c6bab8c 100644 --- a/RevokeMsgPatcher/Modifier/QQNTModifier.cs +++ b/RevokeMsgPatcher/Modifier/QQNTModifier.cs @@ -106,7 +106,14 @@ namespace RevokeMsgPatcher.Modifier string content = File.ReadAllText(indexPath); // 正则 require\(String.raw`.*`\); string pattern = @"require\(String.raw`.*`\);"; - string replacement = $"require(String.raw`{GetLiteLoaderPath()}`);"; + string liteLoaderPath = GetLiteLoaderPath(); + if (!File.Exists(liteLoaderPath)) + { + MessageBox.Show("LiteLoaderQQNT文件夹不存在,仅安装QQNT去验证补丁", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning); + return; + } + + string replacement = $"require(String.raw`{liteLoaderPath}`);"; if (Regex.IsMatch(content, pattern)) { content = Regex.Replace(content, pattern, replacement);