forked from Mirrors/OpenAsar
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.
41 lines
1.2 KiB
41 lines
1.2 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 === '/usr/lib/electron/resources') { // 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')();
|
|
|
|
const appMode = process.argv?.includes('--overlay-host') ? 'overlay-host' : 'app';
|
|
|
|
if (appMode === 'overlay-host') {
|
|
const buildInfo = require('./utils/buildInfo');
|
|
|
|
if (buildInfo.newUpdater) {
|
|
require('./utils/u2LoadModulePath')();
|
|
} else {
|
|
require('./updater/moduleUpdater').initPathsOnly(buildInfo);
|
|
}
|
|
|
|
require('./utils/requireNative')('discord_overlay2/standalone_host.js')
|
|
} else {
|
|
const bootstrap = require('./bootstrap');
|
|
|
|
bootstrap(); // Start bootstrap
|
|
} |