public bool StoreSettings() { ProcessesKiller.FindAndKillProcess(Constants.TrayApplicationProcessName); try { ProgramOptionsManager.ValidateOptions(_profileOptions); } catch (InvalidDataException exc) { Messages.ShowErrorBox(exc.Message); return(false); } catch (ArgumentNullException exc) { Messages.ShowErrorBox(exc.Message); return(false); } bool taskNeedScheduling = false; foreach (var pair in _profileOptions.BackupTasks) { if (pair.Value.EnableScheduling) { taskNeedScheduling = true; } } try { ProgramOptionsManager.StoreSettings(_profileOptions); ManageSchedulerStartup(taskNeedScheduling && (!_profileOptions.DontCareAboutSchedulerStartup)); } catch (Exception ee) { Messages.ShowErrorBox(ee.Message); return(false); } if (!_profileOptions.DontCareAboutSchedulerStartup) { if (taskNeedScheduling && !_profileOptions.DontNeedScheduler) { Process.Start(Files.Scheduler, SchedulerParameters.START_WITHOUT_MESSAGE); } } return(true); }
private void ValidateSettings() { try { ProgramOptionsManager.ValidateOptions(_options); } catch (InvalidDataException exc) { ShowErrorAndQuit(exc); } try { MD5Class.Verify7ZipBinaries(); } catch (InvalidSignException e) { // backup process is not breaked here // because this message should go in logs too // because this tool usually runned from scheduler Console.WriteLine(Translation.Current[541], e.Message); } }