protected override void OnClosing(CancelEventArgs e) { if (Factory.Games.IsDownloading()) { MessageBoxReturn mbr = NimbusMessageBox.AskQuestion("Nimbus is currently downloading, are you sure you wish to exit?", "Are you sure"); if (!mbr.clickedYes) { e.Cancel = true; } } if (!e.Cancel) { NativeMethods.AnimateWindow(this.Handle, 200, (int)NativeMethods.AnimateWindowFlags.AW_BLEND | (int)NativeMethods.AnimateWindowFlags.AW_HIDE); } base.OnClosing(e); }
private void RenewRegistry() { if (Factory.Settings.NeverTryRegKey) { return; } RegistryKey TestKey = Registry.ClassesRoot.OpenSubKey("Nimbus"); if (TestKey != null) { Console.WriteLine("Registry Key exists"); return; } else { Console.WriteLine("Registry Key doesn't exist! Attempting to set."); MessageBoxReturn mb = NimbusMessageBox.AskQuestion("The Nimbus registry key does not seem to be set. Would you like to set it now?", "Nimbus Registry Key"); if (mb.clickedYes) { Process myProcess = new Process(); ProcessStartInfo myProcessStartInfo = new ProcessStartInfo(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) + "\\RegistryUpdater.exe"); //myProcessStartInfo.UseShellExecute = true; //myProcessStartInfo.Verb = "runas"; myProcess.StartInfo = myProcessStartInfo; myProcess.Start(); myProcess.WaitForExit(); } Factory.Settings.NeverTryRegKey = mb.checkedBox; Factory.Settings.Save(); TestKey = Registry.ClassesRoot.OpenSubKey("Nexus"); if (TestKey != null) { Console.WriteLine("Success!"); } else { Console.WriteLine("FAILED!"); } } }