diff options
| author | stefan <stefan@hegedues.at> | 2018-09-12 19:26:21 +0200 |
|---|---|---|
| committer | stefan <stefan@hegedues.at> | 2018-09-12 19:26:21 +0200 |
| commit | 48facb797ed912e4ea6b04b17d1ff190ac2daac4 (patch) | |
| tree | 8dae77a31670a888d733484cb17dd4077d5444e8 /MediaBrowser.ServerApplication/Native/ServerAuthorization.cs | |
| parent | c32d8656382a0eacb301692e0084377fc433ae9b (diff) | |
Update to 3.5.2 and .net core 2.1
Diffstat (limited to 'MediaBrowser.ServerApplication/Native/ServerAuthorization.cs')
| -rw-r--r-- | MediaBrowser.ServerApplication/Native/ServerAuthorization.cs | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/MediaBrowser.ServerApplication/Native/ServerAuthorization.cs b/MediaBrowser.ServerApplication/Native/ServerAuthorization.cs deleted file mode 100644 index 70444ad9f..000000000 --- a/MediaBrowser.ServerApplication/Native/ServerAuthorization.cs +++ /dev/null @@ -1,54 +0,0 @@ -using System; -using System.Diagnostics; -using System.IO; -using System.Reflection; - -namespace MediaBrowser.ServerApplication.Native -{ - /// <summary> - /// Class Authorization - /// </summary> - public static class ServerAuthorization - { - /// <summary> - /// Authorizes the server. - /// </summary> - /// <param name="udpPort">The UDP port.</param> - /// <param name="httpServerPort">The HTTP server port.</param> - /// <param name="httpsServerPort">The HTTPS server port.</param> - /// <param name="tempDirectory">The temp directory.</param> - public static void AuthorizeServer(int udpPort, int httpServerPort, int httpsServerPort, string applicationPath, string tempDirectory) - { - Directory.CreateDirectory(tempDirectory); - - // Create a temp file path to extract the bat file to - var tmpFile = Path.Combine(tempDirectory, Guid.NewGuid() + ".bat"); - - // Extract the bat file - using (var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(typeof(ServerAuthorization).Namespace + ".RegisterServer.bat")) - { - using (var fileStream = File.Create(tmpFile)) - { - stream.CopyTo(fileStream); - } - } - - var startInfo = new ProcessStartInfo - { - FileName = tmpFile, - - Arguments = string.Format("{0} {1} {2} \"{3}\"", udpPort, httpServerPort, httpsServerPort, applicationPath), - - CreateNoWindow = true, - WindowStyle = ProcessWindowStyle.Hidden, - Verb = "runas", - ErrorDialog = false - }; - - using (var process = Process.Start(startInfo)) - { - process.WaitForExit(); - } - } - } -} |
