Skip to content

Commit a42bdc8

Browse files
committed
feature: 删除遗言机制冗余代码
1 parent b91cdf8 commit a42bdc8

File tree

8 files changed

+2
-278
lines changed

8 files changed

+2
-278
lines changed

src/c#/GeneralUpdate.Client/MySample.cs

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
using GeneralUpdate.Core.Events.CommonArgs;
77
using GeneralUpdate.Core.Events.MultiEventArgs;
88
using GeneralUpdate.Core.Strategys.PlatformWindows;
9-
using GeneralUpdate.Core.WillMessage;
109
using GeneralUpdate.Differential;
1110
using System.Diagnostics;
1211
using System.Text;
@@ -294,28 +293,6 @@ private bool IsDriverFile(string filePath) =>
294293

295294
#endregion 测试驱动功能
296295

297-
#region 测试WillMessage
298-
299-
public void TestWillMessage()
300-
{
301-
var path1 = "D:\\packet\\source";
302-
var path2 = "D:\\packet\\target";
303-
var hash = "28d10f1fc2a23dd1afe0af40d132b25c72ea56005963f653c27889f03d381c8d";
304-
305-
for (int i = 0; i < 1; i++)
306-
{
307-
var version = "1.0.0." + i;
308-
WillMessageManager.Instance.Backup(path1, path2, version, hash, 1);
309-
}
310-
WillMessageManager.Instance.Builder();
311-
var obj = WillMessageManager.Instance.GetWillMessage();
312-
WillMessageManager.Instance.Check();
313-
WillMessageManager.Instance.Restore();
314-
//WillMessageManager.Instance.Clear();
315-
}
316-
317-
#endregion 测试WillMessage
318-
319296
#region 文件管理测试
320297

321298
public void TestFileProvider()

src/c#/GeneralUpdate.ClientCore/GeneralClientBootstrap.cs

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
using GeneralUpdate.Core.Exceptions.CustomArgs;
88
using GeneralUpdate.Core.Exceptions.CustomException;
99
using GeneralUpdate.Core.Strategys;
10-
using GeneralUpdate.Core.WillMessage;
1110
using System;
1211
using System.Collections.Generic;
1312
using System.Diagnostics;
@@ -267,25 +266,6 @@ private void ClearEnvironmentVariable()
267266
}
268267
}
269268

270-
/// <summary>
271-
/// When the update version information requested by the server contains the update failed version, the update execution flow is directly interrupted
272-
/// </summary>
273-
/// <returns></returns>
274-
private bool CheckWillMessage()
275-
{
276-
var willMessage = WillMessageManager.Instance.GetWillMessage();
277-
if (willMessage == null) return true;
278-
foreach (var item in Packet.UpdateVersions)
279-
{
280-
var msg = willMessage.Message.Peek();
281-
if (string.Equals(msg.Version, item.Version, StringComparison.OrdinalIgnoreCase))
282-
{
283-
return false;
284-
}
285-
}
286-
return true;
287-
}
288-
289269
#endregion Private Methods
290270
}
291271
}

src/c#/GeneralUpdate.ClientCore/GeneralUpdate.ClientCore.csproj

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,6 @@
144144
<Compile Include="..\GeneralUpdate.Core\Pipelines\Middleware\MiddlewareExtensions.cs" Link="Pipelines\Middleware\MiddlewareExtensions.cs" />
145145
<Compile Include="..\GeneralUpdate.Core\Pipelines\Middleware\MiddlewareStack.cs" Link="Pipelines\Middleware\MiddlewareStack.cs" />
146146
<Compile Include="..\GeneralUpdate.Core\Pipelines\Middleware\PatchMiddleware.cs" Link="Pipelines\Middleware\PatchMiddleware.cs" />
147-
<Compile Include="..\GeneralUpdate.Core\Pipelines\Middleware\WillMessageMiddleware.cs" Link="Pipelines\Middleware\WillMessageMiddleware.cs" />
148147
<Compile Include="..\GeneralUpdate.Core\Pipelines\Middleware\ZipMiddleware.cs" Link="Pipelines\Middleware\ZipMiddleware.cs" />
149148
<Compile Include="..\GeneralUpdate.Core\Pipelines\PipelineBuilder.cs" Link="Pipelines\PipelineBuilder.cs" />
150149
<Compile Include="..\GeneralUpdate.Core\Pipelines\Pipeline\IPipelineBuilder.cs" Link="Pipelines\Pipeline\IPipelineBuilder.cs" />
@@ -256,11 +255,4 @@
256255
<Folder Include="ZipFactory\CompressProvider\" />
257256
</ItemGroup>
258257

259-
<ItemGroup>
260-
<None Include="..\..\..\imgs\GeneralUpdate128.png">
261-
<Pack>True</Pack>
262-
<PackagePath>\</PackagePath>
263-
</None>
264-
</ItemGroup>
265-
266258
</Project>

src/c#/GeneralUpdate.Core/Pipelines/Middleware/WillMessageMiddleware.cs

Lines changed: 0 additions & 16 deletions
This file was deleted.

src/c#/GeneralUpdate.Core/Strategys/PlatformWindows/WindowsStrategy.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
using GeneralUpdate.Core.Pipelines;
77
using GeneralUpdate.Core.Pipelines.Context;
88
using GeneralUpdate.Core.Pipelines.Middleware;
9-
using GeneralUpdate.Core.WillMessage;
109
using System;
1110
using System.Diagnostics;
1211
using System.IO;
@@ -60,7 +59,6 @@ public override void Execute()
6059
var pipelineBuilder = new PipelineBuilder<BaseContext>(context)
6160
.UseMiddleware<HashMiddleware>().UseMiddleware<ZipMiddleware>()
6261
.UseMiddlewareIf<DriveMiddleware>(Packet.DriveEnabled)
63-
.UseMiddlewareIf<WillMessageMiddleware>(Packet.WillMessageEnabled)
6462
.UseMiddleware<PatchMiddleware>();
6563
await pipelineBuilder.Build();
6664
}
@@ -88,11 +86,11 @@ public override bool StartApp(string appName, int appType)
8886
{
8987
case AppType.ClientApp:
9088
Environment.SetEnvironmentVariable("ProcessBase64", Packet.ProcessBase64, EnvironmentVariableTarget.User);
91-
WaitForProcessToStart(path, 20, () => WillMessageManager.Instance.Check());
89+
WaitForProcessToStart(path, 20);
9290
break;
9391

9492
case AppType.UpgradeApp:
95-
WaitForProcessToStart(path, 20, () => WillMessageManager.Instance.Check());
93+
WaitForProcessToStart(path, 20);
9694
break;
9795
}
9896
return true;

src/c#/GeneralUpdate.Core/WillMessage/WillMessageManager.cs

Lines changed: 0 additions & 205 deletions
This file was deleted.

src/c#/GeneralUpdate.Differential/GeneralUpdate.Differential.csproj

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@
5858
<Compile Include="..\GeneralUpdate.Core\HashAlgorithms\Md5HashAlgorithm.cs" Link="HashAlgorithms\Md5HashAlgorithm.cs" />
5959
<Compile Include="..\GeneralUpdate.Core\HashAlgorithms\Sha1HashAlgorithm.cs" Link="HashAlgorithms\Sha1HashAlgorithm.cs" />
6060
<Compile Include="..\GeneralUpdate.Core\HashAlgorithms\Sha256HashAlgorithm.cs" Link="HashAlgorithms\Sha256HashAlgorithm.cs" />
61-
<Compile Include="..\GeneralUpdate.Core\WillMessage\WillMessageManager.cs" Link="WillMessage\WillMessageManager.cs" />
6261
</ItemGroup>
6362

6463
<ItemGroup>
@@ -76,7 +75,6 @@
7675
<Folder Include="CustomAwaiter\" />
7776
<Folder Include="CustomAwaiter\" />
7877
<Folder Include="HashAlgorithms\" />
79-
<Folder Include="WillMessage\" />
8078
</ItemGroup>
8179

8280
<ItemGroup>

src/c#/GeneralUpdate.Differential/WillMessage/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)