diff options
| author | 7illusions <z@7illusions.com> | 2014-08-30 19:06:58 +0200 |
|---|---|---|
| committer | 7illusions <z@7illusions.com> | 2014-08-30 19:06:58 +0200 |
| commit | 66ad1699e22029b605e17735e8d9450285d8748a (patch) | |
| tree | ffc92c88d24850b2f82b6b3a8bdd904a2ccc77a5 /MediaBrowser.ServerApplication/Native | |
| parent | 34bc54263e886aae777a3537dc50a6535b51330a (diff) | |
| parent | 9d36f518182bc075c19d78084870f5115fa62d1e (diff) | |
Merge pull request #1 from MediaBrowser/master
Update to latest
Diffstat (limited to 'MediaBrowser.ServerApplication/Native')
4 files changed, 30 insertions, 25 deletions
diff --git a/MediaBrowser.ServerApplication/Native/BrowserLauncher.cs b/MediaBrowser.ServerApplication/Native/BrowserLauncher.cs index 77a543ad7f..c2c64ea4d4 100644 --- a/MediaBrowser.ServerApplication/Native/BrowserLauncher.cs +++ b/MediaBrowser.ServerApplication/Native/BrowserLauncher.cs @@ -25,7 +25,7 @@ namespace MediaBrowser.ServerApplication.Native public static void OpenDashboardPage(string page, User loggedInUser, IServerConfigurationManager configurationManager, IServerApplicationHost appHost, ILogger logger) { var url = "http://localhost:" + configurationManager.Configuration.HttpServerPortNumber + "/" + - appHost.WebApplicationName + "/dashboard/" + page; + appHost.WebApplicationName + "/web/" + page; OpenUrl(url, logger); } @@ -87,18 +87,6 @@ namespace MediaBrowser.ServerApplication.Native } /// <summary> - /// Opens the standard API documentation. - /// </summary> - /// <param name="configurationManager">The configuration manager.</param> - /// <param name="appHost">The app host.</param> - /// <param name="logger">The logger.</param> - public static void OpenStandardApiDocumentation(IServerConfigurationManager configurationManager, IServerApplicationHost appHost, ILogger logger) - { - OpenUrl("http://localhost:" + configurationManager.Configuration.HttpServerPortNumber + "/" + - appHost.WebApplicationName + "/metadata", logger); - } - - /// <summary> /// Opens the URL. /// </summary> /// <param name="url">The URL.</param> diff --git a/MediaBrowser.ServerApplication/Native/NativeApp.cs b/MediaBrowser.ServerApplication/Native/NativeApp.cs index 2388b610b7..0e7dc50a9f 100644 --- a/MediaBrowser.ServerApplication/Native/NativeApp.cs +++ b/MediaBrowser.ServerApplication/Native/NativeApp.cs @@ -1,4 +1,10 @@ -using System.Runtime.InteropServices; +using System; +using System.Runtime.InteropServices; +using System.Threading; +using System.Threading.Tasks; +using MediaBrowser.Common.Updates; +using MediaBrowser.Model.Logging; +using MediaBrowser.Model.Updates; namespace MediaBrowser.ServerApplication.Native { @@ -84,5 +90,24 @@ namespace MediaBrowser.ServerApplication.Native EXECUTION_STATE es = SetThreadExecutionState(EXECUTION_STATE.ES_SYSTEM_REQUIRED); } } + + public static async Task<CheckForUpdateResult> CheckForApplicationUpdate(Version currentVersion, + PackageVersionClass updateLevel, + IInstallationManager installationManager, + CancellationToken cancellationToken, + IProgress<double> progress) + { + var availablePackages = await installationManager.GetAvailablePackagesWithoutRegistrationInfo(cancellationToken).ConfigureAwait(false); + + var version = installationManager.GetLatestCompatibleVersion(availablePackages, "MBServer", null, currentVersion, updateLevel); + + var versionObject = version == null || string.IsNullOrWhiteSpace(version.versionStr) ? null : new Version(version.versionStr); + + var isUpdateAvailable = versionObject != null && versionObject > currentVersion; + + return versionObject != null ? + new CheckForUpdateResult { AvailableVersion = versionObject.ToString(), IsUpdateAvailable = isUpdateAvailable, Package = version } : + new CheckForUpdateResult { AvailableVersion = currentVersion.ToString(), IsUpdateAvailable = false }; + } } } diff --git a/MediaBrowser.ServerApplication/Native/RegisterServer.bat b/MediaBrowser.ServerApplication/Native/RegisterServer.bat index d762dfaf76..3504123444 100644 --- a/MediaBrowser.ServerApplication/Native/RegisterServer.bat +++ b/MediaBrowser.ServerApplication/Native/RegisterServer.bat @@ -1,7 +1,6 @@ rem %1 = http server port rem %2 = http server url rem %3 = udp server port -rem %4 = tcp server port (web socket) if [%1]==[] GOTO DONE @@ -18,11 +17,6 @@ if [%3]==[] GOTO DONE netsh advfirewall firewall delete rule name="Port %3" protocol=UDP localport=%3 netsh advfirewall firewall add rule name="Port %3" dir=in action=allow protocol=UDP localport=%3 -if [%4]==[] GOTO DONE - -netsh advfirewall firewall delete rule name="Port %4" protocol=TCP localport=%4 -netsh advfirewall firewall add rule name="Port %4" dir=in action=allow protocol=TCP localport=%4 - :DONE Exit
\ No newline at end of file diff --git a/MediaBrowser.ServerApplication/Native/ServerAuthorization.cs b/MediaBrowser.ServerApplication/Native/ServerAuthorization.cs index d2e5425367..e5989db3bf 100644 --- a/MediaBrowser.ServerApplication/Native/ServerAuthorization.cs +++ b/MediaBrowser.ServerApplication/Native/ServerAuthorization.cs @@ -15,10 +15,9 @@ namespace MediaBrowser.ServerApplication.Native /// </summary> /// <param name="httpServerPort">The HTTP server port.</param> /// <param name="httpServerUrlPrefix">The HTTP server URL prefix.</param> - /// <param name="webSocketPort">The web socket port.</param> /// <param name="udpPort">The UDP port.</param> /// <param name="tempDirectory">The temp directory.</param> - public static void AuthorizeServer(int httpServerPort, string httpServerUrlPrefix, int webSocketPort, int udpPort, string tempDirectory) + public static void AuthorizeServer(int httpServerPort, string httpServerUrlPrefix, int udpPort, string tempDirectory) { Directory.CreateDirectory(tempDirectory); @@ -38,10 +37,9 @@ namespace MediaBrowser.ServerApplication.Native { FileName = tmpFile, - Arguments = string.Format("{0} {1} {2} {3}", httpServerPort, + Arguments = string.Format("{0} {1} {2}", httpServerPort, httpServerUrlPrefix, - udpPort, - webSocketPort), + udpPort), CreateNoWindow = true, WindowStyle = ProcessWindowStyle.Hidden, |
