コード例 #1
0
 private void BothDriverStatus_Click(object sender, EventArgs e)
 {
     if (!Is32BitMatch || !Is64BitMatch || IsNewVerAvailable)
     {
         UpdateSystem.CheckForUpdates(false, false, false);
     }
 }
コード例 #2
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());
        }
コード例 #3
0
 private void CFU_Click(object sender, EventArgs e)
 {
     if (Control.ModifierKeys == Keys.Shift)
     {
         UpdateSystem.CheckForUpdates(true, false, false);
     }
     else
     {
         UpdateSystem.CheckForUpdates(false, false, false);
     }
 }
コード例 #4
0
        private void InfoDialog_Load(object sender, EventArgs e)
        {
            if (!KeppySynthConfiguratorMain.IsInternetAvailable)
            {
                CFU.Visible = false;
            }

            ComputerInfo CI      = new ComputerInfo();
            String       Version = String.Format("{0}.{1}.{2}", Driver.FileMajorPart, Driver.FileMinorPart, Driver.FileBuildPart);

            VerLabel.Text       = String.Format("Keppy's Synthesizer {0}\n\nCopyright Ⓒ 2011\nKaleidonKep99, Kode54 && Mudlord", Version, DateTime.Now.Year.ToString());
            DriverVer.Text      = ReturnDriverAssemblyVersion(Version, Driver.FilePrivatePart);
            BASSVer.Text        = ReturnBASSAssemblyVersion(BASS.FileVersion, BASS.FilePrivatePart);
            BASSMIDIVer.Text    = ReturnBASSAssemblyVersion(BASSMIDI.FileVersion, BASSMIDI.FilePrivatePart);
            CompiledOn.Text     = GetLinkerTime(Assembly.GetExecutingAssembly(), TimeZoneInfo.Utc).ToString();
            CurBranch.Text      = UpdateSystem.GetCurrentBranch();
            CurBranch.ForeColor = UpdateSystem.GetCurrentBranchColor();
            BranchToolTip.SetToolTip(CurBranch, UpdateSystem.GetCurrentBranchToolTip());

            OSInfo.OSVERSIONINFOEX osVersionInfo = new OSInfo.OSVERSIONINFOEX();
            osVersionInfo.dwOSVersionInfoSize = Marshal.SizeOf(typeof(OSInfo.OSVERSIONINFOEX));

            if (Properties.Settings.Default.IsItPreRelease)
            {
                DriverVer.Text += " (Pre-release build)";
            }

            WinName.Text = String.Format("{0} ({1})", OSInfo.Name, Environment.Is64BitOperatingSystem ? "64-bit" : "32-bit");

            if (Environment.OSVersion.Version.Major == 10) // If OS is Windows 10, get UBR too
            {
                WinVer.Text = String.Format("{0}.{1}.{2} (Update Build Revision {3})",
                                            Environment.OSVersion.Version.Major, Environment.OSVersion.Version.Minor,
                                            Environment.OSVersion.Version.Build, CurrentVerKey.GetValue("UBR", 0).ToString());
            }
            else // Else, give normal version number
            {
                if (Environment.OSVersion.Version.Major == 6 && Environment.OSVersion.Version.Minor <= 1)
                {
                    WinVer.Text = String.Format("{0}.{1}.{2} ({3})",
                                                Environment.OSVersion.Version.Major, Environment.OSVersion.Version.Minor,
                                                Environment.OSVersion.Version.Build, Environment.OSVersion.ServicePack);
                }
                else
                {
                    WinVer.Text = String.Format("{0}.{1}.{2} (Metro)",
                                                Environment.OSVersion.Version.Major, Environment.OSVersion.Version.Minor,
                                                Environment.OSVersion.Version.Build);
                }
            }

            CheckDateLogo();
        }
コード例 #5
0
 public static void ExecuteForm(Int32 runmode, String[] args, Mutex m, Int32 form)
 {
     if (runmode == 0)
     {
         UpdateSystem.CheckForUpdates(false, true);
     }
     Application.EnableVisualStyles();
     if (form == 0)
     {
         Application.Run(new KeppySynthConfiguratorMain(args));
     }
     else if (form == 1)
     {
         Application.Run(new InfoDialog(1));
     }
     GC.KeepAlive(m);
 }
コード例 #6
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());
     }
 }