using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.Windows.Forms;
namespace codeLoader
{
public partial class CodeLoaderGen : Form
{
IniParse ini;
string sourcePath;
string encryption;
string icoPath;
string cmdline;
Process process;
public CodeLoaderGen()
{
InitializeComponent();
}
private void run_output(string command)
{
process = new Process();
process.StartInfo.FileName = "cmd.exe";
process.StartInfo.Arguments = "/c " + command;
process.StartInfo.UseShellExecute = false;
process.StartInfo.RedirectStandardError = true;
process.StartInfo.RedirectStandardInput = true;
process.StartInfo.RedirectStandardOutput = true;
process.StartInfo.CreateNoWindow = true;
process.Start();
process.StandardInput.AutoFlush = true;
process.BeginErrorReadLine();
process.BeginOutputReadLine();
process.OutputDataReceived += new DataReceivedEventHandler(Process_OutputDataReceived);
process.ErrorDataReceived += new DataReceivedEventHandler(Process_OutputDataReceived);
button_gen.Enabled = false;
}
private void Process_OutputDataReceived(object sender, DataReceivedEventArgs e)
{
if (!string.IsNullOrEmpty(e.Data))
{
this.textBox_output.BeginInvoke((MethodInvoker)(() =>
{
textBox_output.Text += e.Data + "\r\n";
}));
}
else
{
if (process.HasExited)
{
this.button_gen.BeginInvoke((MethodInvoker)(() =>
{
button_gen.Enabled = true;
}));
}
}
}
private void button_gen_Click(object sender, EventArgs e)
{
textBox_output.Text = textBox_cmdline.Text +"\r\n" + "---------------------------------" + "\r\n";
run_output(textBox_cmdline.Text);
}
private void CodeLoaderGen_Load(object sender, EventArgs e)
{
ini = new IniParse(@".\Compiler.ini");
try
{
List