2021-12-09 16:25:14 +00:00
|
|
|
const log = require('./utils/log');
|
2021-12-09 18:41:04 +00:00
|
|
|
global.log = log; // Make log global for easy usage everywhere
|
2021-12-11 20:09:43 +00:00
|
|
|
global.oaVersion = 'nightly';
|
2021-12-09 16:25:14 +00:00
|
|
|
|
2022-02-13 20:52:19 +00:00
|
|
|
log('Init', 'OpenAsar', oaVersion);
|
2021-12-09 19:27:06 +00:00
|
|
|
|
2022-02-13 21:30:05 +00:00
|
|
|
if (process.resourcesPath.startsWith('/usr/lib/electron')) global.systemElectron = true; // Using system electron, flag for other places
|
|
|
|
process.resourcesPath = require('path').join(__dirname, '..'); // Force resourcesPath for system electron
|
2021-12-22 19:06:57 +00:00
|
|
|
|
2022-02-15 13:40:43 +00:00
|
|
|
require('./paths').init();
|
2021-12-09 16:25:14 +00:00
|
|
|
|
2022-02-15 13:40:43 +00:00
|
|
|
global.oaConfig = require('./appSettings').getSettings().get('openasar', {});
|
2021-12-21 10:38:18 +00:00
|
|
|
require('./cmdSwitches')();
|
|
|
|
|
2022-02-13 21:30:05 +00:00
|
|
|
if (process.argv.includes('--overlay-host')) { // If overlay
|
|
|
|
require('./utils/u2LoadModulePath')(); // Manually load updater 2 module paths (all modules)
|
|
|
|
require('discord_overlay2/standalone_host.js'); // Start overlay
|
2021-12-12 14:41:15 +00:00
|
|
|
} else {
|
2022-02-13 20:52:19 +00:00
|
|
|
require('./bootstrap')(); // Start bootstrap
|
|
|
|
}
|