Pass data cmd argument between application and update.

This commit is contained in:
Keivan Beigi
2014-12-17 14:44:02 -08:00
parent 9b715ee078
commit cb3d5fbfe7
5 changed files with 66 additions and 3 deletions
@@ -1,4 +1,5 @@
using System.Collections.Generic;
using System.Runtime.InteropServices.ComTypes;
namespace NzbDrone.Common.EnvironmentInfo
{
@@ -8,6 +9,8 @@ namespace NzbDrone.Common.EnvironmentInfo
Dictionary<string, string> Args { get; }
bool InstallService { get; }
bool UninstallService { get; }
string PreservedArguments { get; }
}
public class StartupContext : IStartupContext
@@ -60,5 +63,25 @@ namespace NzbDrone.Common.EnvironmentInfo
return Flags.Contains(UNINSTALL_SERVICE);
}
}
public string PreservedArguments
{
get
{
var args = "";
if (Args.ContainsKey(APPDATA))
{
args = "/data=" + Args[APPDATA];
}
if (Flags.Contains(NO_BROWSER))
{
args += " /" + NO_BROWSER;
}
return args.Trim();
}
}
}
}