aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.ServerApplication
diff options
context:
space:
mode:
authorLukePulverenti <luke.pulverenti@gmail.com>2013-02-21 23:23:06 -0500
committerLukePulverenti <luke.pulverenti@gmail.com>2013-02-21 23:23:06 -0500
commit868a7ce9c8b50bd64c8b5ae33fec77abfd25ef7c (patch)
treea60a3a27afe43a8b5e3412279225be7b2415e6c3 /MediaBrowser.ServerApplication
parentfdafa596832eae13cebcf5bbe5fa867f7ba068f0 (diff)
isolated clickonce dependancies
Diffstat (limited to 'MediaBrowser.ServerApplication')
-rw-r--r--MediaBrowser.ServerApplication/App.xaml.cs56
-rw-r--r--MediaBrowser.ServerApplication/LibraryExplorer.xaml.cs2
-rw-r--r--MediaBrowser.ServerApplication/MediaBrowser.ServerApplication.csproj5
3 files changed, 41 insertions, 22 deletions
diff --git a/MediaBrowser.ServerApplication/App.xaml.cs b/MediaBrowser.ServerApplication/App.xaml.cs
index cc6367127..919898aa3 100644
--- a/MediaBrowser.ServerApplication/App.xaml.cs
+++ b/MediaBrowser.ServerApplication/App.xaml.cs
@@ -1,14 +1,14 @@
-using MediaBrowser.Common.Kernel;
-using MediaBrowser.Common.Updates;
+using MediaBrowser.ClickOnce;
+using MediaBrowser.Common.Kernel;
using MediaBrowser.Controller;
using MediaBrowser.IsoMounter;
using MediaBrowser.Logging.Nlog;
using MediaBrowser.Model.Logging;
+using MediaBrowser.Model.Updates;
using MediaBrowser.Server.Uninstall;
using MediaBrowser.ServerApplication.Implementations;
using Microsoft.Win32;
using System;
-using System.Deployment.Application;
using System.Diagnostics;
using System.IO;
using System.Linq;
@@ -71,7 +71,7 @@ namespace MediaBrowser.ServerApplication
/// Gets or sets the log file path.
/// </summary>
/// <value>The log file path.</value>
- private string LogFilePath { get; set; }
+ public string LogFilePath { get; private set; }
/// <summary>
/// Initializes a new instance of the <see cref="App" /> class.
@@ -235,24 +235,9 @@ namespace MediaBrowser.ServerApplication
/// </summary>
private void ConfigureClickOnceStartup()
{
- if (!ApplicationDeployment.IsNetworkDeployed)
- {
- return;
- }
-
try
{
- var clickOnceHelper = new ClickOnceHelper(PublisherName, ProductName, SuiteName);
-
- if (Kernel.Configuration.RunAtStartup)
- {
- clickOnceHelper.UpdateUninstallParameters(UninstallerFileName);
- clickOnceHelper.AddShortcutToStartup();
- }
- else
- {
- clickOnceHelper.RemoveShortcutFromStartup();
- }
+ ClickOnceHelper.ConfigureClickOnceStartupIfInstalled(PublisherName, ProductName, SuiteName, Kernel.Configuration.RunAtStartup, UninstallerFileName);
LastRunAtStartupValue = Kernel.Configuration.RunAtStartup;
}
@@ -469,5 +454,36 @@ namespace MediaBrowser.ServerApplication
RenderOptions.SetBitmapScalingMode(bitmap, BitmapScalingMode.Fant);
return bitmap;
}
+
+ /// <summary>
+ /// Gets or sets a value indicating whether this instance can self update.
+ /// </summary>
+ /// <value><c>true</c> if this instance can self update; otherwise, <c>false</c>.</value>
+ public bool CanSelfUpdate
+ {
+ get { return ClickOnceHelper.IsNetworkDeployed; }
+ }
+
+ /// <summary>
+ /// Checks for update.
+ /// </summary>
+ /// <param name="cancellationToken">The cancellation token.</param>
+ /// <param name="progress">The progress.</param>
+ /// <returns>Task{CheckForUpdateResult}.</returns>
+ public Task<CheckForUpdateResult> CheckForApplicationUpdate(CancellationToken cancellationToken, IProgress<double> progress)
+ {
+ return new ApplicationUpdateCheck().CheckForApplicationUpdate(cancellationToken, progress);
+ }
+
+ /// <summary>
+ /// Updates the application.
+ /// </summary>
+ /// <param name="cancellationToken">The cancellation token.</param>
+ /// <param name="progress">The progress.</param>
+ /// <returns>Task.</returns>
+ public Task UpdateApplication(CancellationToken cancellationToken, IProgress<double> progress)
+ {
+ return new ApplicationUpdater().UpdateApplication(cancellationToken, progress);
+ }
}
}
diff --git a/MediaBrowser.ServerApplication/LibraryExplorer.xaml.cs b/MediaBrowser.ServerApplication/LibraryExplorer.xaml.cs
index 9645b93dc..02dd6fb9c 100644
--- a/MediaBrowser.ServerApplication/LibraryExplorer.xaml.cs
+++ b/MediaBrowser.ServerApplication/LibraryExplorer.xaml.cs
@@ -41,7 +41,7 @@ namespace MediaBrowser.ServerApplication
_logger = logger;
InitializeComponent();
- lblVersion.Content = "Version: " + Kernel.Instance.DisplayVersion;
+ lblVersion.Content = "Version: " + Kernel.Instance.ApplicationVersion;
foreach (var user in Kernel.Instance.Users)
ddlProfile.Items.Add(user);
ddlProfile.Items.Insert(0,new User {Name = "Physical"});
diff --git a/MediaBrowser.ServerApplication/MediaBrowser.ServerApplication.csproj b/MediaBrowser.ServerApplication/MediaBrowser.ServerApplication.csproj
index ff8be69e4..2f9169123 100644
--- a/MediaBrowser.ServerApplication/MediaBrowser.ServerApplication.csproj
+++ b/MediaBrowser.ServerApplication/MediaBrowser.ServerApplication.csproj
@@ -138,7 +138,6 @@
<Reference Include="System.Data.SQLite.Linq">
<HintPath>..\packages\System.Data.SQLite.1.0.84.0\lib\net45\System.Data.SQLite.Linq.dll</HintPath>
</Reference>
- <Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Runtime.Remoting" />
<Reference Include="System.Web.Extensions" />
@@ -240,6 +239,10 @@
<Project>{07b509c0-0c28-4f3f-8963-5263281f7e3d}</Project>
<Name>BDInfo</Name>
</ProjectReference>
+ <ProjectReference Include="..\MediaBrowser.ClickOnce\MediaBrowser.ClickOnce.csproj">
+ <Project>{cc96bf3e-0bda-4809-bc4b-bb6d418f4a84}</Project>
+ <Name>MediaBrowser.ClickOnce</Name>
+ </ProjectReference>
<ProjectReference Include="..\MediaBrowser.Common\MediaBrowser.Common.csproj">
<Project>{9142eefa-7570-41e1-bfcc-468bb571af2f}</Project>
<Name>MediaBrowser.Common</Name>