mirror of
https://github.com/wwiinnddyy/LanMountainDesktop.git
synced 2026-06-22 09:14:25 +08:00
changed.对启动器重构的尝试
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
namespace LanMountainDesktop.Launcher.Update;
|
||||
|
||||
internal sealed class IncomingArtifactsCleaner(UpdateEnginePaths paths)
|
||||
{
|
||||
public void Cleanup()
|
||||
{
|
||||
foreach (var path in new[]
|
||||
{
|
||||
paths.FileMapPath,
|
||||
paths.SignaturePath,
|
||||
paths.ArchivePath,
|
||||
paths.PlondsFileMapPath,
|
||||
paths.PlondsSignaturePath,
|
||||
paths.PlondsUpdateMetadataPath,
|
||||
paths.InstallCheckpointPath
|
||||
})
|
||||
{
|
||||
TryDeleteFile(path);
|
||||
}
|
||||
|
||||
TryDeleteDirectory(paths.PlondsObjectsRoot);
|
||||
}
|
||||
|
||||
private static void TryDeleteFile(string path)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (File.Exists(path))
|
||||
{
|
||||
File.Delete(path);
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
private static void TryDeleteDirectory(string path)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (Directory.Exists(path))
|
||||
{
|
||||
Directory.Delete(path, true);
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user