From 4955f5f8cf370816ea266656e3398954306ee182 Mon Sep 17 00:00:00 2001 From: Oj Date: Sun, 13 Feb 2022 21:30:05 +0000 Subject: [PATCH] [Index] Simplify system electron and overlay source --- src/index.js | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/src/index.js b/src/index.js index b6003e9..78ee0f9 100644 --- a/src/index.js +++ b/src/index.js @@ -4,15 +4,8 @@ global.oaVersion = 'nightly'; log('Init', 'OpenAsar', 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; - - process.resourcesPath = require('path').join(__dirname, '..'); - - log('Init', 'Resources Path:', process.resourcesPath); -} +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 const appSettings = require('./appSettings'); global.oaConfig = appSettings.getSettings().get('openasar', {}); @@ -21,16 +14,9 @@ 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'); +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 } else { require('./bootstrap')(); // Start bootstrap } \ No newline at end of file