You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ja...@apache.org on 2018/02/27 12:43:40 UTC
[cordova-windows] 22/26: comments and changes regarding Visual
Studio and UAP
This is an automated email from the ASF dual-hosted git repository.
janpio pushed a commit to branch janpio-win10only
in repository https://gitbox.apache.org/repos/asf/cordova-windows.git
commit 376e007cd7de1380630f539e14c3a234471c2b77
Author: Jan Piotrowski <pi...@gmail.com>
AuthorDate: Fri Feb 16 13:53:39 2018 +0100
comments and changes regarding Visual Studio and UAP
---
bin/lib/check_reqs.js | 15 +++++++++------
template/cordova/lib/MSBuildTools.js | 3 +++
2 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/bin/lib/check_reqs.js b/bin/lib/check_reqs.js
index 14702bf..aca562b 100644
--- a/bin/lib/check_reqs.js
+++ b/bin/lib/check_reqs.js
@@ -119,6 +119,7 @@ function getWindowsVersion () {
function getInstalledVSVersions () {
// Query all keys with Install value equal to 1, then filter out
// those, which are not related to VS itself
+ // TODO Move to VisualStudio.js (a la MSBuildTools.js)
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) {
@@ -132,11 +133,11 @@ function getInstalledVSVersions () {
// 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
+ // special case for VS 2013. We need to check if at least 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 update version is lower than Update2, reject the promise
if (VS2013_UPDATE2_RC.gte(updateVer)) return Q.reject();
return installedVersions;
}).fail(function () {
@@ -147,6 +148,7 @@ function getInstalledVSVersions () {
});
})
.then(function (installedVersions) {
+ // Visual Studio 2017+
var willowVersions = MSBuildTools.getWillowInstallations().map(function (installation) {
return installation.version;
});
@@ -217,9 +219,10 @@ function mapWindowsVersionToName (version) {
function mapVSVersionToName (version) {
var map = {
- '11.0': '2012 Express for Windows',
- '12.0': '2013 Express for Windows Update2',
- '14.0': '2015 Community'
+ '11.0': '2012 Express for Windows (11.0)',
+ '12.0': '2013 Express for Windows Update2 (12.0)',
+ '14.0': '2015 Community (14.0)',
+ '15.5': '2017 Community (15.5)'
};
var majorMinor = shortenVersion(version);
return map[majorMinor];
@@ -284,7 +287,7 @@ var checkVS = function (windowsTargetVersion, windowsPhoneTargetVersion) {
.then(function (installedVersions) {
var appropriateVersion = getHighestAppropriateVersion(installedVersions, vsRequiredVersion);
return appropriateVersion
- ? shortenVersion(appropriateVersion)
+ ? mapVSVersionToName(shortenVersion(appropriateVersion))
: Q.reject('Required version of Visual Studio not found. Please install Visual Studio ' +
mapVSVersionToName(vsRequiredVersion) +
' or higher from https://www.visualstudio.com/downloads/download-visual-studio-vs');
diff --git a/template/cordova/lib/MSBuildTools.js b/template/cordova/lib/MSBuildTools.js
index 098d2dc..ed8617f 100644
--- a/template/cordova/lib/MSBuildTools.js
+++ b/template/cordova/lib/MSBuildTools.js
@@ -297,6 +297,8 @@ function filterSupportedTargets (targets, msbuild) {
return supportedTargets;
}
+// TODO Move will methods to own VisualStudio.js file as it has nothing to do with MSBuildTools
+
/**
* Lists all VS 2017+ instances dirs in ProgramData
*
@@ -347,6 +349,7 @@ module.exports.getWillowInstallations = function () {
return installations;
};
+// TODO move wherever it is used and makes sense
// returns an array of available UAP Versions
// prepare.js
module.exports.getAvailableUAPVersions = function () {
--
To stop receiving notification emails like this one, please contact
janpio@apache.org.
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org