Hey,

The attached patch makes monowrap work on windows machines whose user has a space in its name. It turns out MSBuild places its responsefile in the users' temp folder, which almost always will have a space in its name (C:\Users\Lucas Meijer\Temp).

The patch assumes that when it finds a "@" in the compiler arguments, everything that follows after that is going to be the responsefile, and inserts quotes so that the real mcs.exe won't trip up over them.

Bye, Lucas

PS Not sure if you need it for simple patches like this, but fwiw, it's released under MIT-X11 license.
Index: monowrap.cs
===================================================================
--- monowrap.cs (revision 148912)
+++ monowrap.cs (working copy)
@@ -115,12 +115,19 @@
                        }
                        Environment.SetEnvironmentVariable ("MONO_PATH", 
sb.ToString ());
 
+                       string compilerargs = compiler + " " + String.Join (" 
", args);
+                       int responseFileStart = compilerargs.IndexOf("@");
+                       if (responseFileStart!=-1)
+                               compilerargs = 
compilerargs.Insert(responseFileStart+1,"\"") + '\"';
+
                        Console.WriteLine ("Compiler: {0}", compiler);
                        Console.WriteLine ("MONO_PATH: {0}", sb.ToString ());
+                       Console.WriteLine ("Arguments: {0}", compilerargs);
+                       
                        var pi = new ProcessStartInfo() {
                                FileName = mono_cmd,
                                WindowStyle = ProcessWindowStyle.Hidden,
-                               Arguments = compiler + " " + String.Join (" ", 
args),
+                               Arguments = compilerargs,
                                UseShellExecute = false
                        };
 
_______________________________________________
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list

Reply via email to