Skip to content

Commit

Permalink
This will look for Visual Studio in the Correct directory. (#143479)
Browse files Browse the repository at this point in the history
* Specified the address of 'Microsoft Visual Studio' depending upon the system architect

* Changed preinstall to look for Visual Studio in the correct directory

* Updated preinstall.js to look for VS in the correct directory
  • Loading branch information
Rounak singh authored Feb 28, 2022
1 parent 6a74402 commit d35ee52
Showing 1 changed file with 11 additions and 0 deletions.
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

0 comments on commit d35ee52

Please sign in to comment.