[longomatch] Fix migration tool in Windows
- From: Andoni Morales Alastruey <amorales src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [longomatch] Fix migration tool in Windows
- Date: Tue, 28 Oct 2014 09:47:44 +0000 (UTC)
commit 91858d523232a2ab02cbd210c07a0ecbcac91322
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date: Tue Oct 14 18:55:19 2014 +0200
Fix migration tool in Windows
LongoMatch.Services/Services/ToolsManager.cs | 18 ++++++++++++------
1 files changed, 12 insertions(+), 6 deletions(-)
---
diff --git a/LongoMatch.Services/Services/ToolsManager.cs b/LongoMatch.Services/Services/ToolsManager.cs
index 62763df..4b79352 100644
--- a/LongoMatch.Services/Services/ToolsManager.cs
+++ b/LongoMatch.Services/Services/ToolsManager.cs
@@ -183,18 +183,24 @@ namespace LongoMatch.Services
string codeBase = Assembly.GetExecutingAssembly ().CodeBase;
UriBuilder uri = new UriBuilder (codeBase);
string assemblyDir = Path.GetDirectoryName (Uri.UnescapeDataString (uri.Path));
+ string monoPath = assemblyDir;
+ monoPath += Path.PathSeparator + Path.Combine (Config.baseDirectory, "lib", "cli",
"Db4objects.Db4o-8.0");
+ Console.WriteLine (monoPath);
string migrationExe = Path.Combine (assemblyDir, "migration", "LongoMatch.exe");
ProcessStartInfo startInfo = new ProcessStartInfo ();
startInfo.CreateNoWindow = true;
- if (System.Environment.OSVersion.Platform != PlatformID.Win32NT) {
- startInfo.UseShellExecute = false;
- }
- startInfo.FileName = "mono-sgen";
+ startInfo.UseShellExecute = false;
startInfo.Arguments = migrationExe;
+ startInfo.WorkingDirectory = Path.Combine (Config.baseDirectory, "bin");
+ if (System.Environment.OSVersion.Platform == PlatformID.Win32NT) {
+ startInfo.FileName = "mono";
+ } else {
+ startInfo.FileName = "mono-sgen";
+ }
if (startInfo.EnvironmentVariables.ContainsKey ("MONO_PATH")) {
- startInfo.EnvironmentVariables["MONO_PATH"] += Path.PathSeparator +
assemblyDir;
+ startInfo.EnvironmentVariables["MONO_PATH"] += Path.PathSeparator + monoPath;
} else {
- startInfo.EnvironmentVariables.Add ("MONO_PATH", assemblyDir);
+ startInfo.EnvironmentVariables.Add ("MONO_PATH", monoPath);
}
using (Process exeProcess = Process.Start(startInfo)) {
exeProcess.WaitForExit ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]