Exemple #1
0
        private void metroButton2_Click(object sender, EventArgs e)
        {
            string path;

            using (var fbd = new FolderBrowserDialog())
            {
                DialogResult result = fbd.ShowDialog();

                if (result == DialogResult.OK && !string.IsNullOrWhiteSpace(fbd.SelectedPath))
                {
                    path = fbd.SelectedPath;
                    WindowsSetup.Variabile.locatie = path;
                    string wim = path + "\\Sources\\install.wim";
                    string esd = path + "\\Sources\\install.esd";
                    if (!File.Exists(wim))
                    {
                        if (!File.Exists(esd))
                        {
                            MessageBox.Show("It isn't an official Windows iso!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                            var form = new WindowsFormsApplication2.Form5();
                            this.Hide();
                            form.Show();
                        }
                        else
                        {
                            WindowsSetup.Variabile.locatie = esd;
                            WindowsSetup.Variabile.var     = "esd";
                            var y = new WindowsFormsApplication2.Form12();
                            this.Hide();
                            y.Show();
                        }
                    }
                    else
                    {
                        WindowsSetup.Variabile.locatie = wim;
                        WindowsSetup.Variabile.var     = "wim";

                        var y = new WindowsFormsApplication2.Form12();
                        this.Hide();
                        y.Show();
                    }
                }
            }
        }
Exemple #2
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            metroProgressBar1.Minimum = 0;
            metroProgressBar1.Maximum = 100;
            metroProgressBar1.Enabled = true;
            timer1.Enabled            = true;
            if (!Directory.Exists("Windows_TEMP"))
            {
                Directory.CreateDirectory("Windows_TEMP");
            }
            else
            {
                Directory.Delete("Windows_TEMP", true);
                Directory.CreateDirectory("Windows_TEMP");
            }

            string extractTo = "Windows_TEMP\\";

            if (metroProgressBar1.Value == 0)
            {
                string s = WindowsSetup.Variabile.locatie;
                ExtractISO(s, extractTo);
                metroProgressBar1.Value = 100;
                metroLabel2.Text        = metroProgressBar1.Value.ToString() + " %";
                metroLabel2.Refresh();
                timer1.Stop();


                string te = Form6.alg;
                cmd("rename " + WindowsSetup.Variabile.locatie + " " + te);

                esd = "Windows_TEMP\\sources\\install.esd";
                wim = "Windows_TEMP\\sources\\install.wim";
            }
            if (metroProgressBar1.Value == 100)
            {
                if (!File.Exists(esd))
                {
                    if (!File.Exists(wim))
                    {
                        MessageBox.Show("It isn't an official Windows iso!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        var form = new Form6();
                        timer1.Enabled = false;
                        timer1.Stop();
                        this.Hide();
                        form.Show();
                    }
                    else
                    {
                        WindowsSetup.Variabile.locatie = wim;
                        WindowsSetup.Variabile.var     = "wim";

                        var y = new WindowsFormsApplication2.Form12();
                        this.Hide();
                        y.Show();
                    }
                }
                else
                {
                    WindowsSetup.Variabile.locatie = esd;
                    WindowsSetup.Variabile.var     = "esd";
                    var y = new WindowsFormsApplication2.Form12();
                    this.Hide();
                    y.Show();
                }
            }
        }