aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.ServerApplication/MainStartup.cs
diff options
context:
space:
mode:
authorLuke <luke.pulverenti@gmail.com>2017-07-23 02:12:16 -0400
committerGitHub <noreply@github.com>2017-07-23 02:12:16 -0400
commit5ec9d4e9fe4b3e5109ca1abf6c1ffdb87fd2d4dd (patch)
treee49cc827583b6dffeabb142af5fae889b1a09581 /MediaBrowser.ServerApplication/MainStartup.cs
parente99bc61d53f393dc475e265e3b5bc8c19b186594 (diff)
parent0d1b5ad733e6f1bbf6d730e723969495dda99016 (diff)
Merge pull request #2767 from MediaBrowser/beta
Beta
Diffstat (limited to 'MediaBrowser.ServerApplication/MainStartup.cs')
-rw-r--r--MediaBrowser.ServerApplication/MainStartup.cs44
1 files changed, 34 insertions, 10 deletions
diff --git a/MediaBrowser.ServerApplication/MainStartup.cs b/MediaBrowser.ServerApplication/MainStartup.cs
index 6b100b86d..bc38476ca 100644
--- a/MediaBrowser.ServerApplication/MainStartup.cs
+++ b/MediaBrowser.ServerApplication/MainStartup.cs
@@ -678,7 +678,7 @@ namespace MediaBrowser.ServerApplication
_logger.Info("Calling Application.Exit");
//Application.Exit();
-
+
Environment.Exit(0);
}
@@ -770,19 +770,43 @@ namespace MediaBrowser.ServerApplication
try
{
- var subkey = Environment.Is64BitProcess
- ? "SOFTWARE\\WOW6432Node\\Microsoft\\VisualStudio\\14.0\\VC\\Runtimes\\x64"
- : "SOFTWARE\\Microsoft\\VisualStudio\\14.0\\VC\\Runtimes\\x86";
+ RegistryKey key;
- using (RegistryKey ndpKey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Default)
- .OpenSubKey(subkey))
+ if (Environment.Is64BitProcess)
{
- if (ndpKey != null && ndpKey.GetValue("Version") != null)
+ key = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Default)
+ .OpenSubKey("SOFTWARE\\Classes\\Installer\\Dependencies\\{d992c12e-cab2-426f-bde3-fb8c53950b0d}");
+
+ if (key == null)
{
- var installedVersion = ((string)ndpKey.GetValue("Version")).TrimStart('v');
- if (installedVersion.StartsWith("14", StringComparison.OrdinalIgnoreCase))
+ key = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Default)
+ .OpenSubKey("SOFTWARE\\WOW6432Node\\Microsoft\\VisualStudio\\14.0\\VC\\Runtimes\\x64");
+ }
+ }
+ else
+ {
+ key = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Default)
+ .OpenSubKey("SOFTWARE\\Classes\\Installer\\Dependencies\\{e2803110-78b3-4664-a479-3611a381656a}");
+
+ if (key == null)
+ {
+ key = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Default)
+ .OpenSubKey("SOFTWARE\\Microsoft\\VisualStudio\\14.0\\VC\\Runtimes\\x86");
+ }
+ }
+
+ if (key != null)
+ {
+ using (key)
+ {
+ var version = key.GetValue("Version");
+ if (version != null)
{
- return;
+ var installedVersion = ((string)version).TrimStart('v');
+ if (installedVersion.StartsWith("14", StringComparison.OrdinalIgnoreCase))
+ {
+ return;
+ }
}
}
}