Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

This will look for Visual Studio in the Correct directory. #143479

Merged
merged 14 commits into from Feb 28, 2022
11 changes: 11 additions & 0 deletions build/npm/preinstall.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,17 @@ function hasSupportedVisualStudioVersion() {
break;
}
const programFiles86Path = process.env['ProgramFiles(x86)'];
const programFiles64Path = process.env['ProgramFiles'];

if (programFiles64Path) {
vsPath = `${programFiles64Path}/Microsoft Visual Studio/${version}`;
const vsTypes = ['Enterprise', 'Professional', 'Community', 'Preview', 'BuildTools'];
if (vsTypes.some(vsType => fs.existsSync(path.join(vsPath, vsType)))) {
availableVersions.push(version);
break;
}
}

if (programFiles86Path) {
vsPath = `${programFiles86Path}/Microsoft Visual Studio/${version}`;
const vsTypes = ['Enterprise', 'Professional', 'Community', 'Preview', 'BuildTools'];
Expand Down