mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-15 12:53:51 +02:00
arm64 support
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const { getArchAndPlatform } = require('./utils');
|
||||
|
||||
function patchFile(filePath) {
|
||||
if (!fs.existsSync(filePath)) {
|
||||
@@ -30,25 +31,30 @@ managedHostPath = managedHostPath.indexOf('app.asar.unpacked') < 0 ?
|
||||
return false;
|
||||
}
|
||||
|
||||
// Paths to patch
|
||||
let platformName = '';
|
||||
switch (process.platform) {
|
||||
case 'win32':
|
||||
platformName = 'win';
|
||||
break;
|
||||
case 'darwin':
|
||||
platformName = 'mac';
|
||||
break;
|
||||
case 'linux':
|
||||
platformName = 'linux';
|
||||
break;
|
||||
function patchNodeApiDotNet(arch, platform) {
|
||||
let platformName = '';
|
||||
switch (platform) {
|
||||
case 'win32':
|
||||
platformName = 'win';
|
||||
break;
|
||||
case 'darwin':
|
||||
platformName = 'mac';
|
||||
break;
|
||||
case 'linux':
|
||||
platformName = 'linux';
|
||||
break;
|
||||
}
|
||||
if (arch === 'arm64') {
|
||||
platformName += '-arm64';
|
||||
}
|
||||
|
||||
const postBuildPath = path.join(
|
||||
__dirname,
|
||||
`./../build/${platformName}-unpacked/resources/app.asar.unpacked/node_modules/node-api-dotnet/init.js`
|
||||
);
|
||||
console.log('Patching post-build init.js...');
|
||||
patchFile(postBuildPath);
|
||||
}
|
||||
if (process.arch === 'arm64') {
|
||||
platformName += '-arm64';
|
||||
}
|
||||
const postBuildPath = path.join(
|
||||
__dirname,
|
||||
`./../build/${platformName}-unpacked/resources/app.asar.unpacked/node_modules/node-api-dotnet/init.js`
|
||||
);
|
||||
console.log('Patching post-build init.js...');
|
||||
patchFile(postBuildPath);
|
||||
|
||||
const { arch, platform } = getArchAndPlatform();
|
||||
patchNodeApiDotNet(arch, platform);
|
||||
|
||||
Reference in New Issue
Block a user