From c1116d0faa34393c3210197a8a7b7c14f9de64f9 Mon Sep 17 00:00:00 2001 From: "kay.one" Date: Mon, 24 Oct 2011 23:11:50 -0700 Subject: [PATCH] Fixed bug where service where windows service couldn't be installed. --- NzbDrone.Common/ServiceProvider.cs | 6 +++--- NzbDrone.Core.Test/ParserTest.cs | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/NzbDrone.Common/ServiceProvider.cs b/NzbDrone.Common/ServiceProvider.cs index da14867d1..7ae6b7559 100644 --- a/NzbDrone.Common/ServiceProvider.cs +++ b/NzbDrone.Common/ServiceProvider.cs @@ -1,11 +1,10 @@ using System; using System.Collections.Specialized; using System.Configuration.Install; +using System.Diagnostics; using System.Linq; -using System.Reflection; using System.ServiceProcess; using NLog; -using TimeoutException = System.TimeoutException; namespace NzbDrone.Common { @@ -37,7 +36,7 @@ namespace NzbDrone.Common var serviceInstaller = new ServiceInstaller(); - String[] cmdline = { @"/assemblypath=" + Assembly.GetExecutingAssembly().Location }; + String[] cmdline = { @"/assemblypath=" + Process.GetCurrentProcess().StartInfo.FileName }; var context = new InstallContext("service_install.log", cmdline); serviceInstaller.Context = context; @@ -86,6 +85,7 @@ namespace NzbDrone.Common if (service == null) { Logger.Warn("Unable to stop {0}. no service with that name exists.", serviceName); + return; } Logger.Info("Service is currently {0}", service.Status); diff --git a/NzbDrone.Core.Test/ParserTest.cs b/NzbDrone.Core.Test/ParserTest.cs index 19a062476..c780528fc 100644 --- a/NzbDrone.Core.Test/ParserTest.cs +++ b/NzbDrone.Core.Test/ParserTest.cs @@ -66,6 +66,7 @@ namespace NzbDrone.Core.Test [TestCase("C:/Test/TV/Chuck.4x05.HDTV.XviD-LOL", 4, 5)] [TestCase(@"P:\TV Shows\House\Season 6\S06E13 - 5 to 9 - 720p BluRay.mkv", 6, 13)] [TestCase(@"S:\TV Drop\House - 10x11 - Title [SDTV]\1011 - Title.avi", 10, 11)] + [TestCase(@"S:\TV Drop\_ParseError_King of the Hill - 10x12 - 24 Hour Propane People [SDTV]\1012 - 24 Hour Propane People.avi", 10, 12)] public void PathParse_tests(string path, int season, int episode) { var result = Parser.ParsePath(path);