Update SharpCompress to latest version and rework cancellation
parent
8cc97f9bdb
commit
c3a5edbe46
|
@ -52,8 +52,8 @@
|
||||||
<Reference Include="RestSharp, Version=106.15.0.0, Culture=neutral, PublicKeyToken=598062e77f915f75, processorArchitecture=MSIL">
|
<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>
|
<HintPath>..\packages\RestSharp.106.15.0\lib\net452\RestSharp.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="SharpCompress, Version=0.34.1.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="SharpCompress, Version=0.34.2.0, Culture=neutral, PublicKeyToken=afb0a02973931d96, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\SharpCompress.0.34.1\lib\net462\SharpCompress.dll</HintPath>
|
<HintPath>..\packages\SharpCompress.0.34.2\lib\net462\SharpCompress.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
<package id="PowerShellStandard.Library" version="5.1.1" targetFramework="net462" />
|
<package id="PowerShellStandard.Library" version="5.1.1" targetFramework="net462" />
|
||||||
<package id="RestSharp" version="106.15.0" targetFramework="net462" />
|
<package id="RestSharp" version="106.15.0" targetFramework="net462" />
|
||||||
<package id="rix0rrr.BeaconLib" version="1.0.2" 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.Buffers" version="4.5.1" targetFramework="net462" />
|
||||||
<package id="System.Memory" version="4.5.5" targetFramework="net462" />
|
<package id="System.Memory" version="4.5.5" targetFramework="net462" />
|
||||||
<package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net462" />
|
<package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net462" />
|
||||||
|
|
|
@ -179,34 +179,31 @@ namespace LANCommander.SDK
|
||||||
Reader.Dispose();
|
Reader.Dispose();
|
||||||
Stream.Dispose();
|
Stream.Dispose();
|
||||||
}
|
}
|
||||||
|
catch (ReaderCancelledException ex)
|
||||||
|
{
|
||||||
|
Logger?.LogTrace("User cancelled the download");
|
||||||
|
|
||||||
|
extractionResult.Canceled = true;
|
||||||
|
|
||||||
|
if (Directory.Exists(destination))
|
||||||
|
{
|
||||||
|
Logger?.LogTrace("Cleaning up orphaned files after cancelled install");
|
||||||
|
|
||||||
|
Directory.Delete(destination, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
if (Reader.Cancelled)
|
Logger?.LogError(ex, "Could not extract to path {Destination}", destination);
|
||||||
|
|
||||||
|
if (Directory.Exists(destination))
|
||||||
{
|
{
|
||||||
Logger?.LogTrace("User cancelled the download");
|
Logger?.LogTrace("Cleaning up orphaned install files after bad install");
|
||||||
|
|
||||||
extractionResult.Canceled = true;
|
Directory.Delete(destination, true);
|
||||||
|
|
||||||
if (Directory.Exists(destination))
|
|
||||||
{
|
|
||||||
Logger?.LogTrace("Cleaning up orphaned files after cancelled install");
|
|
||||||
|
|
||||||
Directory.Delete(destination, true);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
Logger?.LogError(ex, "Could not extract to path {Destination}", destination);
|
|
||||||
|
|
||||||
if (Directory.Exists(destination))
|
throw new Exception("The game archive could not be extracted, is it corrupted? Please try again");
|
||||||
{
|
|
||||||
Logger?.LogTrace("Cleaning up orphaned install files after bad install");
|
|
||||||
|
|
||||||
Directory.Delete(destination, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
throw new Exception("The game archive could not be extracted, is it corrupted? Please try again");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!extractionResult.Canceled)
|
if (!extractionResult.Canceled)
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="7.0.1" />
|
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="7.0.1" />
|
||||||
<PackageReference Include="PowerShellStandard.Library" Version="5.1.1" />
|
<PackageReference Include="PowerShellStandard.Library" Version="5.1.1" />
|
||||||
<PackageReference Include="RestSharp" Version="106.15.0" />
|
<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" />
|
<PackageReference Include="YamlDotNet" Version="5.4.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue