示例#1
0
        private void App_OnStartup(object sender, StartupEventArgs e)
        {
            var efis   = DiskScanner.FindInstalledEfis().ToList();
            var target = FindTarget(efis);

            if (efis.Count == 0)
            {
                BootMessageBox.Show("BootNext not installed",
                                    "BootNext is not installed yet. You will be taken to the settings dialog.");
            }
            else if (target == null)
            {
                BootMessageBox.Show("Multiple instances found",
                                    "Multiple BootNext instances found. Please select the one you want to use.");
            }

            if (target == null)
            {
                var settings = new SettingsWindow();
                settings.Show();
            }
            else
            {
                Settings.Default.PreferredEFI = target.Guid;
                Settings.Default.Save();

                var bootDir = DiskScanner.GetBootNextDir(target) !;
                var window  = new MainWindow(bootDir);
                window.Show();
            }
        }
示例#2
0
 private Partition?FindTarget()
 {
     return(FindTarget(DiskScanner.FindInstalledEfis().ToList()));
 }