cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From purplecabb...@apache.org
Subject [1/2] git commit: CB-6732 [WP8] Fix "MSBuild 64 bit is not supported" build error
Date Fri, 23 May 2014 06:35:24 GMT
Repository: cordova-wp8
Updated Branches:
  refs/heads/master a31f822b0 -> 18ec1c3af


CB-6732 [WP8] Fix "MSBuild 64 bit is not supported" build error


Project: http://git-wip-us.apache.org/repos/asf/cordova-wp8/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-wp8/commit/14d13715
Tree: http://git-wip-us.apache.org/repos/asf/cordova-wp8/tree/14d13715
Diff: http://git-wip-us.apache.org/repos/asf/cordova-wp8/diff/14d13715

Branch: refs/heads/master
Commit: 14d13715f206c7125de06fe81c16659af6a3d1dc
Parents: a31f822
Author: sgrebnov <v-segreb@microsoft.com>
Authored: Thu May 22 09:53:58 2014 +0400
Committer: sgrebnov <v-segreb@microsoft.com>
Committed: Thu May 22 09:53:58 2014 +0400

----------------------------------------------------------------------
 wp8/template/cordova/lib/build.js | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/14d13715/wp8/template/cordova/lib/build.js
----------------------------------------------------------------------
diff --git a/wp8/template/cordova/lib/build.js b/wp8/template/cordova/lib/build.js
index 2039a41..b250762 100644
--- a/wp8/template/cordova/lib/build.js
+++ b/wp8/template/cordova/lib/build.js
@@ -20,6 +20,10 @@
 
 var fso = WScript.CreateObject('Scripting.FileSystemObject');
 var wscript_shell = WScript.CreateObject("WScript.Shell");
+var procEnv = wscript_shell.Environment("Process");
+// possible values and additional details: http://msdn.microsoft.com/en-us/library/aa384274.aspx
+var procArchitecture = procEnv("PROCESSOR_ARCHITECTURE").toLowerCase();
+var is64Mode = procArchitecture && procArchitecture != 'x86';
 
 var args = WScript.Arguments;
 
@@ -107,11 +111,14 @@ function get_solution_name(path) {
 
 // returns full path to msbuild tools required to build the project
 function getMSBuildToolsPath() {
+    // WP8 requires x86 version of MSBuild, CB-6732
+    var regRoot = is64Mode ? 'HKLM\\SOFTWARE\\Wow6432Node' : 'HKLM\\SOFTWARE';
+
     // use the latest version of the msbuild tools available on this machine
     var toolsVersions = ['12.0','4.0'];          // for WP8 we REQUIRE 4.0 !!!
     for (idx in toolsVersions) {
         try {
-            return wscript_shell.RegRead('HKLM\\SOFTWARE\\Microsoft\\MSBuild\\ToolsVersions\\'
+ toolsVersions[idx] + '\\MSBuildToolsPath');
+            return wscript_shell.RegRead(regRoot + '\\Microsoft\\MSBuild\\ToolsVersions\\'
+ toolsVersions[idx] + '\\MSBuildToolsPath');
         } catch (err) {
             Log("toolsVersion " + idx + " is not supported");
         }


Mime
View raw message