/** * Returns whether Microsoft Visual C++ 2012 Redistributable Package is * installed. * * @return */ public static boolean isWindowsVCRedist2012Installed() { if (SystemUtil.getOsName() != OsName.WINDOWS) { throw new UnreachableException(); } try { if (Platform.is64Bit()) { return Advapi32Util.registryGetIntValue( Advapi32Util.registryGetKey( WinReg.HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\VisualStudio\\11.0\\VC\\Runtimes\\x64", WinNT.KEY_READ | WinNT.KEY_WOW64_32KEY).getValue(), "Installed") == 1; } else { return Advapi32Util.registryGetIntValue( WinReg.HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\VisualStudio\\11.0\\VC\\Runtimes\\x86", "Installed") == 1; } } catch (Win32Exception e) { logger.error("Failed to read windows registry", e); return false; } }
phkResult = Advapi32Util.registryGetKey(WinReg.HKEY_CLASSES_ROOT, "CLSID", WinNT.KEY_ALL_ACCESS); phkResult2 = Advapi32Util.registryGetKey(phkResult.getValue(), subKey, WinNT.KEY_ALL_ACCESS); InfoKey infoKey2 = Advapi32Util.registryQueryInfoKey(phkResult2.getValue(), WinNT.KEY_ALL_ACCESS);
phkResult = Advapi32Util.registryGetKey(WinReg.HKEY_CLASSES_ROOT, "CLSID", WinNT.KEY_READ); phkResult2 = Advapi32Util.registryGetKey(phkResult.getValue(), subKey, WinNT.KEY_READ); InfoKey infoKey2 = Advapi32Util.registryQueryInfoKey(