mirror of https://github.com/Jackett/Jackett
Merge branch 'master' into dotnetcore
This commit is contained in:
commit
54c5b66ecf
|
@ -26,6 +26,7 @@ OutputBaseFilename={#MyOutputFilename}
|
||||||
SetupIconFile=src\Jackett.Console\jackett.ico
|
SetupIconFile=src\Jackett.Console\jackett.ico
|
||||||
UninstallDisplayIcon={commonappdata}\Jackett\JackettConsole.exe
|
UninstallDisplayIcon={commonappdata}\Jackett\JackettConsole.exe
|
||||||
VersionInfoVersion={#MyAppVersion}
|
VersionInfoVersion={#MyAppVersion}
|
||||||
|
UninstallDisplayName={#MyAppName}
|
||||||
Compression=lzma
|
Compression=lzma
|
||||||
SolidCompression=yes
|
SolidCompression=yes
|
||||||
DisableDirPage=yes
|
DisableDirPage=yes
|
||||||
|
@ -38,7 +39,7 @@ Name: "windowsService"; Description: "Install as a Windows Service"
|
||||||
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
|
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
|
||||||
|
|
||||||
[Files]
|
[Files]
|
||||||
Source: "{#MySourceFolder}\Jackett\*"; DestDir: "{commonappdata}\Jackett"; Flags: ignoreversion recursesubdirs createallsubdirs
|
Source: "{#MySourceFolder}\*"; DestDir: "{commonappdata}\Jackett"; Flags: ignoreversion recursesubdirs createallsubdirs
|
||||||
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
|
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
|
||||||
|
|
||||||
[Icons]
|
[Icons]
|
||||||
|
@ -50,13 +51,12 @@ Name: "{commondesktop}\{#MyAppName}"; Filename: "{commonappdata}\Jackett\{#MyApp
|
||||||
Filename: "{commonappdata}\Jackett\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
|
Filename: "{commonappdata}\Jackett\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
|
||||||
|
|
||||||
[Run]
|
[Run]
|
||||||
Filename: "{commonappdata}\Jackett\JackettConsole.exe"; Parameters: "--Uninstall"; Flags: waituntilterminated;
|
Filename: "{commonappdata}\Jackett\JackettConsole.exe"; Parameters: "--Uninstall"; Flags: waituntilterminated runhidden;
|
||||||
Filename: "{commonappdata}\Jackett\JackettConsole.exe"; Parameters: "--ReserveUrls"; Flags: waituntilterminated;
|
Filename: "{commonappdata}\Jackett\JackettConsole.exe"; Parameters: "--ReserveUrls"; Flags: waituntilterminated runhidden;
|
||||||
Filename: "{commonappdata}\Jackett\JackettConsole.exe"; Parameters: "--MigrateSettings"; Flags: waituntilterminated;
|
Filename: "{commonappdata}\Jackett\JackettConsole.exe"; Parameters: "--Install"; Flags: waituntilterminated runhidden; Tasks: windowsService
|
||||||
Filename: "{commonappdata}\Jackett\JackettConsole.exe"; Parameters: "--Install"; Flags: waituntilterminated; Tasks: windowsService
|
Filename: "{commonappdata}\Jackett\JackettConsole.exe"; Parameters: "--Start"; Flags: waituntilterminated runhidden; Tasks: windowsService
|
||||||
Filename: "{commonappdata}\Jackett\JackettConsole.exe"; Parameters: "--Start"; Flags: waituntilterminated; Tasks: windowsService
|
|
||||||
|
|
||||||
[UninstallRun]
|
[UninstallRun]
|
||||||
Filename: "{commonappdata}\Jackett\JackettConsole.exe"; Parameters: "--Uninstall"; Flags: waituntilterminated skipifdoesntexist
|
Filename: "{commonappdata}\Jackett\JackettConsole.exe"; Parameters: "--Uninstall"; Flags: waituntilterminated skipifdoesntexist runhidden
|
||||||
|
|
||||||
|
|
||||||
|
|
14
build.cake
14
build.cake
|
@ -56,7 +56,11 @@ Task("Build")
|
||||||
.IsDependentOn("Restore-NuGet-Packages")
|
.IsDependentOn("Restore-NuGet-Packages")
|
||||||
.Does(() =>
|
.Does(() =>
|
||||||
{
|
{
|
||||||
MSBuild("./src/Jackett.sln", settings => settings.SetConfiguration(configuration));
|
var buildSettings = new MSBuildSettings()
|
||||||
|
.SetConfiguration(configuration)
|
||||||
|
.UseToolVersion(MSBuildToolVersion.VS2017);
|
||||||
|
|
||||||
|
MSBuild("./src/Jackett.sln", buildSettings);
|
||||||
});
|
});
|
||||||
|
|
||||||
Task("Run-Unit-Tests")
|
Task("Run-Unit-Tests")
|
||||||
|
@ -86,7 +90,7 @@ Task("Copy-Files-Full-Framework")
|
||||||
CopyDirectory("./src/Jackett.Console/bin/" + configuration, windowsOutput);
|
CopyDirectory("./src/Jackett.Console/bin/" + configuration, windowsOutput);
|
||||||
CopyFiles("./src/Jackett.Service/bin/" + configuration + "/JackettService.*", windowsOutput);
|
CopyFiles("./src/Jackett.Service/bin/" + configuration + "/JackettService.*", windowsOutput);
|
||||||
CopyFiles("./src/Jackett.Tray/bin/" + configuration + "/JackettTray.*", windowsOutput);
|
CopyFiles("./src/Jackett.Tray/bin/" + configuration + "/JackettTray.*", windowsOutput);
|
||||||
CopyFiles("./src/Jackett.Updater/bin/" + configuration + "/JackettUpdater.*", windowsOutput);
|
CopyFiles("./src/Jackett.Updater/bin/" + configuration + "/net452" + "/JackettUpdater.*", windowsOutput); //builds against multiple frameworks
|
||||||
CopyFiles("./Upstart.config", windowsOutput);
|
CopyFiles("./Upstart.config", windowsOutput);
|
||||||
CopyFiles("./LICENSE", windowsOutput);
|
CopyFiles("./LICENSE", windowsOutput);
|
||||||
CopyFiles("./README.md", windowsOutput);
|
CopyFiles("./README.md", windowsOutput);
|
||||||
|
@ -119,13 +123,13 @@ Task("Package-Windows-Installer-Full-Framework")
|
||||||
.IsDependentOn("Check-Packaging-Platform")
|
.IsDependentOn("Check-Packaging-Platform")
|
||||||
.Does(() =>
|
.Does(() =>
|
||||||
{
|
{
|
||||||
string sourceFolder = MakeAbsolute(Directory(windowsBuildFullFramework)).ToString();
|
string sourceFolder = MakeAbsolute(Directory(windowsBuildFullFramework + "/Jackett")).ToString();
|
||||||
|
|
||||||
InnoSetupSettings settings = new InnoSetupSettings();
|
InnoSetupSettings settings = new InnoSetupSettings();
|
||||||
settings.OutputDirectory = workingDir + "/" + artifactsDirName;
|
settings.OutputDirectory = workingDir + "/" + artifactsDirName;
|
||||||
settings.Defines = new Dictionary<string, string>
|
settings.Defines = new Dictionary<string, string>
|
||||||
{
|
{
|
||||||
{ "MyFileForVersion", sourceFolder + "/Jackett/Jackett.Common.dll" },
|
{ "MyFileForVersion", sourceFolder + "/Jackett.Common.dll" },
|
||||||
{ "MySourceFolder", sourceFolder },
|
{ "MySourceFolder", sourceFolder },
|
||||||
{ "MyOutputFilename", "Jackett.Installer.Windows" },
|
{ "MyOutputFilename", "Jackett.Installer.Windows" },
|
||||||
};
|
};
|
||||||
|
@ -155,7 +159,7 @@ Task("Package-Full-Framework")
|
||||||
.IsDependentOn("Package-Files-Full-Framework-Mono")
|
.IsDependentOn("Package-Files-Full-Framework-Mono")
|
||||||
.Does(() =>
|
.Does(() =>
|
||||||
{
|
{
|
||||||
Information("Full Framwork Packaging Completed");
|
Information("Full Framework Packaging Completed");
|
||||||
});
|
});
|
||||||
|
|
||||||
Task("Experimental-DotNetCore")
|
Task("Experimental-DotNetCore")
|
||||||
|
|
|
@ -34,15 +34,8 @@
|
||||||
page: 1
|
page: 1
|
||||||
srcrel: "{{ .Keywords }}"
|
srcrel: "{{ .Keywords }}"
|
||||||
keywordsfilters:
|
keywordsfilters:
|
||||||
- name: re_replace
|
|
||||||
args: ["S[0-9]{2}([^E]|$)", ""] # remove season tag without episode (search doesn't support it)
|
|
||||||
- name: diacritics
|
- name: diacritics
|
||||||
args: replace
|
args: replace
|
||||||
# most ITA TV torrents are in XXxYY format, so we search without S/E prefixes and filter later
|
|
||||||
- name: re_replace
|
|
||||||
args: ["S0?(\\d{1,2})", " $1 "]
|
|
||||||
- name: re_replace
|
|
||||||
args: ["E(\\d{2,3})", " $1 "]
|
|
||||||
rows:
|
rows:
|
||||||
selector: div.showrelease_tb table tbody tr:not(tr:nth-child(1))
|
selector: div.showrelease_tb table tbody tr:not(tr:nth-child(1))
|
||||||
fields:
|
fields:
|
||||||
|
@ -54,27 +47,9 @@
|
||||||
filters:
|
filters:
|
||||||
- name: split
|
- name: split
|
||||||
args: ["=", "-1"]
|
args: ["=", "-1"]
|
||||||
# inizio prova
|
|
||||||
- name: re_replace # replace special characters with " " (space)
|
|
||||||
args: ["[^a-zA-Z0-9]|\\.", " "]
|
|
||||||
# normalize to SXXEYY format
|
# normalize to SXXEYY format
|
||||||
- name: re_replace
|
- name: re_replace
|
||||||
args: ["(\\d{2})x(\\d{2})", "S$1E$2"]
|
args: ["\\b([s])?(\\d{1,3})[x\\s](\\d{1,3})", "S$2E$3"]
|
||||||
- name: re_replace
|
|
||||||
args: ["(\\d{1})x(\\d{2})", "S0$1E$2"]
|
|
||||||
- name: re_replace #Stagione X --> S0X
|
|
||||||
args: ["Stagione (\\d{0,1}\\s)", "S0$1"]
|
|
||||||
- name: re_replace #Stagione XX --> SXX
|
|
||||||
args: ["Stagione (\\d{2}\\s)", "S$1"]
|
|
||||||
- name: re_replace #/ Episodio [YY-YY --> EYY-YY
|
|
||||||
args: ["(\\s\\/\\sEpisodio|\\s\\/\\sEpisodi|\\sEpisodio|\\s\\|\\sEpisodio|\\sEpisodi)\\s\\[", "E"]
|
|
||||||
- name: re_replace #/ Completa [episodi YY-YY --> EYY-YY
|
|
||||||
args: ["(\\s\\/\\sCompleta\\s\\[episodi\\s)", "E"]
|
|
||||||
- name: re_replace #remove di YY] | remove /YY]
|
|
||||||
args: ["(\\sdi\\s\\d{1,2}|\\/\\d{1,2})\\]", " "]
|
|
||||||
- name: re_replace #remove various
|
|
||||||
args: ["(Serie completa|Completa|\\[in pausa\\])", ""]
|
|
||||||
# fine prova
|
|
||||||
details:
|
details:
|
||||||
selector: td:nth-child(7) a
|
selector: td:nth-child(7) a
|
||||||
attribute: href
|
attribute: href
|
||||||
|
|
|
@ -1,11 +1,4 @@
|
||||||
using System;
|
using AutoMapper;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Diagnostics;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Reflection;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using AutoMapper;
|
|
||||||
using Jackett.Common.Models;
|
using Jackett.Common.Models;
|
||||||
using Jackett.Common.Models.IndexerConfig;
|
using Jackett.Common.Models.IndexerConfig;
|
||||||
using Jackett.Common.Services.Interfaces;
|
using Jackett.Common.Services.Interfaces;
|
||||||
|
@ -14,6 +7,12 @@ using Jackett.Common.Utils.Clients;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
using NLog;
|
using NLog;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Jackett.Common.Indexers
|
namespace Jackett.Common.Indexers
|
||||||
{
|
{
|
||||||
|
@ -184,10 +183,10 @@ namespace Jackett.Common.Indexers
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Version dotNetVersion = Microsoft.Extensions.PlatformAbstractions.PlatformServices.Default.Application.RuntimeFramework.Version;
|
bool runningOnDotNetCore = RuntimeInformation.FrameworkDescription.IndexOf("core", StringComparison.OrdinalIgnoreCase) >= 0;
|
||||||
bool isWindows = Environment.OSVersion.Platform == PlatformID.Win32NT;
|
bool isWindows = Environment.OSVersion.Platform == PlatformID.Win32NT;
|
||||||
|
|
||||||
if (!isWindows && dotNetVersion.Major < 4)
|
if (!isWindows && runningOnDotNetCore)
|
||||||
{
|
{
|
||||||
// User isn't running Windows, but is running on .NET Core framework, no access to the DPAPI, so don't bother trying to migrate
|
// User isn't running Windows, but is running on .NET Core framework, no access to the DPAPI, so don't bother trying to migrate
|
||||||
return false;
|
return false;
|
||||||
|
@ -838,7 +837,6 @@ namespace Jackett.Common.Indexers
|
||||||
|
|
||||||
public override TorznabCapabilities TorznabCaps { get; protected set; }
|
public override TorznabCapabilities TorznabCaps { get; protected set; }
|
||||||
|
|
||||||
|
|
||||||
private List<CategoryMapping> categoryMapping = new List<CategoryMapping>();
|
private List<CategoryMapping> categoryMapping = new List<CategoryMapping>();
|
||||||
protected WebClient webclient;
|
protected WebClient webclient;
|
||||||
protected readonly string downloadUrlBase = "";
|
protected readonly string downloadUrlBase = "";
|
||||||
|
|
|
@ -23,9 +23,9 @@ namespace Jackett.Common.Indexers
|
||||||
private string LoginUrl { get { return SiteLink + "login.php"; } }
|
private string LoginUrl { get { return SiteLink + "login.php"; } }
|
||||||
private const int MAXPAGES = 3;
|
private const int MAXPAGES = 3;
|
||||||
|
|
||||||
private new ConfigurationDataBasicLogin configData
|
private new ConfigurationDataRecaptchaLogin configData
|
||||||
{
|
{
|
||||||
get { return (ConfigurationDataBasicLogin)base.configData; }
|
get { return (ConfigurationDataRecaptchaLogin)base.configData; }
|
||||||
set { base.configData = value; }
|
set { base.configData = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ namespace Jackett.Common.Indexers
|
||||||
client: w,
|
client: w,
|
||||||
logger: l,
|
logger: l,
|
||||||
p: ps,
|
p: ps,
|
||||||
configData: new ConfigurationDataBasicLogin())
|
configData: new ConfigurationDataRecaptchaLogin())
|
||||||
{
|
{
|
||||||
Encoding = Encoding.GetEncoding("windows-1255");
|
Encoding = Encoding.GetEncoding("windows-1255");
|
||||||
Language = "he-il";
|
Language = "he-il";
|
||||||
|
@ -95,9 +95,57 @@ namespace Jackett.Common.Indexers
|
||||||
AddCategoryMapping(76, TorznabCatType.TV, "סדרות");
|
AddCategoryMapping(76, TorznabCatType.TV, "סדרות");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override async Task<ConfigurationData> GetConfigurationForSetup()
|
||||||
|
{
|
||||||
|
var loginPage = await RequestStringWithCookies(LoginUrl, string.Empty);
|
||||||
|
CQ cq = loginPage.Content;
|
||||||
|
var captcha = cq.Find(".g-recaptcha"); // invisible recaptcha
|
||||||
|
if (captcha.Any())
|
||||||
|
{
|
||||||
|
var result = this.configData;
|
||||||
|
result.CookieHeader.Value = loginPage.Cookies;
|
||||||
|
result.Captcha.SiteKey = captcha.Attr("data-sitekey");
|
||||||
|
result.Captcha.Version = "2";
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var result = new ConfigurationDataBasicLogin();
|
||||||
|
result.SiteLink.Value = configData.SiteLink.Value;
|
||||||
|
result.Instructions.Value = configData.Instructions.Value;
|
||||||
|
result.Username.Value = configData.Username.Value;
|
||||||
|
result.Password.Value = configData.Password.Value;
|
||||||
|
result.CookieHeader.Value = loginPage.Cookies;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public override async Task<IndexerConfigurationStatus> ApplyConfiguration(JToken configJson)
|
public override async Task<IndexerConfigurationStatus> ApplyConfiguration(JToken configJson)
|
||||||
{
|
{
|
||||||
LoadValuesFromJson(configJson);
|
LoadValuesFromJson(configJson);
|
||||||
|
|
||||||
|
if (!string.IsNullOrWhiteSpace(configData.Captcha.Cookie))
|
||||||
|
{
|
||||||
|
CookieHeader = configData.Captcha.Cookie;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var results = await PerformQuery(new TorznabQuery());
|
||||||
|
if (results.Count() == 0)
|
||||||
|
{
|
||||||
|
throw new Exception("Your cookie did not work");
|
||||||
|
}
|
||||||
|
|
||||||
|
IsConfigured = true;
|
||||||
|
SaveConfig();
|
||||||
|
return IndexerConfigurationStatus.Completed;
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
IsConfigured = false;
|
||||||
|
throw new Exception("Your cookie did not work: " + e.Message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var loginPage = await RequestStringWithCookies(LoginUrl, string.Empty);
|
var loginPage = await RequestStringWithCookies(LoginUrl, string.Empty);
|
||||||
|
|
||||||
var pairs = new Dictionary<string, string> {
|
var pairs = new Dictionary<string, string> {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFrameworks>netstandard2.0;net452</TargetFrameworks>
|
<TargetFrameworks>netstandard2.0;net452;net461</TargetFrameworks>
|
||||||
<Version>0.0.0</Version>
|
<Version>0.0.0</Version>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
@ -121,7 +121,6 @@
|
||||||
<PackageReference Include="CommandLineParser" Version="2.2.1" />
|
<PackageReference Include="CommandLineParser" Version="2.2.1" />
|
||||||
<PackageReference Include="DotNet4.SocksProxy" Version="1.4.0.1" />
|
<PackageReference Include="DotNet4.SocksProxy" Version="1.4.0.1" />
|
||||||
<PackageReference Include="Microsoft.CSharp" Version="4.5.0" />
|
<PackageReference Include="Microsoft.CSharp" Version="4.5.0" />
|
||||||
<PackageReference Include="Microsoft.Extensions.PlatformAbstractions" Version="1.1.0" />
|
|
||||||
<PackageReference Include="MimeMapping" Version="1.0.1.12" />
|
<PackageReference Include="MimeMapping" Version="1.0.1.12" />
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
|
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
|
||||||
<PackageReference Include="NLog" Version="4.5.6" />
|
<PackageReference Include="NLog" Version="4.5.6" />
|
||||||
|
@ -189,7 +188,8 @@
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Service Include="{508349b6-6b84-4df5-91f0-309beebad82d}" />
|
<Service Include="{508349b6-6b84-4df5-91f0-309beebad82d}" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup Condition="'$(TargetFramework)' == 'net452'">
|
|
||||||
|
<ItemGroup Condition="'$(TargetFramework)' != 'netstandard2.0'">
|
||||||
<PackageReference Include="CsQuery" Version="1.3.5-beta5" />
|
<PackageReference Include="CsQuery" Version="1.3.5-beta5" />
|
||||||
<PackageReference Include="SharpZipLib" Version="0.86.0" />
|
<PackageReference Include="SharpZipLib" Version="0.86.0" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.WebUtilities" Version="1.1.2" />
|
<PackageReference Include="Microsoft.AspNetCore.WebUtilities" Version="1.1.2" />
|
||||||
|
|
|
@ -98,6 +98,12 @@ namespace Jackett.Common.Services
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool trayIsRunning = false;
|
||||||
|
if (isWindows)
|
||||||
|
{
|
||||||
|
trayIsRunning = Process.GetProcessesByName("JackettTray").Length > 0;
|
||||||
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -135,7 +141,7 @@ namespace Jackett.Common.Services
|
||||||
var installDir = Path.GetDirectoryName(ExePath());
|
var installDir = Path.GetDirectoryName(ExePath());
|
||||||
var updaterPath = Path.Combine(tempDir, "Jackett", "JackettUpdater.exe");
|
var updaterPath = Path.Combine(tempDir, "Jackett", "JackettUpdater.exe");
|
||||||
if (updaterPath != null)
|
if (updaterPath != null)
|
||||||
StartUpdate(updaterPath, installDir, isWindows, serverConfig.RuntimeSettings.NoRestart);
|
StartUpdate(updaterPath, installDir, isWindows, serverConfig.RuntimeSettings.NoRestart, trayIsRunning);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
@ -212,7 +218,7 @@ namespace Jackett.Common.Services
|
||||||
|
|
||||||
private async Task<string> DownloadRelease(List<Asset> assets, bool isWindows, string version)
|
private async Task<string> DownloadRelease(List<Asset> assets, bool isWindows, string version)
|
||||||
{
|
{
|
||||||
var targetAsset = assets.Where(a => isWindows ? a.Browser_download_url.ToLowerInvariant().EndsWith(".zip") : a.Browser_download_url.ToLowerInvariant().EndsWith(".gz")).FirstOrDefault();
|
var targetAsset = assets.Where(a => isWindows ? a.Browser_download_url.EndsWith(".zip", StringComparison.OrdinalIgnoreCase) : a.Browser_download_url.EndsWith(".gz", StringComparison.OrdinalIgnoreCase)).FirstOrDefault();
|
||||||
|
|
||||||
if (targetAsset == null)
|
if (targetAsset == null)
|
||||||
{
|
{
|
||||||
|
@ -262,7 +268,7 @@ namespace Jackett.Common.Services
|
||||||
return tempDir;
|
return tempDir;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void StartUpdate(string updaterExePath, string installLocation, bool isWindows, bool NoRestart)
|
private void StartUpdate(string updaterExePath, string installLocation, bool isWindows, bool NoRestart, bool trayWasRunning)
|
||||||
{
|
{
|
||||||
var exe = Path.GetFileName(ExePath());
|
var exe = Path.GetFileName(ExePath());
|
||||||
var args = string.Join(" ", Environment.GetCommandLineArgs().Skip(1).Select(a => a.Contains(" ") ? "\"" +a + "\"" : a )).Replace("\"", "\\\"");
|
var args = string.Join(" ", Environment.GetCommandLineArgs().Skip(1).Select(a => a.Contains(" ") ? "\"" +a + "\"" : a )).Replace("\"", "\\\"");
|
||||||
|
@ -298,7 +304,14 @@ namespace Jackett.Common.Services
|
||||||
}
|
}
|
||||||
|
|
||||||
if (NoRestart)
|
if (NoRestart)
|
||||||
|
{
|
||||||
startInfo.Arguments += " --NoRestart";
|
startInfo.Arguments += " --NoRestart";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (trayWasRunning)
|
||||||
|
{
|
||||||
|
startInfo.Arguments += " --StartTray";
|
||||||
|
}
|
||||||
|
|
||||||
logger.Info($"Starting updater: {startInfo.FileName} {startInfo.Arguments}");
|
logger.Info($"Starting updater: {startInfo.FileName} {startInfo.Arguments}");
|
||||||
var procInfo = Process.Start(startInfo);
|
var procInfo = Process.Start(startInfo);
|
||||||
|
|
|
@ -32,17 +32,7 @@ namespace Jackett.Common.Utils
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var currentAssembly = Assembly.GetExecutingAssembly();
|
runningOwin = AppDomain.CurrentDomain.GetAssemblies().Where(x => x.FullName.StartsWith("Jackett, ")).Any();
|
||||||
|
|
||||||
bool aspNetCorePresent = new StackTrace().GetFrames()
|
|
||||||
.Select(x => x.GetMethod().ReflectedType.Assembly).Distinct()
|
|
||||||
.Where(x => x.GetReferencedAssemblies().Any(y => y.FullName == currentAssembly.FullName))
|
|
||||||
.Where(x => x.ManifestModule.Name == "JackettConsole.exe").Select(x => x.CustomAttributes)
|
|
||||||
.FirstOrDefault()
|
|
||||||
.Where(x => x.AttributeType.Assembly.FullName.StartsWith("Microsoft.AspNetCore", StringComparison.OrdinalIgnoreCase))
|
|
||||||
.Any();
|
|
||||||
|
|
||||||
runningOwin = !aspNetCorePresent;
|
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,7 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<configuration>
|
|
||||||
<startup>
|
|
||||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2"/>
|
|
||||||
</startup>
|
|
||||||
|
|
||||||
</configuration>
|
|
|
@ -1,88 +1,14 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
|
||||||
<PropertyGroup>
|
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
|
||||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
|
||||||
<ProjectGuid>{A61E311A-6F8B-4497-B5E4-2EA8994C7BD8}</ProjectGuid>
|
|
||||||
<OutputType>Exe</OutputType>
|
|
||||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
|
||||||
<RootNamespace>Jackett.Updater</RootNamespace>
|
|
||||||
<AssemblyName>JackettUpdater</AssemblyName>
|
|
||||||
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
|
|
||||||
<FileAlignment>512</FileAlignment>
|
|
||||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
|
||||||
<RestoreProjectStyle>PackageReference</RestoreProjectStyle>
|
|
||||||
<RuntimeIdentifier>win</RuntimeIdentifier>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
|
||||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
|
||||||
<DebugSymbols>true</DebugSymbols>
|
|
||||||
<DebugType>full</DebugType>
|
|
||||||
<Optimize>false</Optimize>
|
|
||||||
<OutputPath>bin\Debug\</OutputPath>
|
|
||||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
|
||||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
|
||||||
<DebugType>pdbonly</DebugType>
|
|
||||||
<Optimize>true</Optimize>
|
|
||||||
<OutputPath>bin\Release\</OutputPath>
|
|
||||||
<DefineConstants>TRACE</DefineConstants>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
|
<TargetFrameworks>net452;net461;netcoreapp2.1</TargetFrameworks>
|
||||||
<ApplicationIcon>jackett.ico</ApplicationIcon>
|
<ApplicationIcon>jackett.ico</ApplicationIcon>
|
||||||
|
<AssemblyName>JackettUpdater</AssemblyName>
|
||||||
|
<OutputType>Exe</OutputType>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="System" />
|
<ProjectReference Include="..\Jackett.Common\Jackett.Common.csproj" />
|
||||||
<Reference Include="System.Configuration" />
|
|
||||||
<Reference Include="System.Core" />
|
|
||||||
<Reference Include="System.IO.Compression" />
|
|
||||||
<Reference Include="System.Net.Http.WebRequest" />
|
|
||||||
<Reference Include="System.Runtime.Serialization" />
|
|
||||||
<Reference Include="System.ServiceModel" />
|
|
||||||
<Reference Include="System.Transactions" />
|
|
||||||
<Reference Include="System.Web" />
|
|
||||||
<Reference Include="System.Xml.Linq" />
|
|
||||||
<Reference Include="System.Data.DataSetExtensions" />
|
|
||||||
<Reference Include="Microsoft.CSharp" />
|
|
||||||
<Reference Include="System.Data" />
|
|
||||||
<Reference Include="System.Net.Http" />
|
|
||||||
<Reference Include="System.Xml" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
|
||||||
<Compile Include="Program.cs" />
|
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
|
||||||
<Compile Include="UpdaterConsoleOptions.cs" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<None Include="App.config">
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
</None>
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\Jackett.Common\Jackett.Common.csproj">
|
|
||||||
<Project>{6B854A1B-9A90-49C0-BC37-9A35C75BCA73}</Project>
|
|
||||||
<Name>Jackett.Common</Name>
|
|
||||||
</ProjectReference>
|
|
||||||
<ProjectReference Include="..\Jackett\Jackett.csproj">
|
|
||||||
<Project>{e636d5f8-68b4-4903-b4ed-ccfd9c9e899f}</Project>
|
|
||||||
<Name>Jackett</Name>
|
|
||||||
</ProjectReference>
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Content Include="jackett.ico" />
|
|
||||||
</ItemGroup>
|
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
|
||||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
|
||||||
Other similar extension points exist, see Microsoft.Common.targets.
|
|
||||||
<Target Name="BeforeBuild">
|
|
||||||
</Target>
|
|
||||||
<Target Name="AfterBuild">
|
|
||||||
</Target>
|
|
||||||
-->
|
|
||||||
</Project>
|
</Project>
|
|
@ -1,34 +1,51 @@
|
||||||
using CommandLine;
|
using CommandLine;
|
||||||
using CommandLine.Text;
|
using CommandLine.Text;
|
||||||
using Jackett.Common.Models.Config;
|
using Jackett.Common.Models.Config;
|
||||||
using Jackett.Services;
|
using Jackett.Common.Services;
|
||||||
|
using Jackett.Common.Services.Interfaces;
|
||||||
|
using Jackett.Common.Utils;
|
||||||
|
using NLog;
|
||||||
using System;
|
using System;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Net;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Web;
|
|
||||||
using Jackett.Common;
|
|
||||||
|
|
||||||
namespace Jackett.Updater
|
namespace Jackett.Updater
|
||||||
{
|
{
|
||||||
class Program
|
public class Program
|
||||||
{
|
{
|
||||||
static void Main(string[] args)
|
private IProcessService processService;
|
||||||
|
private IServiceConfigService windowsService;
|
||||||
|
private Logger logger;
|
||||||
|
|
||||||
|
public static void Main(string[] args)
|
||||||
{
|
{
|
||||||
new Program().Run(args);
|
new Program().Run(args);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Run(string[] args)
|
private void Run(string[] args)
|
||||||
{
|
{
|
||||||
Engine.BuildContainer(new RuntimeSettings()
|
RuntimeSettings runtimeSettings = new RuntimeSettings()
|
||||||
{
|
{
|
||||||
CustomLogFileName = "updater.txt"
|
CustomLogFileName = "updater.txt"
|
||||||
});
|
};
|
||||||
Engine.Logger.Info("Jackett Updater v" + GetCurrentVersion());
|
|
||||||
Engine.Logger.Info("Options \"" + string.Join("\" \"", args) + "\"");
|
LogManager.Configuration = LoggingSetup.GetLoggingConfiguration(runtimeSettings);
|
||||||
try {
|
logger = LogManager.GetCurrentClassLogger();
|
||||||
var optionsResult = Parser.Default.ParseArguments<UpdaterConsoleOptions>(args);
|
|
||||||
|
logger.Info("Jackett Updater v" + GetCurrentVersion());
|
||||||
|
logger.Info("Options \"" + string.Join("\" \"", args) + "\"");
|
||||||
|
|
||||||
|
processService = new ProcessService(logger);
|
||||||
|
windowsService = new WindowsServiceConfigService(processService, logger);
|
||||||
|
|
||||||
|
var commandLineParser = new Parser(settings => settings.CaseSensitive = false);
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var optionsResult = commandLineParser.ParseArguments<UpdaterConsoleOptions>(args);
|
||||||
optionsResult.WithParsed(options =>
|
optionsResult.WithParsed(options =>
|
||||||
{
|
{
|
||||||
ProcessUpdate(options);
|
ProcessUpdate(options);
|
||||||
|
@ -36,14 +53,14 @@ namespace Jackett.Updater
|
||||||
);
|
);
|
||||||
optionsResult.WithNotParsed(errors =>
|
optionsResult.WithNotParsed(errors =>
|
||||||
{
|
{
|
||||||
Engine.Logger.Error(HelpText.AutoBuild(optionsResult));
|
logger.Error(HelpText.AutoBuild(optionsResult));
|
||||||
Engine.Logger.Error("Failed to process update arguments!");
|
logger.Error("Failed to process update arguments!");
|
||||||
Console.ReadKey();
|
Console.ReadKey();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
Engine.Logger.Error(e, "Exception applying update!");
|
logger.Error(e, "Exception applying update!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -61,21 +78,20 @@ namespace Jackett.Updater
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var proc = Process.GetProcessById(pid);
|
var proc = Process.GetProcessById(pid);
|
||||||
Engine.Logger.Info("Killing process " + proc.Id);
|
logger.Info("Killing process " + proc.Id);
|
||||||
proc.Kill();
|
proc.Kill();
|
||||||
var exited = proc.WaitForExit(5000);
|
var exited = proc.WaitForExit(5000);
|
||||||
if (!exited)
|
if (!exited)
|
||||||
Engine.Logger.Info("Process " + pid.ToString() + " didn't exit within 5 seconds");
|
logger.Info("Process " + pid.ToString() + " didn't exit within 5 seconds");
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (ArgumentException)
|
catch (ArgumentException)
|
||||||
{
|
{
|
||||||
Engine.Logger.Info("Process " + pid.ToString() + " is already dead");
|
logger.Info("Process " + pid.ToString() + " is already dead");
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
Engine.Logger.Info("Error killing process " + pid.ToString());
|
logger.Info("Error killing process " + pid.ToString());
|
||||||
Engine.Logger.Info(e);
|
logger.Info(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -95,7 +111,7 @@ namespace Jackett.Updater
|
||||||
pids = Array.ConvertAll(pidsStr, pid => int.Parse(pid));
|
pids = Array.ConvertAll(pidsStr, pid => int.Parse(pid));
|
||||||
}
|
}
|
||||||
|
|
||||||
var isWindows = System.Environment.OSVersion.Platform != PlatformID.Unix;
|
var isWindows = Environment.OSVersion.Platform == PlatformID.Win32NT;
|
||||||
var trayRunning = false;
|
var trayRunning = false;
|
||||||
var trayProcesses = Process.GetProcessesByName("JackettTray");
|
var trayProcesses = Process.GetProcessesByName("JackettTray");
|
||||||
if (isWindows)
|
if (isWindows)
|
||||||
|
@ -106,7 +122,7 @@ namespace Jackett.Updater
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Engine.Logger.Info("Killing tray process " + proc.Id);
|
logger.Info("Killing tray process " + proc.Id);
|
||||||
proc.Kill();
|
proc.Kill();
|
||||||
trayRunning = true;
|
trayRunning = true;
|
||||||
}
|
}
|
||||||
|
@ -118,7 +134,7 @@ namespace Jackett.Updater
|
||||||
// On unix we kill the PIDs after the update so e.g. systemd can automatically restart the process
|
// On unix we kill the PIDs after the update so e.g. systemd can automatically restart the process
|
||||||
KillPids(pids);
|
KillPids(pids);
|
||||||
}
|
}
|
||||||
Engine.Logger.Info("Finding files in: " + updateLocation);
|
logger.Info("Finding files in: " + updateLocation);
|
||||||
var files = Directory.GetFiles(updateLocation, "*.*", SearchOption.AllDirectories);
|
var files = Directory.GetFiles(updateLocation, "*.*", SearchOption.AllDirectories);
|
||||||
foreach (var file in files)
|
foreach (var file in files)
|
||||||
{
|
{
|
||||||
|
@ -130,20 +146,21 @@ namespace Jackett.Updater
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
try {
|
try
|
||||||
Engine.Logger.Info("Copying " + fileName);
|
{
|
||||||
|
logger.Info("Copying " + fileName);
|
||||||
var dest = Path.Combine(options.Path, file.Substring(updateLocation.Length));
|
var dest = Path.Combine(options.Path, file.Substring(updateLocation.Length));
|
||||||
var destDir = Path.GetDirectoryName(dest);
|
var destDir = Path.GetDirectoryName(dest);
|
||||||
if (!Directory.Exists(destDir))
|
if (!Directory.Exists(destDir))
|
||||||
{
|
{
|
||||||
Engine.Logger.Info("Creating directory " + destDir);
|
logger.Info("Creating directory " + destDir);
|
||||||
Directory.CreateDirectory(destDir);
|
Directory.CreateDirectory(destDir);
|
||||||
}
|
}
|
||||||
File.Copy(file, dest, true);
|
File.Copy(file, dest, true);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
Engine.Logger.Error(e);
|
logger.Error(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -157,17 +174,16 @@ namespace Jackett.Updater
|
||||||
var deleteDir = Path.Combine(options.Path, oldDir);
|
var deleteDir = Path.Combine(options.Path, oldDir);
|
||||||
if (Directory.Exists(deleteDir))
|
if (Directory.Exists(deleteDir))
|
||||||
{
|
{
|
||||||
Engine.Logger.Info("Deleting directory " + deleteDir);
|
logger.Info("Deleting directory " + deleteDir);
|
||||||
Directory.Delete(deleteDir, true);
|
Directory.Delete(deleteDir, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
Engine.Logger.Error(e);
|
logger.Error(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// delete old files
|
// delete old files
|
||||||
string[] oldFiles = new string[] {
|
string[] oldFiles = new string[] {
|
||||||
"Content/css/jquery.dataTables.css",
|
"Content/css/jquery.dataTables.css",
|
||||||
|
@ -209,20 +225,20 @@ namespace Jackett.Updater
|
||||||
"Definitions/torrentwtf.yml",
|
"Definitions/torrentwtf.yml",
|
||||||
};
|
};
|
||||||
|
|
||||||
foreach (var oldFIle in oldFiles)
|
foreach (var oldFile in oldFiles)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var deleteFile = Path.Combine(options.Path, oldFIle);
|
var deleteFile = Path.Combine(options.Path, oldFile);
|
||||||
if (File.Exists(deleteFile))
|
if (File.Exists(deleteFile))
|
||||||
{
|
{
|
||||||
Engine.Logger.Info("Deleting file " + deleteFile);
|
logger.Info("Deleting file " + deleteFile);
|
||||||
File.Delete(deleteFile);
|
File.Delete(deleteFile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
Engine.Logger.Error(e);
|
logger.Error(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -232,7 +248,7 @@ namespace Jackett.Updater
|
||||||
|
|
||||||
if (options.NoRestart == false)
|
if (options.NoRestart == false)
|
||||||
{
|
{
|
||||||
if (trayRunning)
|
if (trayRunning || options.StartTray)
|
||||||
{
|
{
|
||||||
var startInfo = new ProcessStartInfo()
|
var startInfo = new ProcessStartInfo()
|
||||||
{
|
{
|
||||||
|
@ -242,16 +258,22 @@ namespace Jackett.Updater
|
||||||
};
|
};
|
||||||
|
|
||||||
Process.Start(startInfo);
|
Process.Start(startInfo);
|
||||||
|
|
||||||
|
if (!windowsService.ServiceExists())
|
||||||
|
{
|
||||||
|
//User was running the tray icon, but not using the Windows service, starting Tray icon will start JackettConsole as well
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (string.Equals(options.Type, "JackettService.exe", StringComparison.InvariantCultureIgnoreCase))
|
if (string.Equals(options.Type, "JackettService.exe", StringComparison.InvariantCultureIgnoreCase))
|
||||||
{
|
{
|
||||||
var serviceHelper = new ServiceConfigService(null, null);
|
if (windowsService.ServiceExists())
|
||||||
if (serviceHelper.ServiceExists())
|
|
||||||
{
|
{
|
||||||
serviceHelper.Start();
|
windowsService.Start();
|
||||||
}
|
}
|
||||||
} else
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
var startInfo = new ProcessStartInfo()
|
var startInfo = new ProcessStartInfo()
|
||||||
{
|
{
|
||||||
|
@ -266,7 +288,7 @@ namespace Jackett.Updater
|
||||||
startInfo.FileName = "mono";
|
startInfo.FileName = "mono";
|
||||||
}
|
}
|
||||||
|
|
||||||
Engine.Logger.Info("Starting Jackett: " + startInfo.FileName + " " + startInfo.Arguments);
|
logger.Info("Starting Jackett: " + startInfo.FileName + " " + startInfo.Arguments);
|
||||||
Process.Start(startInfo);
|
Process.Start(startInfo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -275,7 +297,7 @@ namespace Jackett.Updater
|
||||||
private string GetUpdateLocation()
|
private string GetUpdateLocation()
|
||||||
{
|
{
|
||||||
var location = new Uri(Assembly.GetEntryAssembly().GetName().CodeBase);
|
var location = new Uri(Assembly.GetEntryAssembly().GetName().CodeBase);
|
||||||
return new FileInfo(HttpUtility.UrlDecode(location.AbsolutePath)).DirectoryName;
|
return new FileInfo(WebUtility.UrlDecode(location.AbsolutePath)).DirectoryName;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,35 +0,0 @@
|
||||||
using System.Reflection;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
|
|
||||||
// General Information about an assembly is controlled through the following
|
|
||||||
// set of attributes. Change these attribute values to modify the information
|
|
||||||
// associated with an assembly.
|
|
||||||
[assembly: AssemblyTitle("Jackett.Updater")]
|
|
||||||
[assembly: AssemblyDescription("")]
|
|
||||||
[assembly: AssemblyConfiguration("")]
|
|
||||||
[assembly: AssemblyCompany("")]
|
|
||||||
[assembly: AssemblyProduct("Jackett.Updater")]
|
|
||||||
[assembly: AssemblyCopyright("Copyright © 2015")]
|
|
||||||
[assembly: AssemblyTrademark("")]
|
|
||||||
[assembly: AssemblyCulture("")]
|
|
||||||
|
|
||||||
// Setting ComVisible to false makes the types in this assembly not visible
|
|
||||||
// to COM components. If you need to access a type in this assembly from
|
|
||||||
// COM, set the ComVisible attribute to true on that type.
|
|
||||||
[assembly: ComVisible(false)]
|
|
||||||
|
|
||||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
|
||||||
[assembly: Guid("a61e311a-6f8b-4497-b5e4-2ea8994c7bd8")]
|
|
||||||
|
|
||||||
// Version information for an assembly consists of the following four values:
|
|
||||||
//
|
|
||||||
// Major Version
|
|
||||||
// Minor Version
|
|
||||||
// Build Number
|
|
||||||
// Revision
|
|
||||||
//
|
|
||||||
// You can specify all the values or you can default the Build and Revision Numbers
|
|
||||||
// by using the '*' as shown below:
|
|
||||||
// [assembly: AssemblyVersion("1.0.*")]
|
|
||||||
[assembly: AssemblyVersion("0.0.0.0")]
|
|
||||||
[assembly: AssemblyFileVersion("0.0.0.0")]
|
|
|
@ -18,5 +18,8 @@ namespace Jackett.Updater
|
||||||
|
|
||||||
[Option("KillPids", HelpText = "PIDs which will be killed before (Windows) or after (Unix) the update")]
|
[Option("KillPids", HelpText = "PIDs which will be killed before (Windows) or after (Unix) the update")]
|
||||||
public string KillPids { get; set; }
|
public string KillPids { get; set; }
|
||||||
|
|
||||||
|
[Option("StartTray", HelpText = "Indicates that the updater should start the tray icon")]
|
||||||
|
public bool StartTray { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue