Exemplo n.º 1
0
        private void launchgeniso(bool usb)
        {
            Form ask = null;

            if (usb)
            {
                var fs =
                    new[] { "NTFS", "FAT32", "FAT16", "FAT12" }.AddRecommended(CurImages.Any(x => x.SizeB >= uint.MaxValue)
                        ? 0
                        : 1);
                ask = new USBFrm(Strings.CreateMultibootUsb, Strings.Filesystem, Strings.OK, true, fs);
            }
            else
            {
                ask = new AskPath();
            }
            if (ask.ShowDialog() == DialogResult.OK)
            {
                var fn = "";
                fn = usb ? ((USBFrm)ask).SelectedUSB.Name.ToUpper().Substring(0, 3) : ((AskPath)ask).FileName;
                var g = new GenIsoFrm(fn, usb);
                g.GenerationFinished += delegate { g_GenerationFinished(g); };

                g.Title = txtTitle.Text;
                if (usb)
                {
                    g.filesystem = ((USBFrm)ask).TheComboBox.SelectedItem.ToString().RemoveRecommended();
                }
                switch (cbxBackType.SelectedIndex)
                {
                case 0:
                    g.IsoBackgroundImage = "";
                    break;

                case 1:
                    g.IsoBackgroundImage = txtBackFile.Text;
                    break;

                default:
                    g.IsoBackgroundImage = "$$NONE$$";
                    break;
                }

                var bl = SelectedBootloader();

                g.bloader             = bl;
                Program.SupportAccent = bl.SupportAccent;
                g.Res    = ((dynamic)cbxRes.SelectedItem).Val;
                g.Images =
                    CurImages.Select(
                        x =>
                        new ImageLine(x.Name.RemoveAccent(), x.FilePath, x.Description.RemoveAccent(),
                                      x.Category.RemoveAccent(), x.CustomCode, x.EntryType)).ToList();
                g.CustomFiles = CustomFiles;
                g.ShowDialog(this);

                Program.ClrTmp();
                Program.SupportAccent = false;
            }
        }
Exemplo n.º 2
0
        private void btnInstBoot_Click(object sender, EventArgs e)
        {
            var frm = new USBFrm(Strings.InstallABootLoader, Strings.ChooseBootloader, Strings.Install, false, "Grub2");

            frm.BtnClicked += (o, args) =>
            {
                frm.ProgressVisible = true;
                frm.SetProgress(5);
                Grub2.Install(frm.SelectedUSB.Name);
                frm.SetProgress(100);
                MessageBox.Show(
                    string.Format(Strings.BootloaderInstalled,
                                  "Grub2",
                                  frm.SelectedUSB.Name), "SharpBoot", 0, MessageBoxIcon.Information);
            };
            frm.ShowDialog(this);
        }
Exemplo n.º 3
0
        private void btnInstBoot_Click(object sender, EventArgs e)
        {
            var frm = new USBFrm(Strings.InstallABootLoader, Strings.ChooseBootloader, Strings.Install, false,
                                 cbxBootloader.Items.Cast <string>().ToArray());

            frm.BtnClicked += (o, args) =>
            {
                frm.ProgressVisible = true;
                frm.SetProgress(5);
                var bl = Bootloaders.Bloaders[frm.TheComboBox.SelectedIndex];
                BootloaderInst.Install(frm.SelectedUSB.Name, bl);
                frm.SetProgress(100);
                MessageBox.Show(
                    string.Format(Strings.BootloaderInstalled,
                                  bl.DisplayName,
                                  frm.SelectedUSB.Name), "SharpBoot", 0, MessageBoxIcon.Information);
            };
            frm.ShowDialog(this);
        }
Exemplo n.º 4
0
        private void launchgeniso(bool usb)
        {
            Form ask = null;
            if (usb)
            {
                var fs =
                    new[] {"NTFS", "FAT32", "FAT16", "FAT12"}.AddRecommended(CurImages.Any(x => x.SizeB >= uint.MaxValue)
                        ? 0
                        : 1);
                ask = new USBFrm(Strings.CreateMultibootUsb, Strings.Filesystem, Strings.OK, true, fs);
            }
            else ask = new AskPath();
            if (ask.ShowDialog() == DialogResult.OK)
            {
                var fn = "";
                fn = usb ? ((USBFrm) ask).SelectedUSB.Name.ToUpper().Substring(0, 3) : ((AskPath) ask).FileName;
                var g = new GenIsoFrm(fn, usb);
                g.GenerationFinished += delegate { g_GenerationFinished(g); };

                g.Title = txtTitle.Text;
                if (usb) g.filesystem = ((USBFrm) ask).TheComboBox.SelectedItem.ToString().RemoveRecommended();
                switch (cbxBackType.SelectedIndex)
                {
                    case 0:
                        g.IsoBackgroundImage = "";
                        break;
                    case 1:
                        g.IsoBackgroundImage = txtBackFile.Text;
                        break;
                    default:
                        g.IsoBackgroundImage = "$$NONE$$";
                        break;
                }

                var bl = SelectedBootloader();

                g.bloader = bl;
                Program.SupportAccent = bl.SupportAccent;
                g.Res = ((dynamic)cbxRes.SelectedItem).Val;
                g.Images =
                    CurImages.Select(
                        x =>
                            new ImageLine(x.Name.RemoveAccent(), x.FilePath, x.Description.RemoveAccent(),
                                x.Category.RemoveAccent(), x.CustomCode, x.EntryType)).ToList();
                g.CustomFiles = CustomFiles;
                g.ShowDialog(this);

                Program.ClrTmp();
                Program.SupportAccent = false;
            }
        }
Exemplo n.º 5
0
 private void btnInstBoot_Click(object sender, EventArgs e)
 {
     var frm = new USBFrm(Strings.InstallABootLoader, Strings.ChooseBootloader, Strings.Install, false,
         cbxBootloader.Items.Cast<string>().ToArray());
     frm.BtnClicked += (o, args) =>
     {
         frm.ProgressVisible = true;
         frm.SetProgress(5);
         var bl = Bootloaders.Bloaders[frm.TheComboBox.SelectedIndex];
         BootloaderInst.Install(frm.SelectedUSB.Name, bl);
         frm.SetProgress(100);
         MessageBox.Show(
             string.Format(Strings.BootloaderInstalled,
                 bl.DisplayName,
                 frm.SelectedUSB.Name), "SharpBoot", 0, MessageBoxIcon.Information);
     };
     frm.ShowDialog(this);
 }