NzbDrone Update no longer opens console/browser.

This commit is contained in:
Keivan Beigi 2013-07-08 17:47:09 -07:00
commit 34f3ee6b4b
18 changed files with 137 additions and 85 deletions

View file

@ -6,7 +6,7 @@
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{4CCC53CD-8D5E-4CC4-97D2-5C9312AC2BD7}</ProjectGuid>
<OutputType>Exe</OutputType>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>NzbDrone.Update</RootNamespace>
<AssemblyName>NzbDrone.Update</AssemblyName>
@ -54,6 +54,9 @@
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup>
<StartupObject />
</PropertyGroup>
<ItemGroup>
<Reference Include="NLog, Version=2.0.1.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>

View file

@ -1,7 +1,9 @@
using System;
using System.Diagnostics;
using System.IO;
using NLog;
using NzbDrone.Common;
using NzbDrone.Common.EnvironmentInfo;
using IServiceProvider = NzbDrone.Common.IServiceProvider;
namespace NzbDrone.Update.UpdateEngine
@ -58,14 +60,20 @@ namespace NzbDrone.Update.UpdateEngine
private void StartWinform(string installationFolder)
{
_logger.Info("Starting NzbDrone without Console");
_processProvider.Start(Path.Combine(installationFolder, "NzbDrone.exe"));
Start(installationFolder, "NzbDrone.exe");
}
private void StartConsole(string installationFolder)
{
_logger.Info("Starting NzbDrone with Console");
_processProvider.Start(Path.Combine(installationFolder, "NzbDrone.Console.exe"));
Start(installationFolder, "NzbDrone.Console.exe");
}
private void Start(string installationFolder, string fileName)
{
_logger.Info("Starting {0}", fileName);
var path = Path.Combine(installationFolder, fileName);
_processProvider.Start(new ProcessStartInfo(path, StartupArguments.NO_BROWSER));
}
}
}