private void Application_Startup(object sender, StartupEventArgs e) { ExceptionlessClient.Default.Configuration.DefaultData.Add("Locale", Thread.CurrentThread.CurrentUICulture.Name); ExceptionlessClient.Default.Startup(Settings.Default.ExceptionlessKey); Parser.Default.ParseArguments <CommandLineOptions>(e.Args).WithParsed(o => CurrentOptions = o); if (string.IsNullOrEmpty(CurrentOptions.Path)) { CurrentOptions.Path = Environment.CurrentDirectory; } UpdaterSettings = UpdaterSettings.Load(CurrentOptions.Path ?? Environment.CurrentDirectory); Exit += (s, ea) => UpdaterSettings.Save(UpdaterSettings, CurrentOptions.Path ?? Environment.CurrentDirectory); if (CurrentOptions.CurrentVersion != null) { return; } string dllPath = IOPath.Combine(CurrentOptions.Path, "ClassicAssist.dll"); try { CurrentOptions.CurrentVersion = VersionHelpers.GetProductVersion(dllPath).ToString(); } catch (Exception) { CurrentOptions.Force = true; } }
/// <summary> /// Saves the updater settings. /// </summary> /// <param name="showConfirmationDialogue">if set to <c>true</c> [show confirmation dialogue].</param> public void SaveUpdaterSettings(bool showConfirmationDialogue = true) { if (showConfirmationDialogue) { DialogResult result = KryptonMessageBox.Show("Do you want to save the current values?", "Save Current Settings", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2); if (result == DialogResult.Yes) { updaterSettings.Save(); } } else { updaterSettings.Save(); } }