Add check for VC++ 2015–2022 Redistributable (#871)

* Add check for VC++ 2015-2022

* Remove Windows Vista

* Remove Windows Vista

* Add check for VC++ 2015-2022

* Add check for VC++ 2015-2022
This commit is contained in:
McSchneidar authored and GitHub committed 2026-05-02 06:17:00 +02:00
1 parent 09031fe79b
commit 48ffe4ccd5
3 files changed
+44 -36

No files matched your search

+2 -2
View File
@@ -23,10 +23,10 @@ Vocaluxe is an entirely new development in C#, inspired by the original UltraSta
and the great Ultrastar Deluxe project. and the great Ultrastar Deluxe project.
Supported Operating Systems / Requirements: Supported Operating Systems / Requirements:
- Windows Vista, Windows 7, Windows 8, Windows 10 or Windows 11 with .NET 4.0 - Windows 7, Windows 8, Windows 8.1, Windows 10 and Windows 11 with .NET 4.0
- Linux (no official support) - Linux (no official support)
- 1 GHz CPU, 512 MB RAM, Graphics card with OpenGL 2.1 or DirectX 9.0 support - 1 GHz CPU, 512 MB RAM, Graphics card with OpenGL 2.1 or DirectX 9.0 support
- Visual C++ Redistributable Package 2010 (2015-2022 is required for the nightly builds) - Visual C++ Redistributable Package 2010 (Nightly builds additionally require VC++ 2015–2022)
================================= =================================
+2 -2
View File
@@ -19,10 +19,10 @@ It features mouse, keyboard, gamepad and Wiimote navigation, a multi-language in
Vocaluxe offers diversified party modes and can optionally be controlled via a browser (desktop and mobile supported). Vocaluxe offers diversified party modes and can optionally be controlled via a browser (desktop and mobile supported).
Supported Operating Systems / Requirements: Supported Operating Systems / Requirements:
- Windows Vista, Windows 7, Windows 8, Windows 8.1, Windows 10 and Windows 11 with .NET 4.0 - Windows 7, Windows 8, Windows 8.1, Windows 10 and Windows 11 with .NET 4.0
- *Linux* (no official support) - *Linux* (no official support)
- 1 GHz CPU, 512 MB RAM, Graphics card with OpenGL 2.1 or DirectX 9.0 support - 1 GHz CPU, 512 MB RAM, Graphics card with OpenGL 2.1 or DirectX 9.0 support
- Visual C++ Redistributable Package 2010 (2015-2022 is required for the nightly builds) - Visual C++ Redistributable Package 2010 (Nightly builds additionally require VC++ 2015–2022)
## 2. Download ## 2. Download
+40 -32
View File
@@ -75,28 +75,46 @@ namespace Vocaluxe
return _CheckUninstallKey(name, baseKey + uninstallKey) || (_KeyExists(baseKey64) && _CheckUninstallKey(name, baseKey64 + uninstallKey)); return _CheckUninstallKey(name, baseKey + uninstallKey) || (_KeyExists(baseKey64) && _CheckUninstallKey(name, baseKey64 + uninstallKey));
} }
private static bool _SystemDllExists(string dllName)
{
const string sysDir = "%windir%\\system32\\";
return File.Exists(Environment.ExpandEnvironmentVariables(sysDir + dllName + ".dll"));
}
private static bool _IsVC2012Installed()
{
return _SystemDllExists("msvcr110") && _SystemDllExists("msvcp110");
}
private static bool _IsVC2008Installed()
{
return _IsProgramInstalled("Microsoft Visual C++ 2008 Redistributable");
}
private static bool _IsVC2010Installed() private static bool _IsVC2010Installed()
{ {
//Note: Maybe check for x64 or x86 //Note: Maybe check for x64 or x86
return _IsProgramInstalled("Microsoft Visual C++ 2010"); return _IsProgramInstalled("Microsoft Visual C++ 2010");
} }
private static bool _IsVC2015To2022Installed()
{
const string baseKey = @"SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\";
const string wow6432BaseKey = @"SOFTWARE\Wow6432Node\Microsoft\VisualStudio\14.0\VC\Runtimes\";
#if ARCH_X64
string[] arches = { "x64" };
#elif ARCH_X86
string[] arches = { "x86" };
#else
string[] arches = { "x86", "x64" };
#endif
foreach (string arch in arches)
{
using (RegistryKey rk = Registry.LocalMachine.OpenSubKey(baseKey + arch) ??
Registry.LocalMachine.OpenSubKey(wow6432BaseKey + arch))
{
if (rk == null)
continue;
object installed = rk.GetValue("Installed");
if (installed == null)
continue;
int installedValue;
if (int.TryParse(installed.ToString(), out installedValue) && installedValue == 1)
return true;
}
}
return false;
}
private static void _EnsureDataFolderExists() private static void _EnsureDataFolderExists()
{ {
if (!Directory.Exists(CSettings.DataFolder)) { if (!Directory.Exists(CSettings.DataFolder)) {
@@ -123,26 +141,16 @@ namespace Vocaluxe
"VC++ 2010 Redistributables are missing. Please install them first.\r\nDownload: https://www.microsoft.com/download/details.aspx?id=26999"); "VC++ 2010 Redistributables are missing. Please install them first.\r\nDownload: https://www.microsoft.com/download/details.aspx?id=26999");
return false; return false;
} }
/*
if (!_IsVC2012Installed()) if (!_IsVC2015To2022Installed())
{ {
CLog.Fatal( CLog.Fatal(
"VC++ 2012 Redistributables are missing. Please install them first.\r\nDownload: http://www.microsoft.com/de-de/download/details.aspx?id=30679"); "VC++ 2015-2022 Redistributables are missing. Please install them first.\r\n" +
"Download x64: https://aka.ms/vc14/vc_redist.x64.exe\r\n" +
"Download x86: https://aka.ms/vc14/vc_redist.x86.exe");
return false; return false;
} }
bool vc2008Installed = _IsVC2008Installed();
if (!vc2008Installed)
{
CLog.Fatal(
"VC++ 2008 Redistributables are missing. Portaudio might not be working.\r\nDownload: http://www.microsoft.com/de-de/download/details.aspx?id=29");
}
if (!vc2008Installed && !_IsVC2010Installed())
{
CLog.Fatal(
"VC++ 2010 and 2008 Redistributables are missing. Please install them first. VC++ 2008 is preferred as Portaudio doesn't work with VC++ 2010.\r\nDownload(2008): http://www.microsoft.com/de-de/download/details.aspx?id=29 \r\nDownload(2010): http://www.microsoft.com/de-de/download/details.aspx?id=5555");
return false;
}
*/
#endif //TODO: check for dependencies on linux? #endif //TODO: check for dependencies on linux?
return true; return true;
} }