bin/lib/check_reqs.js
function getInstalledVSVersions () {
    // Query all keys with Install value equal to 1, then filter out
    // those, which are not related to VS itself
    return spawn('reg', ['query', 'HKLM\\SOFTWARE\\Microsoft\\DevDiv\\vs\\Servicing', '/s', '/v', 'Install', '/f', '1', '/d', '/e', '/reg:32'])
        .fail(function () { return ''; })
        .then(function (output) {
            return output.split('\n')
                .reduce(function (installedVersions, line) {
                    var match = /(\d+\.\d+)\\(ultimate|professional|premium|community)/.exec(line);
                    if (match && match[1] && installedVersions.indexOf(match[1]) === -1) { installedVersions.push(match[1]); }
                    return installedVersions;
                }, []);
        }).then(function (installedVersions) {
            // If there is no VS2013 installed, the we have nothing to do
            if (installedVersions.indexOf('12.0') === -1) return installedVersions;

            // special case for VS 2013. We need to check if VS2013 update 2 is installed
            return spawn('reg', ['query', 'HKLM\\SOFTWARE\\Microsoft\\Updates\\Microsoft Visual Studio 2013\\vsupdate_KB2829760', '/v', 'PackageVersion', '/reg:32'])
                .then(function (output) {
                    var updateVer = Version.fromString(/PackageVersion\s+REG_SZ\s+(.*)/i.exec(output)[1]);
                    // if update version is lover than Update2, reject the promise
                    if (VS2013_UPDATE2_RC.gte(updateVer)) return Q.reject();
                    return installedVersions;
                }).fail(function () {
                    // if we got any errors on previous steps, we're assuming that
                    // required VS update is not installed.
                    installedVersions.splice(installedVersions.indexOf('12.0'), 1);
                    return installedVersions;
                });
        })
        .then(function (installedVersions) {
            var willowVersions = MSBuildTools.getWillowInstallations().map(function (installation) {
                return installation.version;
            });
            return installedVersions.concat(willowVersions);
        });
}
function getInstalledVSVersions () {
    // Query all keys with Install value equal to 1, then filter out
    // those, which are not related to VS itself
    return spawn('reg', ['query', 'HKLM\\SOFTWARE\\Microsoft\\DevDiv\\vs\\Servicing', '/s', '/v', 'Install', '/f', '1', '/d', '/e', '/reg:32'])
        .fail(function () { return ''; })
        .then(function (output) {
            return output.split('\n')
                .reduce(function (installedVersions, line) {
                    var match = /(\d+\.\d+)\\(ultimate|professional|premium|community)/.exec(line);
                    if (match && match[1] && installedVersions.indexOf(match[1]) === -1) { installedVersions.push(match[1]); }
                    return installedVersions;
                }, []);
        }).then(function (installedVersions) {
            // If there is no VS2013 installed, the we have nothing to do
            if (installedVersions.indexOf('12.0') === -1) return installedVersions;

            // special case for VS 2013. We need to check if VS2013 update 2 is installed
            return spawn('reg', ['query', 'HKLM\\SOFTWARE\\Microsoft\\Updates\\Microsoft Visual Studio 2013\\vsupdate_KB2829760', '/v', 'PackageVersion', '/reg:32'])
                .then(function (output) {
                    var updateVer = Version.fromString(/PackageVersion\s+REG_SZ\s+(.*)/i.exec(output)[1]);
                    // if update version is lover than Update2, reject the promise
                    if (VS2013_UPDATE2_RC.gte(updateVer)) return Q.reject();
                    return installedVersions;
                }).fail(function () {
                    // if we got any errors on previous steps, we're assuming that
                    // required VS update is not installed.
                    installedVersions.splice(installedVersions.indexOf('12.0'), 1);
                    return installedVersions;
                });
        })
        .then(function (installedVersions) {
            var willowVersions = MSBuildTools.getWillowInstallations().map(function (installation) {
                return installation.version;
            });
            return installedVersions.concat(willowVersions);
        });
}
function getInstalledVSVersions ( ) { // Query all keys with Install value equal to 1, then filter out // those, which are not related to VS itself return spawn ( 'reg' , [ 'query' , 'HKLM\\SOFTWARE\\Microsoft\\DevDiv\\vs\\Servicing' , '/s' , '/v' , 'Install' , '/f' , '1' , '/d' , '/e' , '/reg:32' ] ) . fail ( function ( ) { return '' ; } ) . then ( function ( output ) { return output . split ( '\n' ) . reduce ( function ( installedVersions , line ) { var match = / (\d+\.\d+)\\(ultimate|professional|premium|community) / . exec ( line ) ; if ( match && match [ 1 ] && installedVersions . indexOf ( match [ 1 ] ) === - 1 ) { installedVersions . push ( match [ 1 ] ) ; } return installedVersions ; } , [ ] ) ; } ) . then ( function ( installedVersions ) { // If there is no VS2013 installed, the we have nothing to do if ( installedVersions . indexOf ( '12.0' ) === - 1 ) return installedVersions ; // special case for VS 2013. We need to check if VS2013 update 2 is installed return spawn ( 'reg' , [ 'query' , 'HKLM\\SOFTWARE\\Microsoft\\Updates\\Microsoft Visual Studio 2013\\vsupdate_KB2829760' , '/v' , 'PackageVersion' , '/reg:32' ] ) . then ( function ( output ) { var updateVer = Version . fromString ( / PackageVersion\s+REG_SZ\s+(.*) / i . exec ( output ) [ 1 ] ) ; // if update version is lover than Update2, reject the promise if ( VS2013_UPDATE2_RC . gte ( updateVer ) ) return Q . reject ( ) ; return installedVersions ; } ) . fail ( function ( ) { // if we got any errors on previous steps, we're assuming that // required VS update is not installed. installedVersions . splice ( installedVersions . indexOf ( '12.0' ) , 1 ) ; return installedVersions ; } ) ; } ) . then ( function ( installedVersions ) { var willowVersions = MSBuildTools . getWillowInstallations ( ) . map ( function ( installation ) { return installation . version ; } ) ; return installedVersions . concat ( willowVersions ) ; } ) ; }
Lists all Visual Studio versions insalled. For VS 2013 if it present, also
checks if Update 2 is installed.

@return  {String[]}  List of installed Visual Studio versions.
Lists all Visual Studio versions insalled . For VS 2013 if it present also checks if Update 2 is installed .