Skip to content

Commit

Permalink
Fix version checker url
Browse files Browse the repository at this point in the history
  • Loading branch information
the1812 committed Feb 2, 2023
1 parent 43827dd commit d2bafdd
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 23 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
## files generated by popular Visual Studio add-ons.

dist/unbundled/Certificates/
dist/*.zip

# User-specific files
*.suo
Expand Down
Binary file added dist/bundled/mwp.bundled.zip
Binary file not shown.
Binary file modified dist/bundled/mwp.exe
Binary file not shown.
Binary file modified dist/unbundled/mwp.exe
Binary file not shown.
Binary file added dist/unbundled/mwp.unbundled.zip
Binary file not shown.
Binary file modified mwp.exe
Binary file not shown.
44 changes: 21 additions & 23 deletions src/MalwarePatch/Models/VersionChecker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,29 @@

namespace MalwarePatch.Models
{
sealed class VersionChecker
{
public Version NewVersion { get; private set; }
private Version CurrectVersion => Assembly.GetEntryAssembly().GetName().Version;
public string Proxy { get; set; }
sealed class VersionChecker
{
public Version NewVersion { get; private set; }
private Version CurrentVersion => Assembly.GetEntryAssembly().GetName().Version;
public string Proxy { get; set; }

public bool HasNewVersion
public bool HasNewVersion
{
get
{
var downloadLink = "https://github.com/the1812/malware-patch/raw/master/mwp-ver.txt";
var info = new DownloadInfo(downloadLink)
{
get
{
var downloadLink = "https://cdn.jsdelivr.net/gh/the1812/Malware-Patch@master/mwp-ver.txt";
// var downloadLink = GoogleDrive.GetDirectLinkFromId(NewVersionId);
// var downloadLink = "https://github.com/the1812/malware-patch/raw/master/mwp-ver.txt";
var info = new DownloadInfo(downloadLink)
{
Proxy = Proxy,
};
var newVersionString = info.DownloadString();
NewVersion = new Version(newVersionString);
Proxy = Proxy,
};
var newVersionString = info.DownloadString();
NewVersion = new Version(newVersionString);

//#if DEBUG
// return true;
//#endif
return NewVersion > CurrectVersion;
}
}
//#if DEBUG
// return true;
//#endif
return NewVersion > CurrentVersion;
}
}
}
}

0 comments on commit d2bafdd

Please sign in to comment.