private void wizardPageOptions_Commit(object sender, AeroWizard.WizardPageConfirmEventArgs e) { Cursor = Cursors.WaitCursor; try { engine.BootMenuEntryName = optionsBootMenuEntry.Text; engine.DestinationFileName = optionsFileName.Text; engine.EfiUsed = optionsEFI.Checked; engine.Build(); engine.Dispose(); engine = null; } #if !DEBUG catch (Exception ex) { MessageBox.Show(ex.ToString()); e.Cancel = true; return; } #endif finally { Cursor = Cursors.Default; } if (MessageBox.Show("Recovery drive created.\r\nDo you want to add another image to this recovery drive?", "Recovery Drive Builder Plus", MessageBoxButtons.YesNo, MessageBoxIcon.Information, MessageBoxDefaultButton.Button2) == DialogResult.Yes) { e.Cancel = true; wizardControl.NextPage(wizardPageBootStyle, true); } }
private void wizardPageBootStyle_Initialize(object sender, AeroWizard.WizardPageInitEventArgs e) { if (e.PreviousPage == wizardPageDriveSelect || e.PreviousPage == wizardPageOptions) { try { DriveItem drive = (DriveItem)driveSelect.SelectedItem; if (drive == null) { throw new Exception("No drive selected"); } if (engine != null) { engine.Dispose(); engine = null; } engine = new BuildEngine(drive.DriveInfo); if (engine.BootloaderPresent) { bootStatusLabel.Text = "Existing bootloader found on " + drive.DriveInfo.Name; actionNewMenu.Enabled = actionKeepAll.Enabled = true; } else { bootStatusLabel.Text = "No bootloader found on " + drive.DriveInfo.Name; actionNewMenu.Enabled = actionKeepAll.Enabled = false; } bootFilesDeeperLocationCheckbox.Enabled = !engine.SkipLocationSelection; bootFilesDeeperLocationCheckbox.Checked = engine.UseDeeperLocation; if (!engine.BootloaderPresent && engine.SkipLocationSelection) { wizardControl.NextPage(); } } #if !DEBUG catch (Exception ex) { MessageBox.Show(ex.ToString()); wizardControl.PreviousPage(); } #endif finally { } } else if (e.PreviousPage == wizardPageSelectSource && !bootFilesDeeperLocationCheckbox.Enabled && !actionKeepAll.Enabled) { wizardControl.PreviousPage(); } }