コード例 #1
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            progressBar1.Minimum = 0;
            progressBar1.Maximum = 100;
            label7.Enabled       = true;
            label7.Visible       = true;
            string ss = WindowsSetup.Variabile.locatie;

            label7.Text = string.Format("{0} %", progressBar1.Value);
            label7.Refresh();
            if (WindowsSetup.Variabile.var == "wim")
            {
                if (progressBar1.Value == 0)
                {
                    progressBar1.Value = 20;
                    label4.Visible     = false;
                    label8.Visible     = false;
                    Imagex(ss);
                    progressBar1.Value = 70;
                    label7.Text        = progressBar1.Value.ToString() + " %";
                    label7.Refresh();
                    label12.Visible = true;
                }
                if (progressBar1.Value == 70)
                {
                    label1.Font = new Font("Segoe UI Semilight", 14, FontStyle.Regular);
                    label5.Font = new Font("Segoe UI Semibold", 14, FontStyle.Italic);
                    Bootsect();
                    Thread.Sleep(5000);
                    label13.Visible     = true;
                    progressBar1.Value += 10;
                    label7.Text         = progressBar1.Value.ToString() + "%";
                    label7.Refresh();
                }
                if (progressBar1.Value == 80)
                {
                    progressBar1.Value += 5;
                    Bcdboot();
                    label7.Text = progressBar1.Value.ToString() + " %";
                    label7.Refresh();
                }
                if (progressBar1.Value == 85)
                {
                    progressBar1.Value += 15;
                    label5.Font         = new Font("Segoe UI Semilight", 14, FontStyle.Regular);
                    label6.Font         = new Font("Segoe UI Semibold", 14, FontStyle.Italic);
                    label7.Text         = progressBar1.Value.ToString() + " %";
                    label7.Refresh();
                    Thread.Sleep(5000);
                    Bcdedit();
                }
                if (progressBar1.Value == 100)
                {
                    timer1.Enabled       = false;
                    progressBar1.Enabled = false;
                    var formga = new Form19();
                    this.Hide();
                    formga.Show();
                }
            }
            if (WindowsSetup.Variabile.var == "esd")
            {
                if (progressBar1.Value == 0)
                {
                    Conquer(ss);
                    progressBar1.Value += 20;
                    label7.Text         = progressBar1.Value.ToString() + " %";
                    label7.Refresh();
                }

                if (progressBar1.Value == 20)
                {
                    string gamma = WindowsSetup.Variabile.format + "\\install.wim";
                    Imagex(gamma);
                    progressBar1.Value += 30;
                    label1.Font         = new Font("Segoe UI Semilight", 14, FontStyle.Regular);
                    label5.Font         = new Font("Segoe UI Semibold", 14, FontStyle.Italic);
                    label7.Text         = progressBar1.Value.ToString() + " %";
                    label7.Refresh();
                }

                if (progressBar1.Value == 50)
                {
                    Bootsect();
                    progressBar1.Value += 20;
                    label7.Text         = progressBar1.Value.ToString() + " %";
                    label7.Refresh();
                    Thread.Sleep(5000);
                }

                if (progressBar1.Value == 70)
                {
                    Bcdboot();
                    progressBar1.Value += 20;
                    label5.Font         = new Font("Segoe UI Semilight", 14, FontStyle.Regular);
                    label6.Font         = new Font("Segoe UI Semibold", 14, FontStyle.Italic);
                    label7.Text         = progressBar1.Value.ToString() + " %";
                    label7.Refresh();
                    Thread.Sleep(5000);
                }
                if (progressBar1.Value == 90)
                {
                    Bcdedit();
                    progressBar1.Value += 10;
                    label7.Text         = progressBar1.Value.ToString() + " %";
                    label7.Refresh();
                    Thread.Sleep(5000);
                }
                if (progressBar1.Value == 100)
                {
                    timer1.Enabled       = false;
                    progressBar1.Enabled = false;
                    var formga = new Form19();
                    this.Hide();
                    formga.Show();
                }
            }
        }