private void Bcdboot() { string bcdboot; bcdboot = "Packages\\bcdboot " + WindowsSetup.Variabile.format + "\\Windows /s " + WindowsSetup.Variabile.format + "\\" + " /f all"; CMD_Process_Class.Process_CMD(bcdboot); }
private void Form12_Load(object sender, EventArgs e) { try { using (FileStream wimstream = new FileStream(WindowsSetup.Variabile.locatie, FileMode.Open, FileAccess.Read)) { WimFile x = new WimFile(wimstream); } } catch { } string install = "Get-WindowsImage -Imagepath \"" + WindowsSetup.Variabile.locatie + "\" | Select-Object ImageName > Packages\\fix.txt "; CMD_Process_Class.Process_Powershell(install); string[] lines = File.ReadAllLines("Packages\\fix.txt"); var lineCount = File.ReadAllLines("Packages\\fix.txt").Length; for (int i = 3; i < lineCount; i++) { if (lines[i].Length > 1) { checkedListBox1.Items.Add(lines[i]); } } }
private void Bcdedit(int e = 0) { string firstbcdedit; try { using (IntegrateOS.Bcdedit_name name = new IntegrateOS.Bcdedit_name()) { name.ShowDialog(); temp = name.get(); } } catch { } firstbcdedit = "Packages\\bcdedit /copy {current} /d \"" + temp + "\" > Packages\\edit.dll"; CMD_Process_Class.Process_CMD(firstbcdedit); string lines = File.ReadAllText(@"Packages\\edit.dll"); string[] s1 = lines.Split('{'); string[] test = WindowsSetup.Variabile.format.Split('\\'); string[] s2 = s1[1].Split('.'); string ep = "Packages\\bcdedit.exe /set " + '{' + s2[0] + " device partition=" + test[0]; string ep2 = "Packages\\bcdedit.exe /set " + '{' + s2[0] + " osdevice partition=" + test[0]; MessageBox.Show(ep); CMD_Process_Class.Process_CMD(ep); CMD_Process_Class.Process_CMD(ep2); if (File.Exists("Packages\\test.txt")) { File.Delete("Packages\\test.txt"); } string verify_type = "powershell $(Get-ComputerInfo).BiosFirmwareType > Packages\\test.txt"; CMD_Process_Class.Process_CMD(verify_type, 1); string[] line = File.ReadAllLines(@"Packages\\test.txt"); string ep1 = ""; if (line[0] == "Uefi") { ep1 = "Packages\\bcdedit.exe /set " + '{' + s2[0] + " path \\Windows\\system32\\winload.efi"; } else { ep1 = "Packages\\bcdedit.exe /set " + '{' + s2[0] + " path \\Windows\\system32\\winload.exe"; } CMD_Process_Class.Process_CMD(ep1); string ep3 = "Packages\\bcdedit.exe /set " + '{' + s2[0] + " systemroot \\Windows"; CMD_Process_Class.Process_CMD(ep3); }
private void button1_Click_1(object sender, EventArgs e) { string drive_letter = ""; try { drive_letter = dataGridView1[dataGridView1.CurrentCell.ColumnIndex, dataGridView1.CurrentCell.RowIndex].Value.ToString(); } catch { } string t = "\\pagefile.sys"; char[] s = new char[2]; s[0] = drive_letter[0]; s[1] = drive_letter[1]; string ga = new string(s); string k = ga + t; string t1 = "\\hiberfile.sys"; if (drive_letter != "") { string k1 = ga + t1; if (File.Exists(k) || File.Exists(k1) || drive_letter == "C:") { if (drive_letter == "C:") { MessageBox.Show("It's a system disk"); } MessageBox.Show("I can't format your disk, it contains system files such as pagefile.sys. Code error 5!"); } else { string strCmdText = "Format " + ga + " /Y /FS:NTFS /V:Windows /Q"; MessageBox.Show(strCmdText); WindowsSetup.Variabile.format = ga + "\\"; var result = MessageBox.Show("You really want to install Windows?", "Install Windows", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (result == DialogResult.Yes) { CMD_Process_Class.Process_CMD(strCmdText); var form2 = new Form13(); this.Hide(); form2.Show(); } } } else { MessageBox.Show("You didn't selected any option!", "Error 003", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void metroButton2_Click(object sender, EventArgs e) { checkedListBox1.Items.Clear(); string install = "Get-WindowsImage -Imagepath \"" + WindowsSetup.Variabile.locatie + "\" | Select-Object ImageName > Packages\\fix.txt "; CMD_Process_Class.Process_Powershell(install); string[] lines = File.ReadAllLines("Packages\\fix.txt"); var lineCount = File.ReadAllLines("Packages\\fix.txt").Length; for (int i = 3; i < lineCount; i++) { if (lines[i].Length > 1) { checkedListBox1.Items.Add(lines[i]); } } }
private void Bcdedit() { string firstbcdedit; firstbcdedit = "Packages\\bcdedit /copy {current} /d \"Windows\" > edit.dll"; CMD_Process_Class.Process_CMD(firstbcdedit); string lines = File.ReadAllText(@"edit.dll"); string[] s1 = lines.Split('{'); string ep = "Packages\\bcdedit.exe /set " + s1[1] + "device partition=" + WindowsSetup.Variabile.format; CMD_Process_Class.Process_CMD(ep); string ep1 = "Packages\\bcdedit.exe /set " + s1[1] + " path \\Windows\\system32\\winload.exe"; CMD_Process_Class.Process_CMD(ep1); string ep2 = "Packages\\bcdedit.exe /set " + s1[1] + " systemroot \\Windows"; CMD_Process_Class.Process_CMD(ep2); }
private void Form12_Load(object sender, EventArgs e) { try { using (FileStream wimstream = new FileStream(WindowsSetup.Variabile.locatie, FileMode.Open, FileAccess.Read)) { WimFile x = new WimFile(wimstream); } } catch { } string dism = "dism /Get-WimInfo /WimFile:"; string install = "\"" + WindowsSetup.Variabile.locatie + "\" > Packages\\fix.txt"; string installing = dism + install; CMD_Process_Class.Process_CMD(installing); string[] lines = File.ReadAllLines("Packages\\fix.txt"); var lineCount = File.ReadAllLines("Packages\\fix.txt").Length; int i = 7, j = 1; for (i = 7; i < lineCount; i += 5) { string ep = lines[i]; string[] lines3 = ep.Split(':'); string gamma = lines[i + 2]; string lines2 = "Index " + j.ToString() + ":" + lines3[1] + " "; string[] lines1 = new String[] { lines2 }; string[] gamma_space = gamma.Split(':'); string comp = gamma_space[1]; lines2 += comp; string[] comp_sp = comp.Split(','); int space_nu = Int32.Parse(comp_sp[0]); WindowsSetup.Variabile.space_gb_ver = space_nu; checkedListBox1.Items.AddRange(lines1); if (i > lineCount) { break; } j++; } }
private void Conquer(string loading) { string dism = "Packages\\dism /export-image /SourceImageFile:" + "\"" + loading + "\"" + " /SourceIndex:" + WindowsSetup.Variabile.fix + " /DestinationImageFile:" + WindowsSetup.Variabile.format + "\\install.wim " + "/Compress:none /CheckIntegrity"; t2 = new Thread( () => { CMD_Process_Class.Process_CMD(dism, 1); Invoke(new Action(() => { t2.Abort(); })); } ); t2.IsBackground = true; while (t2.IsAlive) { Thread.Sleep(500); } t2.Start(); }
private void Imagex(string loading) { Thread t1 = new Thread( () => { string imagex = "Packages\\dism /Apply-Image /ImageFile:" + "\"" + loading + "\"" + " /index:" + WindowsSetup.Variabile.fix + " /ApplyDir:" + WindowsSetup.Variabile.format + "\\ > Packages\\temp.txt"; CMD_Process_Class.Process_CMD(imagex, 1); Invoke(new Action(() => { })); } ) { IsBackground = true }; t1.Start(); while (t1.IsAlive) { Thread.Sleep(500); Application.DoEvents(); } }
private void metroButton2_Click(object sender, EventArgs e) { string dism = "dism /Get-WimInfo /WimFile:"; string install = "\"" + WindowsSetup.Variabile.locatie + "\" > Packages\\fix.txt"; string installing = dism + install; CMD_Process_Class.Process_CMD(installing); while (!File.Exists("Packages\\fix.txt")) { Thread.Sleep(2000); } string[] lines = File.ReadAllLines("Packages\\fix.txt"); var lineCount = File.ReadAllLines("Packages\\fix.txt").Length; int i = 7, j = 1; for (i = 7; i < lineCount; i += 5) { string ep = lines[i]; string[] lines3 = ep.Split(':'); string gamma = lines[i + 2]; string lines2 = "Index " + j.ToString() + ":" + lines3[1] + " "; string[] lines1 = new String[] { lines2 }; string[] gamma_space = gamma.Split(':'); string comp = gamma_space[1]; lines2 += comp; string[] comp_sp = comp.Split(','); int space_nu = Int32.Parse(comp_sp[0]); WindowsSetup.Variabile.space_gb_ver = space_nu; checkedListBox1.Items.AddRange(lines1); if (i > lineCount) { break; } j++; } }
private void Bootsect() { string bootsect = "Packages\\bootsect /NT60 " + WindowsSetup.Variabile.format + " /force"; CMD_Process_Class.Process_CMD(bootsect); }
private void Conquer(string loading) { string dism = "Packages\\dism /export-image /SourceImageFile:" + "\"" + loading + "\"" + " /SourceIndex:" + WindowsSetup.Variabile.fix + " /DestinationImageFile:" + WindowsSetup.Variabile.format + "\\install.wim " + "/Compress:none / CheckIntegrity"; CMD_Process_Class.Process_CMD(dism); }