Skip to content

Commit

Permalink
updating install tools for Electron 32
Browse files Browse the repository at this point in the history
  • Loading branch information
agracio committed Sep 26, 2024
1 parent cba033b commit 75a68f6
Showing 1 changed file with 30 additions and 7 deletions.
37 changes: 30 additions & 7 deletions tools/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ var fs = require('fs')
, spawn = require('child_process').spawn
, whereis = require('./whereis');

if (process.platform === 'win32') {
if (process.platform === 'win322') {
var libroot = path.resolve(__dirname, '../lib/native/win32')
, lib32bit = path.resolve(libroot, 'ia32')
, lib64bit = path.resolve(libroot, 'x64')
Expand Down Expand Up @@ -136,14 +136,37 @@ else {
}
if (version !== null)
{
spawn('node-gyp', ['configure', '--target='+version, '--runtime=electron', '--disturl=https://electronjs.org/headers'], { stdio: 'inherit' });

const configure = spawn('node-gyp', ['configure', '--target='+version, '--runtime=electron', '--disturl=https://electronjs.org/headers', '--release'], { stdio: 'inherit' });
var files = ['build/build_managed.vcxproj','build/edge_coreclr.vcxproj', 'build/edge_nativeclr.vcxproj'];

const processPromises = files.map(file => {
const res = spawn('sed', ['-i', '-e', 's/std:c++17/std:c++20/g', file], { stdio: 'inherit' });

return new Promise((resolve, reject) => {
res.on("close", code => {
if (code === successCode) {
resolve(code)
} else {
reject(code)
}
});
});
});

// if(version.startsWith('32')){
// configure.on('close', (code) => {
// spawn('sed', ['-i', '-e', 's/std:c++17/std:c++20/g', 'build/build_managed.vcxproj'], { stdio: 'inherit' });
// spawn('sed', ['-i', '-e', 's/std:c++17/std:c++20/g', 'build/edge_coreclr.vcxproj'], { stdio: 'inherit' });
// spawn('sed', ['-i', '-e', 's/std:c++17/std:c++20/g', 'build/edge_nativeclr.vcxproj'], { stdio: 'inherit' });
// });
// }
if(version.startsWith('32')){
spawn("sed -i -e 's/std:c++17/std:c++20/g' build/build_managed.vcxproj", { stdio: 'inherit' });
spawn("sed -i -e 's/std:c++17/std:c++20/g' build/edge_coreclr.vcxproj", { stdio: 'inherit' });
spawn("sed -i -e 's/std:c++17/std:c++20/g' build/edge_nativeclr.vcxproj", { stdio: 'inherit' });

}else{
configure.on('close', (code) => {
spawn('node-gyp', ['build'], { stdio: 'inherit' });
});
}
spawn('node-gyp', ['build'], { stdio: 'inherit' });
}
else
spawn('node-gyp', ['configure', 'build'], { stdio: 'inherit' });
Expand Down

0 comments on commit 75a68f6

Please sign in to comment.