mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-06 03:26:07 +02:00
update 2015 c++ runtime detection
This commit is contained in:
parent
0e5cca8d07
commit
e318e2ab9f
1 changed files with 34 additions and 10 deletions
|
@ -770,19 +770,43 @@ namespace MediaBrowser.ServerApplication
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var subkey = Environment.Is64BitProcess
|
RegistryKey key;
|
||||||
? "SOFTWARE\\WOW6432Node\\Microsoft\\VisualStudio\\14.0\\VC\\Runtimes\\x64"
|
|
||||||
: "SOFTWARE\\Microsoft\\VisualStudio\\14.0\\VC\\Runtimes\\x86";
|
|
||||||
|
|
||||||
using (RegistryKey ndpKey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Default)
|
if (Environment.Is64BitProcess)
|
||||||
.OpenSubKey(subkey))
|
|
||||||
{
|
{
|
||||||
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');
|
key = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Default)
|
||||||
if (installedVersion.StartsWith("14", StringComparison.OrdinalIgnoreCase))
|
.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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue