add.[ALL]
This commit is contained in:
parent
5ac24c8cea
commit
780ad9a200
54 changed files with 3733 additions and 0 deletions
39
.resources/app/app_bootstrap/index.js
Normal file
39
.resources/app/app_bootstrap/index.js
Normal file
|
@ -0,0 +1,39 @@
|
|||
"use strict";
|
||||
|
||||
const buildInfo = require('./buildInfo');
|
||||
const paths = require('../common/paths');
|
||||
paths.init(buildInfo);
|
||||
const moduleUpdater = require('../common/moduleUpdater');
|
||||
const updater = require('../common/updater');
|
||||
const requireNative = require('./requireNative');
|
||||
function getAppMode() {
|
||||
if (process.argv && process.argv.includes('--overlay-host')) {
|
||||
return 'overlay-host';
|
||||
}
|
||||
return 'app';
|
||||
}
|
||||
const mode = getAppMode();
|
||||
if (mode === 'app') {
|
||||
require('./bootstrap');
|
||||
} else if (mode === 'overlay-host') {
|
||||
// Initialize the update system just enough to find installed native modules.
|
||||
const appSettings = require('./appSettings');
|
||||
appSettings.init();
|
||||
const {
|
||||
NEW_UPDATE_ENDPOINT
|
||||
} = require('./Constants');
|
||||
if (buildInfo.newUpdater) {
|
||||
if (!updater.tryInitUpdater(buildInfo, NEW_UPDATE_ENDPOINT)) {
|
||||
throw new Error('Failed to initialize modules in overlay host.');
|
||||
}
|
||||
|
||||
// Load the module search path but if there's a pending host update, don't
|
||||
// restart into it.
|
||||
updater.getUpdater().startCurrentVersionSync({
|
||||
allowObsoleteHost: true
|
||||
});
|
||||
} else {
|
||||
moduleUpdater.initPathsOnly(buildInfo);
|
||||
}
|
||||
requireNative('discord_overlay2/standalone_host.js');
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue