Skip to content

Commit

Permalink
add net 48 version
Browse files Browse the repository at this point in the history
  • Loading branch information
LiorBanai committed Nov 14, 2020
1 parent d67701e commit 91e65e4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Analogy.Updater/Analogy.Updater.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFrameworks>net472;net471;netcoreapp3.1</TargetFrameworks>
<TargetFrameworks>net48;net472;net471;netcoreapp3.1</TargetFrameworks>
<UseWindowsForms>true</UseWindowsForms>
<Authors>Lior Banai</Authors>
<Company>Analogy.LogViewer</Company>
<Version>0.1.2</Version>
<Version>0.1.3</Version>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
Expand Down
11 changes: 10 additions & 1 deletion Analogy.Updater/DownloadUpdateDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,10 @@ private static string BytesToString(long byteCount)
{
string[] suf = { "B", "KB", "MB", "GB", "TB", "PB", "EB" };
if (byteCount == 0)
{
return "0" + suf[0];
}

long bytes = Math.Abs(byteCount);
int place = Convert.ToInt32(Math.Floor(Math.Log(bytes, 1024)));
double num = Math.Round(bytes / Math.Pow(1024, place), 1);
Expand All @@ -204,7 +207,10 @@ private static string TryToFindFileName(string contentDisposition, string lookFo
{
var index = contentDisposition.IndexOf(lookForFileName, StringComparison.CurrentCultureIgnoreCase);
if (index >= 0)
{
fileName = contentDisposition.Substring(index + lookForFileName.Length);
}

if (fileName.StartsWith("\""))
{
var file = fileName.Substring(1, fileName.Length - 1);
Expand All @@ -230,7 +236,10 @@ private static bool CompareChecksum(string fileName, string checksum)
var hash = hashAlgorithm.ComputeHash(stream);
var fileChecksum = BitConverter.ToString(hash).Replace("-", string.Empty).ToLowerInvariant();

if (fileChecksum == checksum.ToLower()) return true;
if (fileChecksum == checksum.ToLower())
{
return true;
}

MessageBox.Show(Resources.FileIntegrityCheckFailedMessage,
Resources.FileIntegrityCheckFailedCaption, MessageBoxButtons.OK, MessageBoxIcon.Error);
Expand Down

0 comments on commit 91e65e4

Please sign in to comment.