summaryrefslogtreecommitdiff
path: root/src/mongo/installer/msi/SConscript
diff options
context:
space:
mode:
authorHenrik Edin <henrik.edin@mongodb.com>2018-12-13 10:42:51 -0500
committerHenrik Edin <henrik.edin@mongodb.com>2018-12-14 16:32:54 -0500
commit807c819591a0552b968672e284d4ec3bc84fa7de (patch)
tree21bd969ef6fb884829c740a99200cb0a8060337d /src/mongo/installer/msi/SConscript
parent65e8f8fa72108d96a5650b51503d96856a03b857 (diff)
downloadmongo-807c819591a0552b968672e284d4ec3bc84fa7de.tar.gz
SERVER-38593 Disable MSI installer if Visual Studio runtime is not found
Check without WOW6432Node which is the correct thing on 64bit.
Diffstat (limited to 'src/mongo/installer/msi/SConscript')
-rw-r--r--src/mongo/installer/msi/SConscript8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/mongo/installer/msi/SConscript b/src/mongo/installer/msi/SConscript
index 3380047bc4b..2da29682759 100644
--- a/src/mongo/installer/msi/SConscript
+++ b/src/mongo/installer/msi/SConscript
@@ -43,8 +43,12 @@ if programfilesx86 is None:
vsinstall_path = subprocess.check_output([os.path.join(programfilesx86, "Microsoft Visual Studio", "Installer", "vswhere.exe"), "-version", "[15.0,16.0)", "-property", "installationPath", "-nologo"]).strip()
# Check the registry key that has the runtime lib version
-vsruntime_key = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, "SOFTWARE\\WOW6432Node\\Microsoft\\VisualStudio\\14.0\\VC\\Runtimes\\x64")
-vslib_version,vslib_version_type = _winreg.QueryValueEx(vsruntime_key, "Version")
+try:
+ vsruntime_key = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\VisualStudio\\14.0\\VC\\Runtimes\\x64")
+ vslib_version,vslib_version_type = _winreg.QueryValueEx(vsruntime_key, "Version")
+except WindowsError:
+ print("Visual Studio Runtime not found in registry, disabling msi installer")
+ Return()
# Combine and set the full merge module path
env['MERGEMODULESBASEPATH'] = os.path.join(vsinstall_path, "VC", "Redist", "MSVC", re.match("v(\d+\.\d+\.\d+)\.\d+", vslib_version).group(1), "MergeModules")