Commit 68bc9fcb authored by Brad King's avatar Brad King 💬
Browse files

Merge branch 'vs2017-skip-2019' into release-3.13

Merge-request: !2775
parents 9bbfbd54 d44f81c2
......@@ -295,6 +295,9 @@ bool cmVSSetupAPIHelper::EnumerateAndChooseVSInstance()
return false;
}
// FIXME: Add a way for caller to specify other versions.
std::wstring wantVersion = std::to_wstring(15) + L'.';
SmartCOMPtr<ISetupInstance> instance;
while (SUCCEEDED(enumInstances->Next(1, &instance, NULL)) && instance) {
SmartCOMPtr<ISetupInstance2> instance2 = NULL;
......@@ -310,6 +313,12 @@ bool cmVSSetupAPIHelper::EnumerateAndChooseVSInstance()
instance = instance2 = NULL;
if (isInstalled) {
// We are looking for a specific major version.
if (instanceInfo.Version.size() < wantVersion.size() ||
instanceInfo.Version.substr(0, wantVersion.size()) != wantVersion) {
continue;
}
if (!this->SpecifiedVSInstallLocation.empty()) {
// We are looking for a specific instance.
std::string currentVSLocation = instanceInfo.GetInstallLocation();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment