message: refactor launch on startup
diff: @@ -71,7 +71,9 @@ function getUrlAndOpenMainWindow() {
  if (val === flag) {
  installMode = true;
  getConfigField('launchOnStartup')
  - .then(setStartup);
  + .then(setStartup)
  + .then(app.quit)
  + .catch(app.quit);
  }
  return false;
  @@ -83,30 +85,18 @@ function getUrlAndOpenMainWindow() {
  }
  function setStartup(lStartup){
  - if (lStartup === true) {
  - symphonyAutoLauncher.isEnabled()
  + return symphonyAutoLauncher.isEnabled()
  .then(function(isEnabled){
  - if (isEnabled) {
  - app.quit();
  + if (!isEnabled && lStartup) {
  + return symphonyAutoLauncher.enable();
  }
  - symphonyAutoLauncher.enable()
  - .then(function () {
  - app.quit();
  - });
  - })
  - } else {
  - symphonyAutoLauncher.isEnabled()
  - .then(function (isEnabled) {
  - if (isEnabled) {
  - symphonyAutoLauncher.disable()
  - .then(function () {
  - app.quit();
  - });
  - } else {
  - app.quit();
  - }
  - })
  +
  + if (isEnabled && !lStartup) {
  + return symphonyAutoLauncher.disable();
  }
  +
  + return true;
  + });
  }
  function openMainWindow() {
  