summaryrefslogtreecommitdiff
path: root/src/mongo/installer
diff options
context:
space:
mode:
authorHenrik Edin <henrik.edin@mongodb.com>2019-01-17 15:21:59 -0500
committerHenrik Edin <henrik.edin@mongodb.com>2019-01-18 10:06:02 -0500
commit2eedcf859be1524f9dfd0b9ceda76985ae7f7a58 (patch)
treed749fdb0177f5ad1fd5675c8320b4e4d7278e114 /src/mongo/installer
parent5e4dd450fa2e3d2900cc4ac204385ab613c36cc5 (diff)
downloadmongo-2eedcf859be1524f9dfd0b9ceda76985ae7f7a58.tar.gz
SERVER-39072 Fallback to directory search if MergeModules are not located as expected according to the registry
Diffstat (limited to 'src/mongo/installer')
-rw-r--r--src/mongo/installer/msi/SConscript15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/mongo/installer/msi/SConscript b/src/mongo/installer/msi/SConscript
index 2da29682759..642f2b8e172 100644
--- a/src/mongo/installer/msi/SConscript
+++ b/src/mongo/installer/msi/SConscript
@@ -51,7 +51,20 @@ except WindowsError:
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")
+redist_root = os.path.join(vsinstall_path, "VC", "Redist", "MSVC")
+redist_path = os.path.join(redist_root, re.match("v(\d+\.\d+\.\d+)\.\d+", vslib_version).group(1))
+
+# Fallback to directory search if we don't find the expected version
+if not os.path.isdir(redist_path):
+ dirs = os.listdir(redist_root)
+ dirs.sort()
+ for dir in reversed(dirs):
+ candidate = os.path.join(redist_root, dir)
+ if os.path.isdir(candidate):
+ redist_path = candidate
+ break
+
+env['MERGEMODULESBASEPATH'] = os.path.join(redist_path, "MergeModules")
sourcesList = [ "BinaryFragment.wxs",
"FeatureFragment.wxs",