Skip to content

Commit b851bf4

Browse files
committed
Use ZipFile instead of ZipArchive
1 parent 9348c0d commit b851bf4

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/ServiceControlInstaller.Engine/FileSystem/FileUtils.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,7 @@ public static void UnzipToSubdirectory(string zipResourceName, string targetPath
147147

148148
internal static void UnzipToSubdirectory(Stream zipStream, string targetPath)
149149
{
150-
using var zip = new ZipArchive(zipStream, ZipArchiveMode.Read, leaveOpen: false);
151-
zip.ExtractToDirectory(targetPath, overwriteFiles: true);
150+
ZipFile.ExtractToDirectory(zipStream, targetPath, overwriteFiles: true);
152151
}
153152

154153
static void RunWithRetries(Action action)
@@ -165,7 +164,7 @@ static void RunWithRetries(Action action)
165164
{
166165
Debug.WriteLine($"ServiceControlInstaller.Engine.FileSystem.FileUtils::RunWithRetries Action failed, {attempts} attempts remaining. Reason: {ex.Message} ({ex.GetType().FullName})");
167166
// Yes, Task.Delay would be better but would require all calls to be async
168-
// and in 99.9% this sleep will not hit
167+
// and in 99.9% this sleep will not hit
169168
Thread.Sleep(100);
170169
}
171170
}

0 commit comments

Comments
 (0)