Add support for VS2022 (#48)

Check $ProgramFiles too since that's where new stuff goes.
This commit is contained in:
Darrell Wright
2021-10-07 10:45:10 -04:00
committed by GitHub
parent f456b805b3
commit bb050e7771
+6 -2
View File
@@ -5,9 +5,11 @@ const path = require('path')
const process = require('process')
const PROGRAM_FILES_X86 = process.env['ProgramFiles(x86)']
const PROGRAM_FILES = [process.env['ProgramFiles(x86)'], process.env['ProgramFiles']]
const EDITIONS = ['Enterprise', 'Professional', 'Community']
const VERSIONS = ['2019', '2017']
const VERSIONS = ['2022', '2019', '2017']
const VSWHERE_PATH = `${PROGRAM_FILES_X86}\\Microsoft Visual Studio\\Installer`
@@ -32,9 +34,10 @@ function findVcvarsall() {
// If that does not work, try the standard installation locations,
// starting with the latest and moving to the oldest.
for (const prog_files of PROGRAM_FILES) {
for (const ver of VERSIONS) {
for (const ed of EDITIONS) {
path = `${PROGRAM_FILES_X86}\\Microsoft Visual Studio\\${ver}\\${ed}\\VC\\Auxiliary\\Build\\vcvarsall.bat`
path = `${prog_files}\\Microsoft Visual Studio\\${ver}\\${ed}\\VC\\Auxiliary\\Build\\vcvarsall.bat`
core.info(`Trying standard location: ${path}`)
if (fs.existsSync(path)) {
core.info(`Found standard location: ${path}`)
@@ -42,6 +45,7 @@ function findVcvarsall() {
}
}
}
}
core.info("Not found in standard locations")
// Special case for Visual Studio 2015 (and maybe earlier), try it out too.