[Splash > QuickStart] Simplify new updater code to use exe path, add reason logging
This commit is contained in:
parent
b5ad8d8fb1
commit
c90c4fe491
1 changed files with 4 additions and 5 deletions
|
@ -333,18 +333,17 @@ function initSplash(startMinimized = false) {
|
||||||
|
|
||||||
_ipcMain.default.on('UPDATED_QUOTES', (_event, quotes) => cacheLatestQuotes(quotes));
|
_ipcMain.default.on('UPDATED_QUOTES', (_event, quotes) => cacheLatestQuotes(quotes));
|
||||||
|
|
||||||
|
log('Splash', 'Quickstart config:', process.env.OPENASAR_QUICKSTART || oaConfig.quickstart, '-', process.env.OPENASAR_QUICKSTART, oaConfig.quickstart);
|
||||||
|
|
||||||
if (process.env.OPENASAR_QUICKSTART || oaConfig.quickstart) setTimeout(() => {
|
if (process.env.OPENASAR_QUICKSTART || oaConfig.quickstart) setTimeout(() => {
|
||||||
destroySplash();
|
destroySplash();
|
||||||
|
|
||||||
if (newUpdater != null) { // Manually load desktop_core module path for faster requiring
|
if (newUpdater != null) { // Manually load desktop_core module path for faster requiring
|
||||||
const NodeModule = require('module');
|
const NodeModule = require('module');
|
||||||
|
|
||||||
const installDir = paths.getInstallPath();
|
const modulesDir = _path.default.join(paths.getExeDir(), 'modules');
|
||||||
const appDir = _fs.default.readdirSync(installDir).find((x) => x.startsWith('app-1')); // Find app dir by name
|
|
||||||
|
|
||||||
const modulesDir = _path.default.join(installDir, appDir, 'modules');
|
|
||||||
|
|
||||||
const moduleCoreDir = _fs.default.readdirSync(modulesDir).find((x) => x.startsWith('discord_desktop_core-')); // Find desktop core dir by name
|
const moduleCoreDir = _fs.default.readdirSync(modulesDir).find((x) => x.startsWith('discord_desktop_core-')); // Find desktop core dir by name
|
||||||
|
|
||||||
NodeModule.globalPaths.push(_path.default.join(modulesDir, moduleCoreDir)); // Add to globalPaths for requiring
|
NodeModule.globalPaths.push(_path.default.join(modulesDir, moduleCoreDir)); // Add to globalPaths for requiring
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue