[General] Add system electron support fixes

main
Oj 2 years ago
parent e371d6b106
commit 7598051419

@ -9,7 +9,7 @@ const desktopPath = path.join(autostartDir, (app.name ? app.name : app.getName()
// Vars for use in desktop file content template
const appName = path.basename(process.execPath, '.exe');
const exePath = app.getPath('exe');
const exePath = global.systemElectron ? '/usr/share/pixmaps/Discord' : app.getPath('exe');
const iconPath = path.join(path.dirname(exePath), 'discord.png');
// Template for desktop file

@ -4,6 +4,17 @@ 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', {});

Loading…
Cancel
Save