Example #1
0
        private void ChangeBranch_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            SelectBranch frm = new SelectBranch();

            frm.ShowDialog();
            frm.Dispose();
            CurBranch.Text      = UpdateSystem.GetCurrentBranch();
            CurBranch.ForeColor = UpdateSystem.GetCurrentBranchColor();
            BranchToolTip.SetToolTip(CurBranch, UpdateSystem.GetCurrentBranchToolTip());
        }
Example #2
0
 static void DoAnyway(String[] args)
 {
     try
     {
         DebugToConsole(false, "Started configurator.", null);
         Application.SetCompatibleTextRenderingDefault(false);
         if (!Functions.IsWindowsVistaOrNewer())
         {
             Functions.ShowErrorDialog(1, System.Media.SystemSounds.Hand, "Fatal error", "Windows XP is not supported.", true, null);
             Application.ExitThread();
         }
         int  runmode = 0;
         int  window  = 0;
         bool ok;
         BringToFrontMessage = WinAPI.RegisterWindowMessage("KeppySynthConfiguratorToFront");
         Mutex m = new Mutex(true, "KeppySynthConfigurator", out ok);
         if (!ok)
         {
             WinAPI.PostMessage((IntPtr)WinAPI.HWND_BROADCAST, BringToFrontMessage, IntPtr.Zero, IntPtr.Zero);
             return;
         }
         TriggerDate();
         try
         {
             foreach (String s in args)
             {
                 if (s.ToLowerInvariant() == "/asp")
                 {
                     Functions.UserProfileMigration();
                     return;
                 }
                 if (s.ToLowerInvariant() == "/virtualmidisynth" ||
                     s.ToLowerInvariant() == "/vms")
                 {
                     Process.Start("https://www.youtube.com/watch?v=hR2iRL173KI");
                     return;
                 }
                 else if (s.ToLowerInvariant() == "/rei")
                 {
                     RegistryKey sourceKey = Registry.CurrentUser.OpenSubKey("SOFTWARE", true);
                     sourceKey.DeleteSubKeyTree("Keppy's Synthesizer", true);
                     sourceKey.Close();
                     UpdateSystem.CheckForUpdates(true, true, false);
                     return;
                 }
                 else if (s.ToLowerInvariant() == "/inf")
                 {
                     runmode = 2;
                     window  = 1;
                     break;
                 }
                 else
                 {
                     runmode = 0;
                     window  = 0;
                     break;
                 }
             }
             if (Properties.Settings.Default.UpdateBranch == "choose")
             {
                 MessageBox.Show("The driver's update system is divided into three branches. For future update notifications, you can pick between the following branches, which are the Canary Branch, the Normal Branch, and the Delayed Branch. These preferences can be changed at any time.\n\nCanary Branch: all updates\nNormal Branch: occasional updates (default, recommended)\nDelayed Branch: very infrequent updates (not recommended)\n\nClick OK to choose a branch.", "Keppy's Synthesizer - New update branches", MessageBoxButtons.OK, MessageBoxIcon.Information);
                 SelectBranch frm = new SelectBranch();
                 frm.ShowInTaskbar = true;
                 frm.StartPosition = FormStartPosition.CenterScreen;
                 frm.ShowDialog();
                 frm.Dispose();
             }
             ExecuteForm(runmode, args, m, window);
         }
         catch
         {
             Application.EnableVisualStyles();
             Application.Run(new KeppySynthConfiguratorMain(args));
             GC.KeepAlive(m);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
 }