diff --git a/src/autoStart/linux.js b/src/autoStart/linux.js index 785485d..6a2e933 100644 --- a/src/autoStart/linux.js +++ b/src/autoStart/linux.js @@ -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 diff --git a/src/index.js b/src/index.js index f0dba9b..41de9e6 100644 --- a/src/index.js +++ b/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', {});