aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Reed <ebr@mediabrowser3.com>2013-03-02 11:10:06 -0500
committerEric Reed <ebr@mediabrowser3.com>2013-03-02 11:10:06 -0500
commitcb17eca3a4f2153289c5b18b7cc8d6c16770a3a0 (patch)
tree81498d56964ced01e5f58f3b41295683cae896b3
parent334c0692074470fd6a500a8d93113e3684f3fc5b (diff)
Full cmdline support for installer
-rw-r--r--MediaBrowser.Installer/MainWindow.xaml.cs22
-rw-r--r--MediaBrowser.Installer/MediaBrowser.Installer.csproj2
2 files changed, 19 insertions, 5 deletions
diff --git a/MediaBrowser.Installer/MainWindow.xaml.cs b/MediaBrowser.Installer/MainWindow.xaml.cs
index 644566325..6f64ded86 100644
--- a/MediaBrowser.Installer/MainWindow.xaml.cs
+++ b/MediaBrowser.Installer/MainWindow.xaml.cs
@@ -76,11 +76,25 @@ namespace MediaBrowser.Installer
protected void GetArgs()
{
- var product = ConfigurationManager.AppSettings["product"] ?? "server";
- PackageClass = (PackageVersionClass) Enum.Parse(typeof (PackageVersionClass), ConfigurationManager.AppSettings["class"] ?? "Release");
+ //cmd line args should be name/value pairs like: product=server archive="c:\.." caller=34552
var cmdArgs = Environment.GetCommandLineArgs();
- Archive = cmdArgs.Length > 1 ? cmdArgs[1] : null;
- var callerId = cmdArgs.Length > 2 ? cmdArgs[2] : null;
+ var args = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
+ foreach (var pair in cmdArgs)
+ {
+ var nameValue = pair.Split('=');
+ if (nameValue.Length == 2)
+ {
+ args[nameValue[0]] = nameValue[1];
+ }
+ }
+
+ Archive = args.GetValueOrDefault("archive", null);
+
+ var product = args.GetValueOrDefault("product", null) ?? ConfigurationManager.AppSettings["product"] ?? "server";
+ PackageClass = (PackageVersionClass) Enum.Parse(typeof (PackageVersionClass), args.GetValueOrDefault("class", null) ?? ConfigurationManager.AppSettings["class"] ?? "Release");
+ PackageVersion = new Version(args.GetValueOrDefault("version", "4.0"));
+
+ var callerId = args.GetValueOrDefault("caller", null);
if (callerId != null)
{
// Wait for our caller to exit
diff --git a/MediaBrowser.Installer/MediaBrowser.Installer.csproj b/MediaBrowser.Installer/MediaBrowser.Installer.csproj
index 3a7d9102e..2d95ae5ad 100644
--- a/MediaBrowser.Installer/MediaBrowser.Installer.csproj
+++ b/MediaBrowser.Installer/MediaBrowser.Installer.csproj
@@ -29,7 +29,7 @@
<PublisherName>Media Browser Team</PublisherName>
<SuiteName>Media Browser</SuiteName>
<OpenBrowserOnPublish>false</OpenBrowserOnPublish>
- <ApplicationRevision>32</ApplicationRevision>
+ <ApplicationRevision>34</ApplicationRevision>
<ApplicationVersion>0.1.1.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<PublishWizardCompleted>true</PublishWizardCompleted>