Author: gedmurphy
Date: Fri May 11 15:18:21 2007
New Revision: 26694
URL:
http://svn.reactos.org/svn/reactos?rev=26694&view=rev
Log:
- fix possible exceptions for incorrect paths
- set Main as STA to allow debuging
Modified:
trunk/tools/Qemu GUI/Runner.cs
trunk/tools/Qemu GUI/program.cs
Modified: trunk/tools/Qemu GUI/Runner.cs
URL:
http://svn.reactos.org/svn/reactos/trunk/tools/Qemu%20GUI/Runner.cs?rev=266…
==============================================================================
--- trunk/tools/Qemu GUI/Runner.cs (original)
+++ trunk/tools/Qemu GUI/Runner.cs Fri May 11 15:18:21 2007
@@ -117,22 +117,29 @@
string argv = " create -f " + Format + " \"" +
FileName + "\" " + d.ToString();
p.StartInfo.FileName = data.Paths.Qemu + "\\qemu-img.exe";
- p.StartInfo.WorkingDirectory = data.Paths.Qemu;
- p.StartInfo.Arguments = argv;
- try
- {
- p.Start();
- }
- catch(Exception e)
- {
- ErrBuffer += Environment.NewLine + "Error: " + e.Message;
- ErrorForm error = new ErrorForm();
- error.txtError.Text = ErrBuffer;
- error.txtError.Text += p.StandardError.ReadToEnd();
- error.ShowDialog();
- return false;
- }
- return true;
+ if (Directory.Exists(data.Paths.Qemu))
+ {
+ p.StartInfo.WorkingDirectory = data.Paths.Qemu;
+ p.StartInfo.Arguments = argv;
+ try
+ {
+ p.Start();
+ }
+ catch (Exception e)
+ {
+ ErrBuffer += Environment.NewLine + "Error: " + e.Message;
+ ErrorForm error = new ErrorForm();
+ error.txtError.Text = ErrBuffer;
+ //error.txtError.Text += p.StandardError.ReadToEnd();
+ error.ShowDialog();
+ return false;
+ }
+ return true;
+ }
+ else
+ MessageBox.Show("\"" + data.Paths.Qemu +
"\"" + " does not exist");
+
+ return false;
}
public string GetErrorBuffer()
@@ -143,28 +150,36 @@
public bool MountImage()
{
p.StartInfo.FileName = data.Paths.VDK + "\\vdk.exe";
- p.StartInfo.WorkingDirectory = data.Paths.VDK;
- p.StartInfo.Arguments = "open 0 " + "\"" +
data.Tools.vdk.Image + "\" /RW /L:" + data.Tools.vdk.DriveLetter;
-
- try
- {
- p.Start();
- //frmError error = new frmError();
- //error.txtError.Text = ErrBuffer;
- //error.txtError.Text += p.StandardError.ReadToEnd();
- //error.txtError.Text += p.StandardOutput.ReadToEnd();
- //error.ShowDialog();
- }
- catch(Exception e)
- {
- ErrBuffer += Environment.NewLine + "Error: " + e.Message;
- ErrorForm error = new ErrorForm();
- error.txtError.Text = ErrBuffer;
- error.txtError.Text += p.StandardError.ReadToEnd();
- error.ShowDialog();
- return false;
- }
- return true;
+
+ if (Directory.Exists(data.Paths.VDK))
+ {
+ p.StartInfo.WorkingDirectory = data.Paths.VDK;
+ p.StartInfo.Arguments = "open 0 " + "\"" +
data.Tools.vdk.Image + "\" /RW /L:" + data.Tools.vdk.DriveLetter;
+
+ try
+ {
+ p.Start();
+ //frmError error = new frmError();
+ //error.txtError.Text = ErrBuffer;
+ //error.txtError.Text += p.StandardError.ReadToEnd();
+ //error.txtError.Text += p.StandardOutput.ReadToEnd();
+ //error.ShowDialog();
+ }
+ catch (Exception e)
+ {
+ ErrBuffer += Environment.NewLine + "Error: " + e.Message;
+ ErrorForm error = new ErrorForm();
+ error.txtError.Text = ErrBuffer;
+ error.txtError.Text += p.StandardError.ReadToEnd();
+ error.ShowDialog();
+ return false;
+ }
+ return true;
+ }
+ else
+ MessageBox.Show("\"" + data.Paths.VDK +
"\"" + " does not exist");
+
+ return false;
}
public bool UnmountImage()
Modified: trunk/tools/Qemu GUI/program.cs
URL:
http://svn.reactos.org/svn/reactos/trunk/tools/Qemu%20GUI/program.cs?rev=26…
==============================================================================
--- trunk/tools/Qemu GUI/program.cs (original)
+++ trunk/tools/Qemu GUI/program.cs Fri May 11 15:18:21 2007
@@ -9,7 +9,7 @@
/// <summary>
/// The main entry point for the application.
/// </summary>
- [MTAThread]
+ [STAThread]
static void Main()
{
Application.Run(new MainForm());