core: fix updater bug caused by #8661 (#8684)

This commit is contained in:
Diego Heras 2020-05-17 01:43:16 +02:00 committed by GitHub
parent 235f4ff753
commit 44f14138be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 2 deletions

View File

@ -97,8 +97,8 @@ namespace Jackett.Common.Services
logger.Info("Skipping checking for new releases as the debugger is attached.");
return;
}
var currentVersion = $"v{EnvironmentUtil.JackettVersion}";
if (currentVersion == "v0.0.0.0")
var currentVersion = $"v{GetCurrentVersion()}";
if (currentVersion == "v0.0.0")
{
logger.Info("Skipping checking for new releases because we are runing in IDE.");
return;
@ -187,6 +187,13 @@ namespace Jackett.Common.Services
? Path.Combine(tempDirectory, "Jackett", "JackettUpdater")
: Path.Combine(tempDirectory, "Jackett", "JackettUpdater.exe");
private string GetCurrentVersion()
{
var assembly = Assembly.GetExecutingAssembly();
var fvi = FileVersionInfo.GetVersionInfo(assembly.Location);
return fvi.ProductVersion;
}
private WebRequest SetDownloadHeaders(WebRequest req)
{
req.Headers = new Dictionary<string, string>()