[General] Add system electron support fixes
This commit is contained in:
parent
e371d6b106
commit
7598051419
2 changed files with 12 additions and 1 deletions
|
@ -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
|
||||
|
|
11
src/index.js
11
src/index.js
|
@ -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…
Reference in a new issue