mirror of
https://github.com/electron/node-gyp.git
synced 2025-08-16 21:18:20 +02:00
Merge pull request #300 from icosahedron/master
Handle when both VS2010 and VS2012 Express are installed
This commit is contained in:
commit
f28088a045
1 changed files with 20 additions and 1 deletions
|
@ -37,7 +37,9 @@ function configure (gyp, argv, callback) {
|
||||||
checkVCExpress(function () {
|
checkVCExpress(function () {
|
||||||
if (hasVCExpress || hasVC2012Express) {
|
if (hasVCExpress || hasVC2012Express) {
|
||||||
checkWinSDK(function () {
|
checkWinSDK(function () {
|
||||||
checkPython()
|
checkVSPrompt(function() {
|
||||||
|
checkPython()
|
||||||
|
})
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
checkPython()
|
checkPython()
|
||||||
|
@ -125,6 +127,22 @@ function configure (gyp, argv, callback) {
|
||||||
'You can pass the --python switch to point to Python >= v2.5.0 & < 3.0.0.'))
|
'You can pass the --python switch to point to Python >= v2.5.0 & < 3.0.0.'))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function checkVSPrompt(cb) {
|
||||||
|
// in the event that they have both installed, see if they are using a particular command prompt
|
||||||
|
if (hasVCExpress && hasVC2012Express) {
|
||||||
|
if (process.env["VisualStudioVersion"] === "11.0") {
|
||||||
|
// they are using the VS 2012 command prompt, unset the VS 2010 variables
|
||||||
|
hasVCExpress = false
|
||||||
|
hasWin71SDK = false
|
||||||
|
} else {
|
||||||
|
// otherwise, unset the VS 2012 variables
|
||||||
|
hasVC2012Express = false
|
||||||
|
hasWin8SDK = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
cb()
|
||||||
|
}
|
||||||
|
|
||||||
function checkWinSDK(cb) {
|
function checkWinSDK(cb) {
|
||||||
checkWin71SDK(function() {
|
checkWin71SDK(function() {
|
||||||
checkWin8SDK(cb)
|
checkWin8SDK(cb)
|
||||||
|
@ -202,6 +220,7 @@ function configure (gyp, argv, callback) {
|
||||||
function checkVCExpress(cb) {
|
function checkVCExpress(cb) {
|
||||||
spawn('reg', ['query', 'HKLM\\Software\\Microsoft\\VCExpress\\10.0\\Setup\\VC', '/v', 'ProductDir'])
|
spawn('reg', ['query', 'HKLM\\Software\\Microsoft\\VCExpress\\10.0\\Setup\\VC', '/v', 'ProductDir'])
|
||||||
.on('exit', function (code) {
|
.on('exit', function (code) {
|
||||||
|
hasVCExpress = (code === 0)
|
||||||
if (code !== 0) {
|
if (code !== 0) {
|
||||||
checkVCExpress64(cb)
|
checkVCExpress64(cb)
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue