Optimization and upgrade tools

This commit is contained in:
2dust 2025-08-17 14:12:40 +08:00
parent c27651b7b7
commit 4c3c1e0b5f

View file

@ -79,15 +79,7 @@ internal class UpgradeApp
continue; continue;
} }
try TryExtractToFile(entry, entryOutputPath);
{
entry.ExtractToFile(entryOutputPath, true);
}
catch
{
Thread.Sleep(1000);
entry.ExtractToFile(entryOutputPath, true);
}
Console.WriteLine(entryOutputPath); Console.WriteLine(entryOutputPath);
} }
@ -113,4 +105,24 @@ internal class UpgradeApp
Utils.StartV2RayN(); Utils.StartV2RayN();
} }
private static bool TryExtractToFile(ZipArchiveEntry entry, string outputPath)
{
var retryCount = 5;
var delayMs = 1000;
for (var i = 1; i <= retryCount; i++)
{
try
{
entry.ExtractToFile(outputPath, true);
return true;
}
catch
{
Thread.Sleep(delayMs * i);
}
}
return false;
}
} }