diff --git a/MediaBrowser.ClickOnce/ApplicationUpdateCheck.cs b/MediaBrowser.ClickOnce/ApplicationUpdateCheck.cs deleted file mode 100644 index 72c42f586..000000000 --- a/MediaBrowser.ClickOnce/ApplicationUpdateCheck.cs +++ /dev/null @@ -1,106 +0,0 @@ -using MediaBrowser.Model.Updates; -using System; -using System.Deployment.Application; -using System.Threading; -using System.Threading.Tasks; - -namespace MediaBrowser.ClickOnce -{ - /// - /// Class ApplicationUpdateCheck - /// - public class ApplicationUpdateCheck - { - /// - /// The _task completion source - /// - private TaskCompletionSource _taskCompletionSource; - - /// - /// The _progress - /// - private IProgress _progress; - - /// - /// Checks for application update. - /// - /// The cancellation token. - /// The progress. - /// Task{CheckForUpdateCompletedEventArgs}. - /// Current deployment is not a ClickOnce deployment - public Task CheckForApplicationUpdate(CancellationToken cancellationToken, IProgress progress) - { - if (!ApplicationDeployment.IsNetworkDeployed) - { - throw new InvalidOperationException("Current deployment is not network deployed."); - } - - _progress = progress; - - _taskCompletionSource = new TaskCompletionSource(); - - var deployment = ApplicationDeployment.CurrentDeployment; - - cancellationToken.Register(deployment.CheckForUpdateAsyncCancel); - - cancellationToken.ThrowIfCancellationRequested(); - - deployment.CheckForUpdateCompleted += deployment_CheckForUpdateCompleted; - deployment.CheckForUpdateProgressChanged += deployment_CheckForUpdateProgressChanged; - - deployment.CheckForUpdateAsync(); - - return _taskCompletionSource.Task; - } - - /// - /// To the result. - /// - /// The instance containing the event data. - /// CheckForUpdateResult. - private CheckForUpdateResult ToResult(CheckForUpdateCompletedEventArgs args) - { - return new CheckForUpdateResult - { - AvailableVersion = args.AvailableVersion, - IsUpdateAvailable = args.UpdateAvailable - }; - } - - /// - /// Handles the CheckForUpdateCompleted event of the deployment control. - /// - /// The source of the event. - /// The instance containing the event data. - void deployment_CheckForUpdateCompleted(object sender, CheckForUpdateCompletedEventArgs e) - { - var deployment = ApplicationDeployment.CurrentDeployment; - - deployment.CheckForUpdateCompleted -= deployment_CheckForUpdateCompleted; - deployment.CheckForUpdateProgressChanged -= deployment_CheckForUpdateProgressChanged; - - if (e.Error != null) - { - _taskCompletionSource.SetException(e.Error); - } - else if (e.Cancelled) - { - _taskCompletionSource.SetCanceled(); - } - else - { - _taskCompletionSource.SetResult(ToResult(e)); - } - } - - /// - /// Handles the CheckForUpdateProgressChanged event of the deployment control. - /// - /// The source of the event. - /// The instance containing the event data. - void deployment_CheckForUpdateProgressChanged(object sender, DeploymentProgressChangedEventArgs e) - { - _progress.Report(e.ProgressPercentage); - } - } -} diff --git a/MediaBrowser.ClickOnce/ApplicationUpdater.cs b/MediaBrowser.ClickOnce/ApplicationUpdater.cs deleted file mode 100644 index 29af406f1..000000000 --- a/MediaBrowser.ClickOnce/ApplicationUpdater.cs +++ /dev/null @@ -1,92 +0,0 @@ -using System; -using System.ComponentModel; -using System.Deployment.Application; -using System.Threading; -using System.Threading.Tasks; - -namespace MediaBrowser.ClickOnce -{ - /// - /// Class ApplicationUpdater - /// - public class ApplicationUpdater - { - /// - /// The _task completion source - /// - private TaskCompletionSource _taskCompletionSource; - - /// - /// The _progress - /// - private IProgress _progress; - - /// - /// Updates the application - /// - /// The cancellation token. - /// The progress. - /// Task{AsyncCompletedEventArgs}. - /// Current deployment is not network deployed. - public Task UpdateApplication(CancellationToken cancellationToken, IProgress progress) - { - if (!ApplicationDeployment.IsNetworkDeployed) - { - throw new InvalidOperationException("Current deployment is not network deployed."); - } - - _progress = progress; - - _taskCompletionSource = new TaskCompletionSource(); - - var deployment = ApplicationDeployment.CurrentDeployment; - - cancellationToken.Register(deployment.UpdateAsyncCancel); - - cancellationToken.ThrowIfCancellationRequested(); - - deployment.UpdateCompleted += deployment_UpdateCompleted; - deployment.UpdateProgressChanged += deployment_UpdateProgressChanged; - - deployment.UpdateAsync(); - - return _taskCompletionSource.Task; - } - - /// - /// Handles the UpdateCompleted event of the deployment control. - /// - /// The source of the event. - /// The instance containing the event data. - void deployment_UpdateCompleted(object sender, AsyncCompletedEventArgs e) - { - var deployment = ApplicationDeployment.CurrentDeployment; - - deployment.UpdateCompleted -= deployment_UpdateCompleted; - deployment.UpdateProgressChanged -= deployment_UpdateProgressChanged; - - if (e.Error != null) - { - _taskCompletionSource.SetException(e.Error); - } - else if (e.Cancelled) - { - _taskCompletionSource.SetCanceled(); - } - else - { - _taskCompletionSource.SetResult(e); - } - } - - /// - /// Handles the UpdateProgressChanged event of the deployment control. - /// - /// The source of the event. - /// The instance containing the event data. - void deployment_UpdateProgressChanged(object sender, DeploymentProgressChangedEventArgs e) - { - _progress.Report(e.ProgressPercentage); - } - } -} diff --git a/MediaBrowser.ClickOnce/ClickOnceHelper.cs b/MediaBrowser.ClickOnce/ClickOnceHelper.cs deleted file mode 100644 index c86332ccf..000000000 --- a/MediaBrowser.ClickOnce/ClickOnceHelper.cs +++ /dev/null @@ -1,255 +0,0 @@ -using System.Deployment.Application; -using Microsoft.Win32; -using System; -using System.Diagnostics; -using System.IO; -using System.Linq; -using System.Reflection; -using System.Security.AccessControl; - -namespace MediaBrowser.ClickOnce -{ - /// - /// Class ClickOnceHelper - /// - public class ClickOnceHelper - { - /// - /// The uninstall string - /// - private const string UninstallString = "UninstallString"; - /// - /// The display name key - /// - private const string DisplayNameKey = "DisplayName"; - /// - /// The uninstall string file - /// - private const string UninstallStringFile = "UninstallString.bat"; - /// - /// The appref extension - /// - private const string ApprefExtension = ".appref-ms"; - /// - /// The uninstall registry key - /// - private readonly RegistryKey UninstallRegistryKey; - - /// - /// Gets the location. - /// - /// The location. - private static string Location - { - get { return Assembly.GetExecutingAssembly().Location; } - } - - /// - /// Gets a value indicating whether this instance is network deployed. - /// - /// true if this instance is network deployed; otherwise, false. - public static bool IsNetworkDeployed - { - get { return ApplicationDeployment.IsNetworkDeployed; } - } - - /// - /// Gets the name of the publisher. - /// - /// The name of the publisher. - public string PublisherName { get; private set; } - /// - /// Gets the name of the product. - /// - /// The name of the product. - public string ProductName { get; private set; } - /// - /// Gets the uninstall file. - /// - /// The uninstall file. - public string UninstallFile { get; private set; } - /// - /// Gets the name of the suite. - /// - /// The name of the suite. - public string SuiteName { get; private set; } - - /// - /// Initializes a new instance of the class. - /// - /// Name of the publisher. - /// Name of the product. - /// Name of the suite. - public ClickOnceHelper(string publisherName, string productName, string suiteName) - { - PublisherName = publisherName; - ProductName = productName; - SuiteName = suiteName; - - var publisherFolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), PublisherName); - - if (!Directory.Exists(publisherFolder)) - { - Directory.CreateDirectory(publisherFolder); - } - - UninstallFile = Path.Combine(publisherFolder, UninstallStringFile); - - UninstallRegistryKey = GetUninstallRegistryKeyByProductName(ProductName); - } - - /// - /// Gets the shortcut path. - /// - /// System.String. - private string GetShortcutPath() - { - var allProgramsPath = Environment.GetFolderPath(Environment.SpecialFolder.Programs); - - var shortcutPath = Path.Combine(allProgramsPath, PublisherName); - - if (!string.IsNullOrEmpty(SuiteName)) - { - shortcutPath = Path.Combine(shortcutPath, SuiteName); - } - - return Path.Combine(shortcutPath, ProductName) + ApprefExtension; - } - - /// - /// Gets the startup shortcut path. - /// - /// System.String. - private string GetStartupShortcutPath() - { - var startupPath = Environment.GetFolderPath(Environment.SpecialFolder.Startup); - - return Path.Combine(startupPath, ProductName) + ApprefExtension; - } - - /// - /// Adds the shortcut to startup. - /// - public void AddShortcutToStartup() - { - var startupPath = GetStartupShortcutPath(); - - if (!File.Exists(startupPath)) - { - File.Copy(GetShortcutPath(), startupPath); - } - } - - /// - /// Removes the shortcut from startup. - /// - public void RemoveShortcutFromStartup() - { - var startupPath = GetStartupShortcutPath(); - - if (File.Exists(startupPath)) - { - File.Delete(startupPath); - } - } - - /// - /// Updates the uninstall parameters. - /// - /// Name of the uninstaller file. - public void UpdateUninstallParameters(string uninstallerFileName) - { - if (UninstallRegistryKey != null) - { - UpdateUninstallString(uninstallerFileName); - } - } - - /// - /// Gets the name of the uninstall registry key by product. - /// - /// Name of the product. - /// RegistryKey. - private RegistryKey GetUninstallRegistryKeyByProductName(string productName) - { - var subKey = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Uninstall"); - - if (subKey == null) - { - return null; - } - - return subKey.GetSubKeyNames() - .Select(name => subKey.OpenSubKey(name, RegistryKeyPermissionCheck.ReadWriteSubTree, RegistryRights.QueryValues | RegistryRights.ReadKey | RegistryRights.SetValue)) - .Where(application => application != null) - .FirstOrDefault(application => application.GetValueNames().Where(appKey => appKey.Equals(DisplayNameKey)).Any(appKey => application.GetValue(appKey).Equals(productName))); - } - - /// - /// Updates the uninstall string. - /// - /// Name of the uninstaller file. - private void UpdateUninstallString(string uninstallerFileName) - { - var uninstallString = (string)UninstallRegistryKey.GetValue(UninstallString); - - if (!string.IsNullOrEmpty(UninstallFile) && uninstallString.StartsWith("rundll32.exe", StringComparison.OrdinalIgnoreCase)) - { - File.WriteAllText(UninstallFile, uninstallString); - } - - var str = String.Format("\"{0}\" uninstall", Path.Combine(Path.GetDirectoryName(Location), uninstallerFileName)); - - UninstallRegistryKey.SetValue(UninstallString, str); - } - - /// - /// Uninstalls this instance. - /// - public void Uninstall() - { - RemoveShortcutFromStartup(); - - var uninstallString = File.ReadAllText(UninstallFile); - - new Process - { - StartInfo = - { - Arguments = uninstallString.Substring(uninstallString.IndexOf(" ", StringComparison.OrdinalIgnoreCase) + 1), - FileName = uninstallString.Substring(0, uninstallString.IndexOf(" ", StringComparison.OrdinalIgnoreCase)), - UseShellExecute = false - } - - }.Start(); - } - - /// - /// Configures the click once startup. - /// - /// Name of the publisher. - /// Name of the product. - /// Name of the suite. - /// if set to true [run at startup]. - /// The uninstaller filename. - public static void ConfigureClickOnceStartupIfInstalled(string publisherName, string productName, string suiteName, bool runAtStartup, string uninstallerFilename) - { - if (!ApplicationDeployment.IsNetworkDeployed) - { - return; - } - - var clickOnceHelper = new ClickOnceHelper(publisherName, productName, suiteName); - - if (runAtStartup) - { - clickOnceHelper.UpdateUninstallParameters(uninstallerFilename); - clickOnceHelper.AddShortcutToStartup(); - } - else - { - clickOnceHelper.RemoveShortcutFromStartup(); - } - } - } -} diff --git a/MediaBrowser.ClickOnce/MediaBrowser.ClickOnce.csproj b/MediaBrowser.ClickOnce/MediaBrowser.ClickOnce.csproj deleted file mode 100644 index eb566fd7f..000000000 --- a/MediaBrowser.ClickOnce/MediaBrowser.ClickOnce.csproj +++ /dev/null @@ -1,66 +0,0 @@ - - - - - Debug - AnyCPU - {CC96BF3E-0BDA-4809-BC4B-BB6D418F4A84} - Library - Properties - MediaBrowser.ClickOnce - MediaBrowser.ClickOnce - v4.5 - 512 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - Properties\SharedVersion.cs - - - - - - - - - {7eeeb4bb-f3e8-48fc-b4c5-70f0fff8329b} - MediaBrowser.Model - - - - - if $(ConfigurationName) == Release ( -xcopy "$(TargetPath)" "$(SolutionDir)\Nuget\dlls\" /y /d /r /i -) - - - \ No newline at end of file diff --git a/MediaBrowser.ClickOnce/Properties/AssemblyInfo.cs b/MediaBrowser.ClickOnce/Properties/AssemblyInfo.cs deleted file mode 100644 index c3947b648..000000000 --- a/MediaBrowser.ClickOnce/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("MediaBrowser.ClickOnce")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("MediaBrowser.ClickOnce")] -[assembly: AssemblyCopyright("Copyright © 2013")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("16e62c11-5009-4212-8c96-fd692479fc5d")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// \ No newline at end of file diff --git a/MediaBrowser.ServerApplication/MediaBrowser.ServerApplication.csproj b/MediaBrowser.ServerApplication/MediaBrowser.ServerApplication.csproj index 00b68e254..4ca2c6f96 100644 --- a/MediaBrowser.ServerApplication/MediaBrowser.ServerApplication.csproj +++ b/MediaBrowser.ServerApplication/MediaBrowser.ServerApplication.csproj @@ -248,10 +248,6 @@ {4fd51ac5-2c16-4308-a993-c3a84f3b4582} MediaBrowser.Api - - {cc96bf3e-0bda-4809-bc4b-bb6d418f4a84} - MediaBrowser.ClickOnce - {c4d2573a-3fd3-441f-81af-174ac4cd4e1d} MediaBrowser.Common.Implementations diff --git a/MediaBrowser.sln b/MediaBrowser.sln index b473b2062..16caa617d 100644 --- a/MediaBrowser.sln +++ b/MediaBrowser.sln @@ -31,8 +31,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MediaBrowser.IsoMounter", " EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MediaBrowser.Installer", "MediaBrowser.Installer\MediaBrowser.Installer.csproj", "{3879F78A-D6F6-45E5-B2A8-D8DCF2DABB74}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MediaBrowser.ClickOnce", "MediaBrowser.ClickOnce\MediaBrowser.ClickOnce.csproj", "{CC96BF3E-0BDA-4809-BC4B-BB6D418F4A84}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MediaBrowser.Common.Implementations", "MediaBrowser.Common.Implementations\MediaBrowser.Common.Implementations.csproj", "{C4D2573A-3FD3-441F-81AF-174AC4CD4E1D}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MediaBrowser.Server.Implementations", "MediaBrowser.Server.Implementations\MediaBrowser.Server.Implementations.csproj", "{2E781478-814D-4A48-9D80-BFF206441A65}" @@ -179,20 +177,6 @@ Global {3879F78A-D6F6-45E5-B2A8-D8DCF2DABB74}.Release|Win32.ActiveCfg = Release|Any CPU {3879F78A-D6F6-45E5-B2A8-D8DCF2DABB74}.Release|x64.ActiveCfg = Release|Any CPU {3879F78A-D6F6-45E5-B2A8-D8DCF2DABB74}.Release|x86.ActiveCfg = Release|Any CPU - {CC96BF3E-0BDA-4809-BC4B-BB6D418F4A84}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CC96BF3E-0BDA-4809-BC4B-BB6D418F4A84}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CC96BF3E-0BDA-4809-BC4B-BB6D418F4A84}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {CC96BF3E-0BDA-4809-BC4B-BB6D418F4A84}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {CC96BF3E-0BDA-4809-BC4B-BB6D418F4A84}.Debug|Win32.ActiveCfg = Debug|Any CPU - {CC96BF3E-0BDA-4809-BC4B-BB6D418F4A84}.Debug|x64.ActiveCfg = Debug|Any CPU - {CC96BF3E-0BDA-4809-BC4B-BB6D418F4A84}.Debug|x86.ActiveCfg = Debug|Any CPU - {CC96BF3E-0BDA-4809-BC4B-BB6D418F4A84}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CC96BF3E-0BDA-4809-BC4B-BB6D418F4A84}.Release|Any CPU.Build.0 = Release|Any CPU - {CC96BF3E-0BDA-4809-BC4B-BB6D418F4A84}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {CC96BF3E-0BDA-4809-BC4B-BB6D418F4A84}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {CC96BF3E-0BDA-4809-BC4B-BB6D418F4A84}.Release|Win32.ActiveCfg = Release|Any CPU - {CC96BF3E-0BDA-4809-BC4B-BB6D418F4A84}.Release|x64.ActiveCfg = Release|Any CPU - {CC96BF3E-0BDA-4809-BC4B-BB6D418F4A84}.Release|x86.ActiveCfg = Release|Any CPU {C4D2573A-3FD3-441F-81AF-174AC4CD4E1D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {C4D2573A-3FD3-441F-81AF-174AC4CD4E1D}.Debug|Any CPU.Build.0 = Debug|Any CPU {C4D2573A-3FD3-441F-81AF-174AC4CD4E1D}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU diff --git a/Nuget/MediaBrowser.Common.Internal.nuspec b/Nuget/MediaBrowser.Common.Internal.nuspec index e3f8d15a1..e8a6fbedd 100644 --- a/Nuget/MediaBrowser.Common.Internal.nuspec +++ b/Nuget/MediaBrowser.Common.Internal.nuspec @@ -2,7 +2,7 @@ MediaBrowser.Common.Internal - 3.0.28 + 3.0.29 MediaBrowser.Common.Internal Luke ebr,Luke,scottisafool @@ -12,7 +12,7 @@ Contains common components shared by Media Browser Theatre and Media Browser Server. Not intended for plugin developer consumption. Copyright © Media Browser 2013 - + @@ -21,7 +21,6 @@ - diff --git a/Nuget/MediaBrowser.Common.nuspec b/Nuget/MediaBrowser.Common.nuspec index 725057b94..745c7076e 100644 --- a/Nuget/MediaBrowser.Common.nuspec +++ b/Nuget/MediaBrowser.Common.nuspec @@ -2,7 +2,7 @@ MediaBrowser.Common - 3.0.28 + 3.0.29 MediaBrowser.Common Media Browser Team ebr,Luke,scottisafool diff --git a/Nuget/MediaBrowser.Server.Core.nuspec b/Nuget/MediaBrowser.Server.Core.nuspec index ce4445203..8f82654c7 100644 --- a/Nuget/MediaBrowser.Server.Core.nuspec +++ b/Nuget/MediaBrowser.Server.Core.nuspec @@ -2,7 +2,7 @@ MediaBrowser.Server.Core - 3.0.28 + 3.0.29 Media Browser.Server.Core Media Browser Team ebr,Luke,scottisafool @@ -12,7 +12,7 @@ Contains core components required to build plugins for Media Browser Server. Copyright © Media Browser 2013 - +