Auto-start for Linux

This commit is contained in:
Scott E. Graves
2018-10-03 22:05:34 -05:00
parent b5171f2b1b
commit 4e5cf652c9

View File

@@ -48,10 +48,14 @@ function createWindow() {
mainWindow = null mainWindow = null
}); });
if (os.platform() === 'win32') { if ((os.platform() === 'win32') || (os.platform() === 'linux')) {
const appPath = (os.platform() === 'win32') ?
path.resolve(path.join(app.getAppPath(), '..\\..\\repertory-ui.exe')) :
process.env.APPIMAGE;
const autoLauncher = new AutoLaunch({ const autoLauncher = new AutoLaunch({
name: 'Repertory UI', name: 'Repertory UI',
path: path.resolve(path.join(app.getAppPath(), '..\\..\\repertory-ui.exe')), path: appPath,
}); });
const image = nativeImage.createFromPath(path.join(__dirname, '/build/logo.png')); const image = nativeImage.createFromPath(path.join(__dirname, '/build/logo.png'));
@@ -89,7 +93,8 @@ function createWindow() {
]); ]);
mainContextWindow.items[0].checked = true; mainContextWindow.items[0].checked = true;
autoLauncher.isEnabled() autoLauncher
.isEnabled()
.then((enabled) => { .then((enabled) => {
mainContextWindow.items[1].checked = enabled; mainContextWindow.items[1].checked = enabled;