Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Electron-26 (Auto Launch for Mac) #109

Merged
merged 4 commits into from
May 31, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const squirrelStartup = require('electron-squirrel-startup');
const AutoLaunch = require('auto-launch');
const urlParser = require('url');
const { getConfigField } = require('./config.js');
const { isDevEnv} = require('./utils/misc.js');
const { isMac, isDevEnv } = require('./utils/misc.js');
const protocolHandler = require('./protocolHandler');

// used to check if a url was opened when the app was already open
Expand Down Expand Up @@ -46,7 +46,7 @@ if (shouldQuit) {

var symphonyAutoLauncher = new AutoLaunch({
name: 'Symphony',
path: process.execPath,
path: isMac ? '/Applications/' + app.getName() + '.app' : process.execPath,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we are relying on app being installed is this exact location - which it will but in case it is put elsewhere - couldn't you instead use app.getPath('exe') and figure out from there?

Copy link
Member Author

@KiranNiranjan KiranNiranjan May 25, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By doing that i was facing this issue. Auto launcher verifies the path and if it fails to locate, it will defaults to the exe path.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about this..
var appPath = app.getPath('exe').split('.app/Content')[0] + '.app';
appLauncher = new AutoLaunch({
name: app.getName(),
path: appPath,
});

});

/**
Expand Down