From 327778a132d92d1804cf1cb4bb5aa0b6e15253ec Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Fri, 2 May 2014 17:51:09 +0100 Subject: [PATCH] windows install working --- scala/dist/mk-linux-generic.sh | 1 + scala/dist/mk-windows.bat | 1 + scala/dist/windows-dist/QuantoDerive.aip | 3 ++- scala/src/main/scala/quanto/core/Core.scala | 2 +- scala/src/main/scala/quanto/gui/MLEditPanel.scala | 5 +++-- scala/src/main/scala/quanto/util/Globals.scala | 1 + 6 files changed, 9 insertions(+), 4 deletions(-) diff --git a/scala/dist/mk-linux-generic.sh b/scala/dist/mk-linux-generic.sh index 0a7c5bb1..fcd4666d 100755 --- a/scala/dist/mk-linux-generic.sh +++ b/scala/dist/mk-linux-generic.sh @@ -22,6 +22,7 @@ cp -f dist/linux-dist/libpolyml.so.4 $BUNDLE/bin echo Including heap... cp -f ../core/run_protocol.ML $BUNDLE/ +cp -f dist/ml.xml $BUNDLE/ mkdir -p $BUNDLE/heaps cp -f ../core/heaps/quanto.heap $BUNDLE/heaps/ diff --git a/scala/dist/mk-windows.bat b/scala/dist/mk-windows.bat index 5579d492..26baca6b 100644 --- a/scala/dist/mk-windows.bat +++ b/scala/dist/mk-windows.bat @@ -11,6 +11,7 @@ mkdir %BUNDLE%\bin REM This dummy file lets the frontend know it is running inside REM a generic linux bundle. type nul >> %BUNDLE%\windows-bundle +copy dist\ml.xml %BUNDLE% echo Running SBT... call sbt package diff --git a/scala/dist/windows-dist/QuantoDerive.aip b/scala/dist/windows-dist/QuantoDerive.aip index 64862801..2ff1dca3 100644 --- a/scala/dist/windows-dist/QuantoDerive.aip +++ b/scala/dist/windows-dist/QuantoDerive.aip @@ -62,8 +62,9 @@ + - + diff --git a/scala/src/main/scala/quanto/core/Core.scala b/scala/src/main/scala/quanto/core/Core.scala index c8825ee6..9a646b6d 100644 --- a/scala/src/main/scala/quanto/core/Core.scala +++ b/scala/src/main/scala/quanto/core/Core.scala @@ -110,7 +110,7 @@ class Core extends Actor with ActorLogging { fw.write(msg.code) fw.write("\n") fw.close() - val code = codeWrapper.format(workingDir, file.getAbsolutePath, mlCompileId) + val code = codeWrapper.format(workingDir.replace("\\","\\\\"), file.getAbsolutePath.replace("\\","\\\\"), mlCompileId) activeRequests.synchronized(activeRequests += mlCompileId) coreProcess.consoleOutput.addListener(mlCompileId)(msg.onComplete) diff --git a/scala/src/main/scala/quanto/gui/MLEditPanel.scala b/scala/src/main/scala/quanto/gui/MLEditPanel.scala index 7906ee9c..299d317c 100644 --- a/scala/src/main/scala/quanto/gui/MLEditPanel.scala +++ b/scala/src/main/scala/quanto/gui/MLEditPanel.scala @@ -18,7 +18,7 @@ class MLEditPanel extends BorderPanel with HasDocument { val sml = new Mode("StandardML") - val mlModeXml = if (Globals.isMacBundle) new File("ml.xml").getAbsolutePath + val mlModeXml = if (Globals.isBundle) new File("ml.xml").getAbsolutePath else getClass.getResource("ml.xml").getPath sml.setProperty("file", mlModeXml) println(sml.getProperty("file")) @@ -104,7 +104,8 @@ class MLEditPanel extends BorderPanel with HasDocument { QuantoDerive.CoreStatus.text = "Exception in ML" QuantoDerive.CoreStatus.foreground = Color.RED QuantoDerive.ConsoleProgress.indeterminate = false - case _ => + case msg => + println(msg) QuantoDerive.CoreStatus.text = "Unrecognised response from Poly/ML" QuantoDerive.CoreStatus.foreground = Color.BLUE QuantoDerive.ConsoleProgress.indeterminate = false diff --git a/scala/src/main/scala/quanto/util/Globals.scala b/scala/src/main/scala/quanto/util/Globals.scala index 02b859a7..32312894 100644 --- a/scala/src/main/scala/quanto/util/Globals.scala +++ b/scala/src/main/scala/quanto/util/Globals.scala @@ -7,4 +7,5 @@ object Globals { def isMacBundle: Boolean = new File("osx-bundle").exists def isLinuxBundle: Boolean = new File("linux-bundle").exists def isWindowsBundle: Boolean = new File("windows-bundle").exists + def isBundle: Boolean = isMacBundle || isWindowsBundle || isLinuxBundle }