summaryrefslogtreecommitdiff
path: root/src/mongo/installer
diff options
context:
space:
mode:
authorAndrew Morrow <andrew.morrow@10gen.com>2019-12-08 01:30:07 +0000
committerevergreen <evergreen@mongodb.com>2019-12-08 01:30:07 +0000
commit7c428b6fba15eb2058d52430b8d2c5f4df45d7ad (patch)
tree093999b7fcc63cc9b185a51a315c428272240c95 /src/mongo/installer
parent72788deb99186ac2628604505147e68ac53cffc5 (diff)
downloadmongo-7c428b6fba15eb2058d52430b8d2c5f4df45d7ad.tar.gz
SERVER-44557 Set the default for MSVC_VERSION to VS2017
Diffstat (limited to 'src/mongo/installer')
-rw-r--r--src/mongo/installer/msi/SConscript37
-rw-r--r--src/mongo/installer/msi/wxs/BinaryFragment.wxs2
2 files changed, 5 insertions, 34 deletions
diff --git a/src/mongo/installer/msi/SConscript b/src/mongo/installer/msi/SConscript
index 099d29432c2..b8db8f409fa 100644
--- a/src/mongo/installer/msi/SConscript
+++ b/src/mongo/installer/msi/SConscript
@@ -32,40 +32,10 @@ env['WIXLIGHT'] = r'$WIXPATH\light.exe'
env['WIXUIEXT'] = r'$WIXPATH\WixUIExtension.dll'
env['WIXUTILEXT'] = r'$WIXPATH\WixUtilExtension.dll'
-# How to locate the Merge Modules path is described in https://docs.microsoft.com/en-us/cpp/ide/redistributing-visual-cpp-files?view=vs-2017
-
-# When we run this on evergreen, the environment is broken, fall back to hard coded C:\Program Files (x86)
-programfilesx86 = os.environ.get('ProgramFiles(x86)')
-if programfilesx86 is None:
- programfilesx86 = "C:\\Program Files (x86)"
-
-# Use vswhere (it has a fixed stable path) to query where Visual Studio is installed.
-vsinstall_path = subprocess.check_output([os.path.join(programfilesx86, "Microsoft Visual Studio", "Installer", "vswhere.exe"), "-version", "[15.0,16.0)", "-property", "installationPath", "-nologo"]).decode('utf-8').strip()
-
-# Check the registry key that has the runtime lib 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")
+if not 'VCREDISTMERGEMODULEPATH' in env['MSVS']:
+ print("SCons tool setup did not configure the path to the vcredist merge modules, disabling MSI installer")
Return()
-# Combine and set the full merge module path
-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",
"LicensingFragment.wxs",
@@ -154,7 +124,8 @@ env.Command(objects,
' -dBinarySource=' + buildDir + r'\mongo'
' -dToolBinarySource=' + toolBuildDir +
' -dEnterpriseToolBinarySource=' + enterpriseToolBuildDir +
- ' -dMergeModulesBasePath="$MERGEMODULESBASEPATH"'
+ ' -dMergeModulesBasePath=' + "\"${MSVS['VCREDISTMERGEMODULEPATH']}\"" +
+ ' -dMergeModuleFileCRT=' + env.GetMergeModuleNameForFeature('CRT') +
' -dEdition=' + msi_edition +
' -d"ProductId=*\"'
' -dUpgradeCode=' + upgrade_code +
diff --git a/src/mongo/installer/msi/wxs/BinaryFragment.wxs b/src/mongo/installer/msi/wxs/BinaryFragment.wxs
index 2a03699b614..06b0c8465dd 100644
--- a/src/mongo/installer/msi/wxs/BinaryFragment.wxs
+++ b/src/mongo/installer/msi/wxs/BinaryFragment.wxs
@@ -164,7 +164,7 @@
<?if $(var.Edition) = Enterprise or $(var.Edition) = SSL ?>
<DirectoryRef Id="TARGETDIR">
- <Merge Id="m_vcredist" SourceFile="$(var.MergeModulesBasePath)\Microsoft_VC141_CRT_x64.msm" DiskId="1" Language="0"/>
+ <Merge Id="m_vcredist" SourceFile="$(var.MergeModulesBasePath)\$(var.MergeModuleFileCRT)" DiskId="1" Language="0"/>
</DirectoryRef>
<?endif ?>