Skip to content

Commit

Permalink
updating install script
Browse files Browse the repository at this point in the history
  • Loading branch information
agracio committed Sep 15, 2024
1 parent 54684dc commit d672df6
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 19 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"url": "http://tomasz.janczuk.org",
"twitter": "tjanczuk"
},
"version": "31.3.0",
"version": "31.3.1",
"description": "Edge.js: run .NET and Node.js in-process on Electron",
"tags": [
"owin",
Expand Down
35 changes: 19 additions & 16 deletions tools/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ var fs = require('fs')
if (process.platform === 'win32') {
var libroot = path.resolve(__dirname, '../lib/native/win32')
, lib32bit = path.resolve(libroot, 'ia32')
, lib64bit = path.resolve(libroot, 'x64');
, lib64bit = path.resolve(libroot, 'x64')
, libarm64 = path.resolve(libroot, 'arm64');

function copyFile(filePath, filename) {
return function(copyToDir) {
Expand Down Expand Up @@ -39,10 +40,12 @@ if (process.platform === 'win32') {
return info.path;
}

var dest32dirs = fs.readdirSync(lib32bit)
.map(getInfo(lib32bit))
function getDestDirs(basedir){
return fs.readdirSync(basedir)
.map(getInfo(basedir))
.filter(isDirectory)
.map(getPath);
}

var redist = [
'concrt140.dll',
Expand All @@ -51,20 +54,20 @@ if (process.platform === 'win32') {
'vcruntime140.dll',
];

redist.forEach(function (dllname) {
var dll32bit = path.resolve(lib32bit, dllname);
dest32dirs.forEach(copyFile(dll32bit, dllname));
});

var dest64dirs = fs.readdirSync(lib64bit)
.map(getInfo(lib64bit))
.filter(isDirectory)
.map(getPath);
var dest32dirs = getDestDirs(lib32bit);
var dest64dirs = getDestDirs(lib64bit);
var destarmdirs = getDestDirs(libarm64);

function copyRedist(lib, destDirs){
redist.forEach(function (dllname) {
var dll = path.resolve(lib, dllname);
destDirs.forEach(copyFile(dll, dllname));
});
}

redist.forEach(function (dllname) {
var dll64bit = path.resolve(lib64bit, dllname);
dest64dirs.forEach(copyFile(dll64bit, dllname));
});
copyRedist(lib32bit, dest32dirs);
copyRedist(lib64bit, dest64dirs);
copyRedist(libarm64, destarmdirs);

var dotnetPath = whereis('dotnet', 'dotnet.exe');

Expand Down

0 comments on commit d672df6

Please sign in to comment.