Update SharpCompress to latest version and rework cancellation

net8.0
Pat Hartl 2023-11-28 21:20:07 -06:00
parent 8cc97f9bdb
commit c3a5edbe46
4 changed files with 23 additions and 26 deletions

View File

@ -52,8 +52,8 @@
<Reference Include="RestSharp, Version=106.15.0.0, Culture=neutral, PublicKeyToken=598062e77f915f75, processorArchitecture=MSIL">
<HintPath>..\packages\RestSharp.106.15.0\lib\net452\RestSharp.dll</HintPath>
</Reference>
<Reference Include="SharpCompress, Version=0.34.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\SharpCompress.0.34.1\lib\net462\SharpCompress.dll</HintPath>
<Reference Include="SharpCompress, Version=0.34.2.0, Culture=neutral, PublicKeyToken=afb0a02973931d96, processorArchitecture=MSIL">
<HintPath>..\packages\SharpCompress.0.34.2\lib\net462\SharpCompress.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">

View File

@ -8,7 +8,7 @@
<package id="PowerShellStandard.Library" version="5.1.1" targetFramework="net462" />
<package id="RestSharp" version="106.15.0" targetFramework="net462" />
<package id="rix0rrr.BeaconLib" version="1.0.2" targetFramework="net462" />
<package id="SharpCompress" version="0.34.1" targetFramework="net462" />
<package id="SharpCompress" version="0.34.2" targetFramework="net462" />
<package id="System.Buffers" version="4.5.1" targetFramework="net462" />
<package id="System.Memory" version="4.5.5" targetFramework="net462" />
<package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net462" />

View File

@ -179,9 +179,7 @@ namespace LANCommander.SDK
Reader.Dispose();
Stream.Dispose();
}
catch (Exception ex)
{
if (Reader.Cancelled)
catch (ReaderCancelledException ex)
{
Logger?.LogTrace("User cancelled the download");
@ -194,7 +192,7 @@ namespace LANCommander.SDK
Directory.Delete(destination, true);
}
}
else
catch (Exception ex)
{
Logger?.LogError(ex, "Could not extract to path {Destination}", destination);
@ -207,7 +205,6 @@ namespace LANCommander.SDK
throw new Exception("The game archive could not be extracted, is it corrupted? Please try again");
}
}
if (!extractionResult.Canceled)
{

View File

@ -8,7 +8,7 @@
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="7.0.1" />
<PackageReference Include="PowerShellStandard.Library" Version="5.1.1" />
<PackageReference Include="RestSharp" Version="106.15.0" />
<PackageReference Include="SharpCompress" Version="0.34.1" />
<PackageReference Include="SharpCompress" Version="0.34.2" />
<PackageReference Include="YamlDotNet" Version="5.4.0" />
</ItemGroup>