You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
1.1 KiB

const log = require('./utils/log');
global.log = log; // Make log global for easy usage everywhere
global.oaVersion = 'nightly';
log('Init', 'OpenAsar v' + oaVersion);
log('Init', 'Resources Path:', process.resourcesPath);
if (process.resourcesPath.startsWith('/usr/lib/electron')) { // Using system electron, fix process.resourcesPath
log('Init', 'Detected System Electron, fixing paths');
global.systemElectron = true;
const { join } = require('path');
process.resourcesPath = join(__dirname, '..');
log('Init', 'Resources Path:', process.resourcesPath);
}
const appSettings = require('./appSettings');
global.oaConfig = appSettings.getSettings().get('openasar', {});
log('Init', 'Loaded config', oaConfig);
require('./cmdSwitches')();
if (process.argv.includes('--overlay-host')) {
const buildInfo = require('./utils/buildInfo');
if (buildInfo.newUpdater) {
require('./utils/u2LoadModulePath')();
} else {
require('./updater/moduleUpdater').initPathsOnly(buildInfo);
}
require('discord_overlay2/standalone_host.js')
} else {
const bootstrap = require('./bootstrap');
bootstrap(); // Start bootstrap
}