diff --git a/.githooks/commit-msg b/.githooks/commit-msg
index 899e3193227cdf3f71c2a8744bfbd265df3586fc..3aa02e9cad751f83b8b00c68c420b8a6c52751c8 100755
--- a/.githooks/commit-msg
+++ b/.githooks/commit-msg
@@ -18,6 +18,10 @@
 # Prepare a copy of the message:
 #  - strip comment lines
 #  - stop at "diff --git" (git commit -v)
+# Later versions of git gui on Windows don't set this properly
+if [ -z "$GIT_DIR" ]; then
+  GIT_DIR=$(git rev-parse --git-dir)
+fi
 commit_msg="$GIT_DIR/COMMIT_MSG"
 sed -n -e '/^#/d' -e '/^diff --git/q' -e 'p;d' "$1" > "$commit_msg"
 
diff --git a/Framework/API/src/Algorithm.cpp b/Framework/API/src/Algorithm.cpp
index 860a17a3d66cb681fd368d2f87a4f69347f5af71..f3faab12974680bde0ef301eba503b26e280ae06 100644
--- a/Framework/API/src/Algorithm.cpp
+++ b/Framework/API/src/Algorithm.cpp
@@ -10,7 +10,6 @@
 #include "MantidAPI/MemoryManager.h"
 #include "MantidAPI/IWorkspaceProperty.h"
 #include "MantidAPI/WorkspaceGroup.h"
-#include "MantidAPI/MemoryManager.h"
 
 #include "MantidKernel/EmptyValues.h"
 #include "MantidKernel/DateAndTime.h"
@@ -18,8 +17,6 @@
 #include "MantidKernel/Strings.h"
 #include "MantidKernel/Timer.h"
 
-#include <boost/algorithm/string/trim.hpp>
-#include <boost/algorithm/string/split.hpp>
 #include <boost/algorithm/string/regex.hpp>
 #include <boost/weak_ptr.hpp>
 
@@ -30,6 +27,8 @@
 #include <Poco/StringTokenizer.h>
 #include <Poco/Void.h>
 
+#include <json/json.h>
+
 #include <map>
 
 using namespace Mantid::Kernel;
@@ -823,10 +822,15 @@ Algorithm_sptr Algorithm::createChildAlgorithm(const std::string &name,
  * @returns This object serialized as a string
  */
 std::string Algorithm::toString() const {
-  std::ostringstream writer;
-  writer << name() << "." << this->version() << "("
-         << Kernel::PropertyManagerOwner::asString(false) << ")";
-  return writer.str();
+  ::Json::Value root;
+  ::Json::FastWriter writer;
+  ::Json::Reader reader;
+
+  root["name"] = name();
+  root["version"] = this->version();
+  root["properties"] = Kernel::PropertyManagerOwner::asJson(false);
+
+  return writer.write(root);
 }
 
 //--------------------------------------------------------------------------------------------
@@ -838,24 +842,28 @@ std::string Algorithm::toString() const {
  * @return a shared pointer to the created algorithm.
  */
 IAlgorithm_sptr Algorithm::fromHistory(const AlgorithmHistory &history) {
-  // Hand off to the string creator
-  std::ostringstream stream;
-  stream << history.name() << "." << history.version() << "(";
+  ::Json::Value root;
+  ::Json::Value jsonMap;
+  ::Json::FastWriter writer;
+
   auto props = history.getProperties();
   const size_t numProps(props.size());
   for (size_t i = 0; i < numProps; ++i) {
     PropertyHistory_sptr prop = props[i];
     if (!prop->isDefault()) {
-      stream << prop->name() << "=" << prop->value();
+      jsonMap[prop->name()] = prop->value();
     }
-    if (i < numProps - 1)
-      stream << ",";
   }
-  stream << ")";
+
+  root["name"] = history.name();
+  root["version"] = history.version();
+  root["properties"] = jsonMap;
+
+  const std::string output = writer.write(root);
   IAlgorithm_sptr alg;
 
   try {
-    alg = Algorithm::fromString(stream.str());
+    alg = Algorithm::fromString(output);
   } catch (std::invalid_argument &) {
     throw std::runtime_error(
         "Could not create algorithm from history. "
@@ -874,78 +882,26 @@ IAlgorithm_sptr Algorithm::fromHistory(const AlgorithmHistory &history) {
 * @return A pointer to a managed algorithm object
 */
 IAlgorithm_sptr Algorithm::fromString(const std::string &input) {
-  static const boost::regex nameExp("(^[[:alnum:]]*)");
-  // Double back slash gets rid of the compiler warning about unrecognized
-  // escape sequence
-  static const boost::regex versExp("\\.([[:digit:]]+)\\(*");
-  // Property regex. Simply match the brackets and split
-  static const boost::regex propExp("\\((.*)\\)");
-  // Name=Value regex
-  static const boost::regex nameValExp("(.*)=(.*)");
-  // Property name regex
-  static const boost::regex propNameExp(".*,([[:word:]]*)");
-  // Empty dividers
-  static const boost::regex emptyExp(",[ ,]*,");
-  // Trailing commas
-  static const boost::regex trailingCommaExp(",$");
-
-  boost::match_results<std::string::const_iterator> what;
-  if (boost::regex_search(input, what, nameExp, boost::match_not_null)) {
-    const std::string algName = what[1];
-    int version = -1; // Highest version
-    if (boost::regex_search(input, what, versExp, boost::match_not_null)) {
-      try {
-        version = boost::lexical_cast<int, std::string>(what.str(1));
-      } catch (boost::bad_lexical_cast &) {
-      }
+  ::Json::Value root;
+  ::Json::Reader reader;
+
+  if (reader.parse(input, root)) {
+    const std::string algName = root["name"].asString();
+    int version = 0;
+    try {
+      version = root["version"].asInt();
+    } catch (std::runtime_error &) {
+      // do nothing - the next test will catch it
     }
+    if (version == 0)
+      version = -1;
+
     IAlgorithm_sptr alg =
         AlgorithmManager::Instance().createUnmanaged(algName, version);
     alg->initialize();
-    if (boost::regex_search(input, what, propExp, boost::match_not_null)) {
-      std::string _propStr = what[1];
-
-      // Cleanup: Remove empty dividers (multiple commas)
-      std::string __propStr = regex_replace(_propStr, emptyExp, ",");
-      // Cleanup: We might still be left with a trailing comma, remove it
-      std::string propStr = regex_replace(__propStr, trailingCommaExp, "");
-
-      boost::match_flag_type flags = boost::match_not_null;
-      std::string::const_iterator start, end;
-      start = propStr.begin();
-      end = propStr.end();
-      // Accumulate them first so that we can set some out of order
-      std::map<std::string, std::string> propNameValues;
-      while (boost::regex_search(start, end, what, nameValExp, flags)) {
-        std::string nameValue = what.str(1);
-        std::string value = what.str(2);
-
-        if (boost::regex_search(what[1].first, what[1].second, what,
-                                propNameExp, boost::match_not_null)) {
-          const std::string name = what.str(1);
-          propNameValues[name] = value;
-          end = what[1].first - 1;
-        } else {
-          // The last property-value pair
-          propNameValues[nameValue] = value;
-          break;
-        }
-        // update flags:
-        flags |= boost::match_prev_avail;
-        flags |= boost::match_not_bob;
-      }
 
-      // Some algorithms require Filename to be set first do that here
-      auto it = propNameValues.find("Filename");
-      if (it != propNameValues.end()) {
-        alg->setPropertyValue(it->first, it->second);
-        propNameValues.erase(it);
-      }
-      for (auto cit = propNameValues.begin(); cit != propNameValues.end();
-           ++cit) {
-        alg->setPropertyValue(cit->first, cit->second);
-      }
-    }
+    // get properties
+    alg->setProperties(root["properties"]);
     return alg;
   } else {
     throw std::runtime_error("Cannot create algorithm, invalid string format.");
diff --git a/Framework/API/src/FrameworkManager.cpp b/Framework/API/src/FrameworkManager.cpp
index 5fbec879cd01c1d942509037d2c83ac79fce0aab..ab280ac7397dc446088bbc40c3b12937300bde3b 100644
--- a/Framework/API/src/FrameworkManager.cpp
+++ b/Framework/API/src/FrameworkManager.cpp
@@ -16,6 +16,8 @@
 
 #include <Poco/ActiveResult.h>
 
+#include <json/json.h>
+
 #include <cstdarg>
 
 #ifdef _WIN32
@@ -307,7 +309,8 @@ FrameworkManagerImpl::createAlgorithm(const std::string &algName,
   IAlgorithm *alg = AlgorithmManager::Instance()
                         .create(algName, version)
                         .get(); // createAlgorithm(algName);
-  alg->setProperties(propertiesArray);
+  alg->setPropertiesWithSimpleString(propertiesArray);
+
   return alg;
 }
 
diff --git a/Framework/API/test/AlgorithmPropertyTest.h b/Framework/API/test/AlgorithmPropertyTest.h
index 9d60a2b1cf91eac964a79c32e371cd85156dd2f9..c71dc4bad6365f32b9b8cce7f3cefa3f74a82ffc 100644
--- a/Framework/API/test/AlgorithmPropertyTest.h
+++ b/Framework/API/test/AlgorithmPropertyTest.h
@@ -96,7 +96,7 @@ public:
 
   void test_An_Invalid_String_Returns_An_Appropriate_Error() {
     AlgorithmProperty testProp("CalculateStep");
-    TS_ASSERT_EQUALS(testProp.setValue("ComplexSum()"),
+    TS_ASSERT_EQUALS(testProp.setValue("{\"name\":\"ComplexSum\"}"),
                      "Algorithm not registered ComplexSum");
   }
 
diff --git a/Framework/API/test/AlgorithmTest.h b/Framework/API/test/AlgorithmTest.h
index 838e11a9e8420f4d4481b2e11e60aa44a5a7fa4d..338c84efe951f12f2d99a5808363795b5afe4e13 100644
--- a/Framework/API/test/AlgorithmTest.h
+++ b/Framework/API/test/AlgorithmTest.h
@@ -298,7 +298,9 @@ public:
     // Set the properties so that we know what they are
     alg.setPropertyValue("prop1", "value1");
     alg.setProperty("prop2", 5);
-    std::string expected = "ToyAlgorithm.1(prop1=value1,prop2=5)";
+    std::string expected = "{\"name\":\"ToyAlgorithm\",\"properties\":{"
+                           "\"prop1\":\"value1\",\"prop2\":\"5\"},\"version\":"
+                           "1}\n";
     TS_ASSERT_EQUALS(alg.toString(), expected);
   }
 
@@ -308,36 +310,32 @@ public:
   }
 
   void test_Construction_Via_Valid_String_With_No_Properties() {
-    IAlgorithm_sptr testAlg = runFromString("ToyAlgorithm");
+    IAlgorithm_sptr testAlg = runFromString("{\"name\":\"ToyAlgorithm\"}");
     TS_ASSERT_EQUALS(testAlg->name(), "ToyAlgorithm");
     TS_ASSERT_EQUALS(testAlg->version(), 2);
   }
 
   void test_Construction_Via_Valid_String_With_Version() {
-    IAlgorithm_sptr testAlg = runFromString("ToyAlgorithm.1");
-    TS_ASSERT_EQUALS(testAlg->name(), "ToyAlgorithm");
-    TS_ASSERT_EQUALS(testAlg->version(), 1);
-
-    // No brackets
-    testAlg = runFromString("ToyAlgorithm.1");
+    IAlgorithm_sptr testAlg = runFromString("{\"name\":\"ToyAlgorithm\","
+                                            "\"version\":1}");
     TS_ASSERT_EQUALS(testAlg->name(), "ToyAlgorithm");
     TS_ASSERT_EQUALS(testAlg->version(), 1);
   }
 
   void test_Construction_Via_Valid_String_With_Version_And_Empty_Props() {
-    IAlgorithm_sptr testAlg = runFromString("ToyAlgorithm.1()");
-    TS_ASSERT_EQUALS(testAlg->name(), "ToyAlgorithm");
-    TS_ASSERT_EQUALS(testAlg->version(), 1);
-
-    // No brackets
-    testAlg = runFromString("ToyAlgorithm.1");
+    IAlgorithm_sptr testAlg =
+        runFromString("{\"name\":\"ToyAlgorithm\",\"properties\":{"
+                      "},\"version\":1}\n");
     TS_ASSERT_EQUALS(testAlg->name(), "ToyAlgorithm");
     TS_ASSERT_EQUALS(testAlg->version(), 1);
   }
 
   void test_Construction_Via_Valid_String_With_Set_Properties_And_Version() {
-    IAlgorithm_sptr testAlg = runFromString(
-        "ToyAlgorithm.2(prop1=val1,prop2=8,prop3=10.0,Binning=0.2,0.2,1.4)");
+
+    IAlgorithm_sptr testAlg =
+        runFromString("{\"name\":\"ToyAlgorithm\",\"properties\":{\"Binning\":"
+                      "\"0.2,0.2,1.4\",\"prop1\":\"val1\",\"prop2\":\"8\","
+                      "\"prop3\":\"10\"},\"version\":2}\n");
     TS_ASSERT_EQUALS(testAlg->name(), "ToyAlgorithm");
     TS_ASSERT_EQUALS(testAlg->version(), 2);
 
@@ -372,7 +370,9 @@ public:
   }
 
   void test_Construction_Via_Valid_String_With_Single_Property_And_Version() {
-    IAlgorithm_sptr testAlg = runFromString("ToyAlgorithm.2(prop3=10.0)");
+    IAlgorithm_sptr testAlg =
+        runFromString("{\"name\":\"ToyAlgorithm\",\"properties\":{"
+                      "\"prop3\":\"10.0\"},\"version\":2}\n");
     TS_ASSERT_EQUALS(testAlg->name(), "ToyAlgorithm");
     TS_ASSERT_EQUALS(testAlg->version(), 2);
 
@@ -392,7 +392,8 @@ public:
 
   void test_Construction_Via_Valid_String_With_Single_Property_Array() {
     IAlgorithm_sptr testAlg =
-        runFromString("ToyAlgorithm.2(Binning=0.2,0.2,1.4)");
+        runFromString("{\"name\":\"ToyAlgorithm\",\"properties\":{"
+                      "\"Binning\":\"0.2,0.2,1.4\"},\"version\":2}\n");
     TS_ASSERT_EQUALS(testAlg->name(), "ToyAlgorithm");
     TS_ASSERT_EQUALS(testAlg->version(), 2);
 
@@ -406,7 +407,8 @@ public:
   }
 
   void test_Construction_Via_Valid_String_With_Empty_Properties() {
-    IAlgorithm_sptr testAlg = runFromString("ToyAlgorithm()");
+    IAlgorithm_sptr testAlg =
+        runFromString(("{\"name\":\"ToyAlgorithm\",\"properties\":{}}\n"));
     TS_ASSERT_EQUALS(testAlg->name(), "ToyAlgorithm");
     TS_ASSERT_EQUALS(testAlg->version(), 2);
     try {
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/AddPeak.h b/Framework/Algorithms/inc/MantidAlgorithms/AddPeak.h
index 80c7cbc9e83a1c3f63e0c8db307c8bd5b14cebd2..b13234a67087fd3a3fabeb75b13f276e790b00ae 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/AddPeak.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/AddPeak.h
@@ -47,9 +47,7 @@ public:
   /// Algorithm's version for identification
   virtual int version() const { return 1; };
   /// Algorithm's category for identification
-  virtual const std::string category() const {
-    return "Crystal;Utility\\Workspaces";
-  }
+  virtual const std::string category() const { return "Crystal\\Peaks"; }
 
 private:
   /// Initialise the properties
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/ApplyDetailedBalance.h b/Framework/Algorithms/inc/MantidAlgorithms/ApplyDetailedBalance.h
index 8066fca48493a1aedb8b824688e92b3cbd190ace..db48bb9fd4157db54991e2b0a68109e8707d47ce 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/ApplyDetailedBalance.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/ApplyDetailedBalance.h
@@ -49,7 +49,9 @@ public:
   /// Algorithm's version for identification
   virtual int version() const { return 1; };
   /// Algorithm's category for identification
-  virtual const std::string category() const { return "Inelastic"; }
+  virtual const std::string category() const {
+    return "Inelastic\\Corrections";
+  }
 
 private:
   /// Initialise the properties
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/CalculateZscore.h b/Framework/Algorithms/inc/MantidAlgorithms/CalculateZscore.h
index df88cbf1bc1c5fb8e1f644c1a14d188b732fc0fb..1ad6ae3a20961a7b0d1fb0da32c7574aed188da1 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/CalculateZscore.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/CalculateZscore.h
@@ -46,7 +46,7 @@ public:
   virtual int version() const { return 1; }
 
   /// Algorithm's category for identification overriding a virtual method
-  virtual const std::string category() const { return "Utility"; }
+  virtual const std::string category() const { return "Utility\\Calculation"; }
 
 private:
   /// Implement abstract Algorithm methods
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/ChangeTimeZero.h b/Framework/Algorithms/inc/MantidAlgorithms/ChangeTimeZero.h
index c20dd17461a34116e41e5d03a03eb9264404dfe5..1bd283f85e1abf0cadc65e7e807ca499f85e2d79 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/ChangeTimeZero.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/ChangeTimeZero.h
@@ -28,7 +28,7 @@ public:
   /// Algorithm's version for identification
   virtual int version() const { return 1; };
   /// Algorithm's category for identification
-  virtual const std::string category() const { return "Utility"; }
+  virtual const std::string category() const { return "Utility\\Workspaces"; }
 
 private:
   /// Initialise the properties
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/CopyDetectorMapping.h b/Framework/Algorithms/inc/MantidAlgorithms/CopyDetectorMapping.h
index 9f3efe9ce08f68422e6ab2925ae6da88f64b9450..ef85ac20e0e805868baa7540f93de34320cad27a 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/CopyDetectorMapping.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/CopyDetectorMapping.h
@@ -53,7 +53,7 @@ public:
   /// Algorithm's version
   virtual int version() const { return (1); }
   /// Algorithm's category for identification
-  virtual const std::string category() const { return "DataHandling"; }
+  virtual const std::string category() const { return "Utility\\Workspaces"; }
 
   /// Input property validation
   virtual std::map<std::string, std::string> validateInputs();
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/CopySample.h b/Framework/Algorithms/inc/MantidAlgorithms/CopySample.h
index 29ba996bdff59c50bd52ae6668a53f3951133cc0..e84df54cf23e92a7ad299b5729ecf16db3d4bee9 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/CopySample.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/CopySample.h
@@ -62,7 +62,7 @@ public:
   virtual int version() const { return 1; };
   /// Algorithm's category for identification
   virtual const std::string category() const {
-    return "Sample;Utility\\Workspaces;DataHandling";
+    return "Sample;Utility\\Workspaces";
   }
   virtual std::map<std::string, std::string> validateInputs();
 
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/CorelliCrossCorrelate.h b/Framework/Algorithms/inc/MantidAlgorithms/CorelliCrossCorrelate.h
index af9975c5aa9982f20de5eced5f459c6fe233fd2f..7ab057e4ad3c0090c95108df5bef28bbc70b6ae1 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/CorelliCrossCorrelate.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/CorelliCrossCorrelate.h
@@ -38,7 +38,9 @@ public:
 
   virtual const std::string name() const { return "CorelliCrossCorrelate"; };
   virtual int version() const { return 1; };
-  virtual const std::string category() const { return "Diffraction;Events"; };
+  virtual const std::string category() const {
+    return "Diffraction\\Calibration;Events";
+  };
   virtual const std::string summary() const {
     return "Cross-correlation calculation for the elastic signal from Corelli.";
   };
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/CorrectFlightPaths.h b/Framework/Algorithms/inc/MantidAlgorithms/CorrectFlightPaths.h
index 61f9af81665233cfed427fa36c491d2ed87dd182..fdf84863bfaceeddb50be8acdb6e056a9727a657 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/CorrectFlightPaths.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/CorrectFlightPaths.h
@@ -59,7 +59,7 @@ public:
   virtual int version() const { return 1; }
   /// Algorithm's category for identification overriding a virtual method
   virtual const std::string category() const {
-    return "Inelastic;CorrectionFunctions";
+    return "Inelastic\\Corrections;CorrectionFunctions\\InstrumentCorrections";
   }
 
 private:
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/CorrectKiKf.h b/Framework/Algorithms/inc/MantidAlgorithms/CorrectKiKf.h
index 74461bdac7475ba7311471a6a215775ca7589cd2..7f34bb2341ea36336506075f76cca12205cc1aba 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/CorrectKiKf.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/CorrectKiKf.h
@@ -77,7 +77,7 @@ public:
   virtual int version() const { return 1; }
   /// Algorithm's category for identification overriding a virtual method
   virtual const std::string category() const {
-    return "Inelastic;CorrectionFunctions";
+    return "Inelastic\\Corrections;CorrectionFunctions\\SpecialCorrections";
   }
 
 private:
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/CreateCalFileByNames.h b/Framework/Algorithms/inc/MantidAlgorithms/CreateCalFileByNames.h
index b08c31518d03ebccf944fe15fab65df517b2f631..01a55b6591363b7ae5e3e3c2664990364485883a 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/CreateCalFileByNames.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/CreateCalFileByNames.h
@@ -78,7 +78,9 @@ public:
   /// Algorithm's version
   virtual int version() const { return (1); }
   /// Algorithm's category for identification
-  virtual const std::string category() const { return "Diffraction"; }
+  virtual const std::string category() const {
+    return "Diffraction\\DataHandling\\CalFiles";
+  }
 
 private:
   /// Calibration entries map
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/CreateDummyCalFile.h b/Framework/Algorithms/inc/MantidAlgorithms/CreateDummyCalFile.h
index 45533564bac1612568d677049167b608cb4b161f..4e7afe46a0afdf4e573108f7f89345011ac4208e 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/CreateDummyCalFile.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/CreateDummyCalFile.h
@@ -77,7 +77,9 @@ public:
   /// Algorithm's version
   virtual int version() const { return (1); }
   /// Algorithm's category for identification
-  virtual const std::string category() const { return "Diffraction"; }
+  virtual const std::string category() const {
+    return "Diffraction\\DataHandling\\CalFiles";
+  }
 
 private:
   /// Calibration entries map
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/CreateLogPropertyTable.h b/Framework/Algorithms/inc/MantidAlgorithms/CreateLogPropertyTable.h
index 95f2007cb131715c663d15ecb923bfb97a9515f4..dfe932d32dcb60842dc597767e99f56dcc0d3eb7 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/CreateLogPropertyTable.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/CreateLogPropertyTable.h
@@ -46,9 +46,7 @@ public:
   /// Algorithm's version for identification
   virtual int version() const { return 1; };
   /// Algorithm's category for identification
-  virtual const std::string category() const {
-    return "Utility;PythonAlgorithms";
-  }
+  virtual const std::string category() const { return "Utility\\Workspaces"; }
 
   /// Algorithm's summary
   virtual const std::string summary() const {
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/CreatePeaksWorkspace.h b/Framework/Algorithms/inc/MantidAlgorithms/CreatePeaksWorkspace.h
index c3f292d378538b8319c34c9d41fd105093d46d7a..c0c282adfc7101da8cf2a77707fb282c9c98f202 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/CreatePeaksWorkspace.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/CreatePeaksWorkspace.h
@@ -28,7 +28,7 @@ public:
   virtual int version() const { return 1; };
   /// Algorithm's category for identification
   virtual const std::string category() const {
-    return "Crystal;Utility\\Workspaces";
+    return "Crystal\\Peaks;Utility\\Workspaces";
   }
 
 private:
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/CrossCorrelate.h b/Framework/Algorithms/inc/MantidAlgorithms/CrossCorrelate.h
index b838209bd507f5211a6ba421ccf6ae05d60e21c8..eb60ad91ab59c5774af661ff71589a9fdc14f38f 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/CrossCorrelate.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/CrossCorrelate.h
@@ -77,7 +77,7 @@ public:
   /// Algorithm's version
   virtual int version() const { return (1); }
   /// Algorithm's category for identification
-  virtual const std::string category() const { return "Utility;Arithmetic"; }
+  virtual const std::string category() const { return "Arithmetic"; }
 
 private:
   /// Initialisation code
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/DetectorEfficiencyCor.h b/Framework/Algorithms/inc/MantidAlgorithms/DetectorEfficiencyCor.h
index fb04a5798109743d4df59576460ceaa481a33397..b704249198ea1298b07fb579b0990c132186b59e 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/DetectorEfficiencyCor.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/DetectorEfficiencyCor.h
@@ -99,7 +99,7 @@ public:
   virtual int version() const { return 1; }
   /// Algorithm's category for identification overriding a virtual method
   virtual const std::string category() const {
-    return "CorrectionFunctions\\EfficiencyCorrections;Inelastic";
+    return "CorrectionFunctions\\EfficiencyCorrections;Inelastic\\Corrections";
   }
 
 private:
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/DiffractionEventCalibrateDetectors.h b/Framework/Algorithms/inc/MantidAlgorithms/DiffractionEventCalibrateDetectors.h
index 8de127e43e516871c0ebcc052d7f4dcd01b977aa..1006e23e28146a7486835a84c08eccf964c8b1e7 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/DiffractionEventCalibrateDetectors.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/DiffractionEventCalibrateDetectors.h
@@ -59,7 +59,8 @@ public:
   virtual int version() const { return 1; }
   /// Algorithm's category for identification overriding a virtual method
   virtual const std::string category() const {
-    return "Diffraction;CorrectionFunctions\\InstrumentCorrections";
+    return "Diffraction\\Calibration;"
+           "CorrectionFunctions\\InstrumentCorrections";
   }
   /// Function to optimize
   double intensity(double x, double y, double z, double rotx, double roty,
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/DiffractionFocussing.h b/Framework/Algorithms/inc/MantidAlgorithms/DiffractionFocussing.h
index 0129bbe3fc808f680526d57a0ee6bfd9a60599eb..91bcfabd0154c9b7f85dd7bfe0854bdf5d80a5e2 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/DiffractionFocussing.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/DiffractionFocussing.h
@@ -80,7 +80,9 @@ public:
   /// Algorithm's version for identification overriding a virtual method
   virtual int version() const { return 1; }
   /// Algorithm's category for identification overriding a virtual method
-  virtual const std::string category() const { return "Diffraction"; }
+  virtual const std::string category() const {
+    return "Diffraction\\Focussing";
+  }
 
 private:
   // Overridden Algorithm methods
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/DiffractionFocussing2.h b/Framework/Algorithms/inc/MantidAlgorithms/DiffractionFocussing2.h
index 8edd177c766099f0cc3a829ed75d3bde8477a4fa..724f8b22bde59291d32211994e0ba04864f6f6c8 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/DiffractionFocussing2.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/DiffractionFocussing2.h
@@ -97,7 +97,9 @@ public:
   /// Algorithm's version for identification overriding a virtual method
   virtual int version() const { return 2; }
   /// Algorithm's category for identification overriding a virtual method
-  virtual const std::string category() const { return "Diffraction"; }
+  virtual const std::string category() const {
+    return "Diffraction\\Focussing";
+  }
 
 private:
   // Overridden Algorithm methods
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/ElasticWindow.h b/Framework/Algorithms/inc/MantidAlgorithms/ElasticWindow.h
index e39755c66092c0bd131970d59f1b63cc5064ca50..fbe8726b3c96f77128c4537a196429d0cc7366cc 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/ElasticWindow.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/ElasticWindow.h
@@ -55,7 +55,7 @@ public:
   /// Algorithm's version
   virtual int version() const { return (1); }
   /// Algorithm's category for identification
-  virtual const std::string category() const { return "Inelastic"; }
+  virtual const std::string category() const { return "Inelastic\\Indirect"; }
 
 private:
   /// Initialisation code
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/ExponentialCorrection.h b/Framework/Algorithms/inc/MantidAlgorithms/ExponentialCorrection.h
index e42e08f93ef99d79ebac308dca866ebe7d2faa19..64594b52efd5faec550a73f4b69fec80dc2ac276 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/ExponentialCorrection.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/ExponentialCorrection.h
@@ -68,9 +68,7 @@ public:
   /// Algorithm's version for identification
   virtual int version() const { return 1; }
   /// Algorithm's category for identification overriding a virtual method
-  virtual const std::string category() const {
-    return "CorrectionFunctions;Arithmetic";
-  }
+  virtual const std::string category() const { return "CorrectionFunctions"; }
 
 private:
   // Overridden UnaryOperation methods
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/ExportTimeSeriesLog.h b/Framework/Algorithms/inc/MantidAlgorithms/ExportTimeSeriesLog.h
index e4def97d3da9b53ddac9408fd0e597e6d08f0d8f..4e6b85a772104fdaabfa4c327306a82981e46653 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/ExportTimeSeriesLog.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/ExportTimeSeriesLog.h
@@ -44,7 +44,7 @@ public:
   virtual const std::string name() const { return "ExportTimeSeriesLog"; };
   virtual int version() const { return 1; };
   virtual const std::string category() const {
-    return "Diffraction;Events\\EventFiltering";
+    return "Diffraction\\DataHandling;Events\\EventFiltering";
   };
 
   /// Summary of algorithms purpose
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/FindPeakBackground.h b/Framework/Algorithms/inc/MantidAlgorithms/FindPeakBackground.h
index 25443414ec02844abd0e363f6926c0246ffc809f..e29dd69b107b333c88b0071039a2cbfd195ebd25 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/FindPeakBackground.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/FindPeakBackground.h
@@ -46,7 +46,7 @@ public:
   virtual int version() const { return 1; }
 
   /// Algorithm's category for identification overriding a virtual method
-  virtual const std::string category() const { return "Utility"; }
+  virtual const std::string category() const { return "Utility\\Calculation"; }
 
 private:
   std::string m_backgroundType; //< The type of background to fit
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/FixGSASInstrumentFile.h b/Framework/Algorithms/inc/MantidAlgorithms/FixGSASInstrumentFile.h
index 64359d367ed2edfd02dd5eee575a91bc1ff2f7be..6c32a3897278e47721e92d7f4a1365f08a0667ee 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/FixGSASInstrumentFile.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/FixGSASInstrumentFile.h
@@ -46,7 +46,9 @@ public:
   virtual int version() const { return 1; }
 
   /// Algorithm's category for identification overriding a virtual method
-  virtual const std::string category() const { return "Diffraction"; }
+  virtual const std::string category() const {
+    return "Diffraction\\DataHandling";
+  }
 
 private:
   /// Implement abstract Algorithm methods
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/GenerateIPythonNotebook.h b/Framework/Algorithms/inc/MantidAlgorithms/GenerateIPythonNotebook.h
index 126afef6d20446b353571ccb22daf282e8006d36..fa720c8015368b3505a3b9b8b563bb68820821e7 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/GenerateIPythonNotebook.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/GenerateIPythonNotebook.h
@@ -55,7 +55,7 @@ public:
   /// Algorithm's version for identification
   virtual int version() const { return 1; };
   /// Algorithm's category for identification
-  virtual const std::string category() const { return "Utility\\Development"; }
+  virtual const std::string category() const { return "Utility\\Python"; }
 
 protected:
   /// Initialise the properties
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/GeneratePeaks.h b/Framework/Algorithms/inc/MantidAlgorithms/GeneratePeaks.h
index faf07c8aa8cbda0399fc4c2a96152b142f9ba2f4..72d42a456a3de349c61312dcb9f1f083eee972d7 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/GeneratePeaks.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/GeneratePeaks.h
@@ -55,7 +55,7 @@ public:
   /// Algorithm's version for identification overriding a virtual method
   virtual int version() const { return 1; }
   /// Algorithm's category for identification overriding a virtual method
-  virtual const std::string category() const { return "Crystal"; }
+  virtual const std::string category() const { return "Crystal\\Peaks"; }
 
 private:
   void init();
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/GeneratePythonScript.h b/Framework/Algorithms/inc/MantidAlgorithms/GeneratePythonScript.h
index 23df6bb7a6d9922c2af8cda5919dec6606891beb..923a9874432cac4c2192d4a2911ed6cc93e4ad04 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/GeneratePythonScript.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/GeneratePythonScript.h
@@ -58,7 +58,7 @@ public:
   /// Algorithm's version for identification
   virtual int version() const { return 1; };
   /// Algorithm's category for identification
-  virtual const std::string category() const { return "Utility\\Development"; }
+  virtual const std::string category() const { return "Utility\\Python"; }
 
 protected:
   /// Initialise the properties
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/GetAllEi.h b/Framework/Algorithms/inc/MantidAlgorithms/GetAllEi.h
index 155d8fc2d45d2c6bfa0310962dcfe8cef81e6614..032a4e243a82751e6f67e0766b7dbac2645b0820 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/GetAllEi.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/GetAllEi.h
@@ -50,7 +50,7 @@ public:
   /// Algorithm's version for identification. @see Algorithm::version
   virtual int version() const { return 1; };
   /// Algorithm's category for identification. @see Algorithm::category
-  virtual const std::string category() const { return "Inelastic"; };
+  virtual const std::string category() const { return "Inelastic\\Ei"; };
   /// Cross-check properties with each other @see IAlgorithm::validateInputs
   virtual std::map<std::string, std::string> validateInputs();
 
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/GetDetOffsetsMultiPeaks.h b/Framework/Algorithms/inc/MantidAlgorithms/GetDetOffsetsMultiPeaks.h
index 24bc3aae46e27bcc984148689a62ced1ece93d3d..999606ea9024decd205e1a183f5972d5d80c7ccf 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/GetDetOffsetsMultiPeaks.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/GetDetOffsetsMultiPeaks.h
@@ -77,7 +77,9 @@ public:
   /// Algorithm's version for identification overriding a virtual method
   virtual int version() const { return 1; }
   /// Algorithm's category for identification overriding a virtual method
-  virtual const std::string category() const { return "Diffraction"; }
+  virtual const std::string category() const {
+    return "Diffraction\\Calibration";
+  }
   /// Summary of algorithms purpose
   virtual const std::string summary() const {
     return "Creates an OffsetsWorkspace containing offsets for each detector. "
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/GetDetectorOffsets.h b/Framework/Algorithms/inc/MantidAlgorithms/GetDetectorOffsets.h
index f03558bbd63e3f7eaddcdf53b9c8df4d798e160e..56acc0c580db75893e48d928004d7bb5d7bae2a0 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/GetDetectorOffsets.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/GetDetectorOffsets.h
@@ -52,7 +52,9 @@ public:
   /// Algorithm's version for identification overriding a virtual method
   virtual int version() const { return 1; }
   /// Algorithm's category for identification overriding a virtual method
-  virtual const std::string category() const { return "Diffraction"; }
+  virtual const std::string category() const {
+    return "Diffraction\\Calibration";
+  }
 
 private:
   // Overridden Algorithm methods
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/GetEi.h b/Framework/Algorithms/inc/MantidAlgorithms/GetEi.h
index 142764543de6c3d1e525eec5cdef10d6122acf81..d725b1c49d5f398bd0de6f649d73750a4c8e3d6e 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/GetEi.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/GetEi.h
@@ -63,9 +63,7 @@ public:
   /// Algorithm's version for identification overriding a virtual method
   virtual int version() const { return 1; }
   /// Algorithm's category for identification overriding a virtual method
-  virtual const std::string category() const {
-    return "Inelastic; CorrectionFunctions";
-  }
+  virtual const std::string category() const { return "Inelastic\\Ei"; }
 
 private:
   /// name of the tempory workspace that we create and use
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/GetEi2.h b/Framework/Algorithms/inc/MantidAlgorithms/GetEi2.h
index 04cd146e7cf984fc094795db2ac7bb63c938d35f..a10e88a84a8710d1f6b8766f8ef961921ffb5353 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/GetEi2.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/GetEi2.h
@@ -69,7 +69,7 @@ public:
   /// Algorithm's version for identification overriding a virtual method
   virtual int version() const { return 2; }
   /// Algorithm's category for identification overriding a virtual method
-  virtual const std::string category() const { return "Inelastic"; }
+  virtual const std::string category() const { return "Inelastic\\Ei"; }
 
 private:
   /// Calculate Ei from the initial guess given
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/GetTimeSeriesLogInformation.h b/Framework/Algorithms/inc/MantidAlgorithms/GetTimeSeriesLogInformation.h
index 8c86c243fa1fc17ce08374ad17a38a4e1cc1d928..c4eb9c613434a8a8d4dfa695285c0b736b6115ce 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/GetTimeSeriesLogInformation.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/GetTimeSeriesLogInformation.h
@@ -52,7 +52,7 @@ public:
 
   virtual int version() const { return 1; }
   virtual const std::string category() const {
-    return "Diffraction;Events\\EventFiltering";
+    return "Diffraction\\Utility;Events\\EventFiltering";
   }
 
 private:
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/HRPDSlabCanAbsorption.h b/Framework/Algorithms/inc/MantidAlgorithms/HRPDSlabCanAbsorption.h
index 76bae633d192488bc03771923116ae3de9e4c59f..d5a7a77d6b9dd743384a46367893c298e8eeb547 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/HRPDSlabCanAbsorption.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/HRPDSlabCanAbsorption.h
@@ -84,7 +84,9 @@ public:
   /// Algorithm's version
   virtual int version() const { return (1); }
   /// Algorithm's category for identification
-  virtual const std::string category() const { return "Diffraction"; }
+  virtual const std::string category() const {
+    return "CorrectionFunctions\\AbsorptionCorrections";
+  }
 
 private:
   /// Initialisation code
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/MaskDetectorsIf.h b/Framework/Algorithms/inc/MantidAlgorithms/MaskDetectorsIf.h
index 8188ac663a49542c7e003111f53cc7819d2d4c3f..04e873386600621a50d0183269e8790bcfd6153c 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/MaskDetectorsIf.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/MaskDetectorsIf.h
@@ -62,7 +62,7 @@ public:
   virtual int version() const { return 1; }
   /// Algorithm's category for identification overriding a virtual method
   virtual const std::string category() const {
-    return "Diffraction;Transforms\\Masking";
+    return "Diffraction\\Masking;Transforms\\Masking";
   }
 
 private:
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/MergeRuns.h b/Framework/Algorithms/inc/MantidAlgorithms/MergeRuns.h
index f7f1a2366a0356572dc5ff857b2947b511bb634a..1e621a4d88bb9b7fa885dff18e73b7af319b572d 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/MergeRuns.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/MergeRuns.h
@@ -76,7 +76,7 @@ public:
   /// Algorithm's version for identification overriding a virtual method
   virtual int version() const { return 1; }
   /// Algorithm's category for identification overriding a virtual method
-  virtual const std::string category() const { return "Arithmetic"; }
+  virtual const std::string category() const { return "Transforms\\Merging"; }
   // Overriden MultiPeriodGroupAlgorithm method.
   bool useCustomInputPropertyName() const;
 
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/MultiplyRange.h b/Framework/Algorithms/inc/MantidAlgorithms/MultiplyRange.h
index dbb52400672cc5ecd91274039b9b48cf0f3947b3..de043e5a875b132e16c75960c56338c3ff051b79 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/MultiplyRange.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/MultiplyRange.h
@@ -59,7 +59,9 @@ public:
   }
 
   virtual int version() const { return (1); }
-  virtual const std::string category() const { return "CorrectionFunctions"; }
+  virtual const std::string category() const {
+    return "Arithmetic;CorrectionFunctions";
+  }
 
 private:
   /// Initialisation code
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/PDFFourierTransform.h b/Framework/Algorithms/inc/MantidAlgorithms/PDFFourierTransform.h
index 4c89a4e7cb8906f450d20870698021366fc03c14..af8174281d90bd5d94c93f2f1a82c1d049e22ab5 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/PDFFourierTransform.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/PDFFourierTransform.h
@@ -25,8 +25,7 @@ public:
   /// Algorithm's version for identification
   virtual int version() const;
   /// Algorithm's category for identification
-  virtual const std::string
-  category() const; // category better be in diffraction than general
+  virtual const std::string category() const;
   /// @copydoc Algorithm::validateInputs()
   virtual std::map<std::string, std::string> validateInputs();
 
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/PointByPointVCorrection.h b/Framework/Algorithms/inc/MantidAlgorithms/PointByPointVCorrection.h
index ec1b48fec471b15284c4db1d02cee78d762917d9..36fb658bc7609695498a9a355fd97fca5a1ae33b 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/PointByPointVCorrection.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/PointByPointVCorrection.h
@@ -51,7 +51,7 @@ public:
   virtual int version() const { return 1; }
   /// Algorithm's category for identification overriding a virtual method
   virtual const std::string category() const {
-    return "Diffraction;CorrectionFunctions\\SpecialCorrections";
+    return "Diffraction\\Corrections;CorrectionFunctions\\SpecialCorrections";
   }
 
 private:
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/ReadGroupsFromFile.h b/Framework/Algorithms/inc/MantidAlgorithms/ReadGroupsFromFile.h
index 81115c430ab233007bdc3fae6281a07e18de4e50..6bca1d9920db406ccf6844bcb9d97e1ff9b05780 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/ReadGroupsFromFile.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/ReadGroupsFromFile.h
@@ -93,7 +93,9 @@ public:
   /// Algorithm's version
   virtual int version() const { return (1); }
   /// Algorithm's category for identification
-  virtual const std::string category() const { return "Diffraction"; }
+  virtual const std::string category() const {
+    return "Diffraction\\DataHandling\\CalFiles";
+  }
 
 private:
   /// Map containing the detector entries found in the *.cal file. The key is
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/RecordPythonScript.h b/Framework/Algorithms/inc/MantidAlgorithms/RecordPythonScript.h
index d7cb61e4ca93eb76ceec3513c51de7fbc7e632f0..aacb41687518b6e172d1bd3648392724427b6a38 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/RecordPythonScript.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/RecordPythonScript.h
@@ -57,9 +57,7 @@ public:
   /// Algorithm's version for identification
   virtual int version() const { return 1; };
   /// Algorithm's category for identification
-  virtual const std::string category() const {
-    return "Utility;PythonAlgorithms";
-  }
+  virtual const std::string category() const { return "Utility\\Python"; }
 
 private:
   /// Initialise the properties
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/RemoveBackground.h b/Framework/Algorithms/inc/MantidAlgorithms/RemoveBackground.h
index ec2b284a5b89200f154a28c23522a4811f3ac5b1..25bc1d7dc7582771262c88105a1cf205822a8e1d 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/RemoveBackground.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/RemoveBackground.h
@@ -105,7 +105,7 @@ public:
   virtual int version() const { return 1; }
   /// Algorithm's category for identification overriding a virtual method
   virtual const std::string category() const {
-    return "Transforms\\RemoveBackground";
+    return "CorrectionFunctions\\BackgroundCorrections";
   }
 
 protected:
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/ReplaceSpecialValues.h b/Framework/Algorithms/inc/MantidAlgorithms/ReplaceSpecialValues.h
index 52b5618c38dcb6c6b9da90c8095907aca697f2b4..230b841e913cda17d60449f0c30293553798c405 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/ReplaceSpecialValues.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/ReplaceSpecialValues.h
@@ -71,7 +71,7 @@ public:
   virtual int version() const { return 1; }
   /// Algorithm's category for identification
   virtual const std::string category() const {
-    return "Utility;CorrectionFunctions\\SpecialCorrections";
+    return "CorrectionFunctions\\SpecialCorrections";
   }
 
 private:
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/RingProfile.h b/Framework/Algorithms/inc/MantidAlgorithms/RingProfile.h
index 5aaad3edab20d37a1ada4cf754d5cb2083b23f5d..20d4260fbfc2c8ad861eeebf363242157703a248 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/RingProfile.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/RingProfile.h
@@ -48,7 +48,7 @@ public:
   }
 
   virtual int version() const { return 1; };
-  virtual const std::string category() const { return "Transforms"; };
+  virtual const std::string category() const { return "Transforms\\Grouping"; };
 
 protected:
   boost::shared_ptr<API::Progress> m_progress;
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/SaveGSASInstrumentFile.h b/Framework/Algorithms/inc/MantidAlgorithms/SaveGSASInstrumentFile.h
index 1a0b8b8e908eff0085d98ba58c6a420bfa3e4d74..c53091d43df01a1524780c7138a11db3a0935887 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/SaveGSASInstrumentFile.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/SaveGSASInstrumentFile.h
@@ -52,7 +52,9 @@ public:
   /// Algorithm's version
   virtual int version() const { return (1); }
   /// Algorithm's category for identification
-  virtual const std::string category() const { return "Diffraction"; }
+  virtual const std::string category() const {
+    return "Diffraction\\DataHandling";
+  }
 
 private:
   /// Initialisation code
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/SofQW.h b/Framework/Algorithms/inc/MantidAlgorithms/SofQW.h
index c3b992b717f8f042fd10567bf0f15860d5ab61ac..fedd8db995e038b4f5d1e5f754847344c62fab7d 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/SofQW.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/SofQW.h
@@ -58,7 +58,7 @@ public:
   /// Algorithm's version
   virtual int version() const { return (1); }
   /// Algorithm's category for identification
-  virtual const std::string category() const { return "Inelastic"; }
+  virtual const std::string category() const { return "Inelastic\\SofQW"; }
   /// Create the output workspace
   static API::MatrixWorkspace_sptr
   setUpOutputWorkspace(API::MatrixWorkspace_const_sptr inputWorkspace,
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/SofQWCentre.h b/Framework/Algorithms/inc/MantidAlgorithms/SofQWCentre.h
index edc3788489edc44fadc6c411ce37150758766570..2c58ba1eea516ba62260e78d0d83452cac27fef6 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/SofQWCentre.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/SofQWCentre.h
@@ -67,7 +67,7 @@ public:
   /// Algorithm's version
   virtual int version() const { return (1); }
   /// Algorithm's category for identification
-  virtual const std::string category() const { return "Inelastic"; }
+  virtual const std::string category() const { return "Inelastic\\SofQW"; }
   /// Create the output workspace
   static API::MatrixWorkspace_sptr
   setUpOutputWorkspace(API::MatrixWorkspace_const_sptr inputWorkspace,
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/SofQWPolygon.h b/Framework/Algorithms/inc/MantidAlgorithms/SofQWPolygon.h
index d64338d96828e11982b536d697323ff977c13800..7a2e5a6096cec12f6d9a2f783cb75b581c37816f 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/SofQWPolygon.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/SofQWPolygon.h
@@ -72,7 +72,7 @@ public:
   /// Algorithm's version for identification
   virtual int version() const { return 1; }
   /// Algorithm's category for identification
-  virtual const std::string category() const { return "Inelastic"; }
+  virtual const std::string category() const { return "Inelastic\\SofQW"; }
 
 private:
   /// Initialize the algorithm
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/SortEvents.h b/Framework/Algorithms/inc/MantidAlgorithms/SortEvents.h
index dbb110decd15454e47f8b623994b7fb58f903d31..0e73a668ea47d74a08523bd9214c4f20eefc6335 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/SortEvents.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/SortEvents.h
@@ -58,7 +58,9 @@ public:
   /// Algorithm's version for identification overriding a virtual method
   virtual int version() const { return 1; }
   /// Algorithm's category for identification overriding a virtual method
-  virtual const std::string category() const { return "Events"; }
+  virtual const std::string category() const {
+    return "Events;Utility\\Sorting";
+  }
 
 protected:
   // Overridden Algorithm methods
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/StripPeaks.h b/Framework/Algorithms/inc/MantidAlgorithms/StripPeaks.h
index eacde19b9542a61b6f2249e75172e064dd79f52a..c66778824b46b898a0cc0433d1bcc9adc3f1beb8 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/StripPeaks.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/StripPeaks.h
@@ -72,7 +72,7 @@ public:
   virtual int version() const { return (1); }
   /// Algorithm's category for identification
   virtual const std::string category() const {
-    return "CorrectionFunctions;Optimization\\PeakFinding";
+    return "CorrectionFunctions\\PeakCorrections;Optimization\\PeakFinding";
   }
 
 private:
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/StripVanadiumPeaks.h b/Framework/Algorithms/inc/MantidAlgorithms/StripVanadiumPeaks.h
index 262bf33ee52797963c5859faa40555aa7c1c4769..30726dcf11eb4858bf05ad25a7c5113141a97675 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/StripVanadiumPeaks.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/StripVanadiumPeaks.h
@@ -75,7 +75,8 @@ public:
   virtual int version() const { return (1); }
   /// Algorithm's category for identification
   virtual const std::string category() const {
-    return "CorrectionFunctions;Optimization\\PeakFinding;Diffraction";
+    return "CorrectionFunctions\\PeakCorrections;Optimization\\PeakFinding;"
+           "Diffraction\\Corrections";
   }
 
 private:
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/StripVanadiumPeaks2.h b/Framework/Algorithms/inc/MantidAlgorithms/StripVanadiumPeaks2.h
index 2b3a663a28d0f45f70798de47793310c1ea1446a..70d4b8d7e016bb53d304e1de99e1f4f75237b3a2 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/StripVanadiumPeaks2.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/StripVanadiumPeaks2.h
@@ -44,7 +44,8 @@ public:
   virtual int version() const { return 2; }
   /// Algorithm's category for identification
   virtual const std::string category() const {
-    return "CorrectionFunctions;Optimization\\PeakFinding;Diffraction";
+    return "CorrectionFunctions\\PeakCorrections;Optimization\\PeakFinding;"
+           "Diffraction\\Corrections";
   }
   /// Summary of algorithms purpose
   virtual const std::string summary() const {
diff --git a/Framework/Algorithms/src/AlignDetectors.cpp b/Framework/Algorithms/src/AlignDetectors.cpp
index 742f56343e698b4fae2c524d7927248922e68e0c..8448870195221ebd5bbaeaa945535b05ec1fdbcc 100644
--- a/Framework/Algorithms/src/AlignDetectors.cpp
+++ b/Framework/Algorithms/src/AlignDetectors.cpp
@@ -145,7 +145,9 @@ const std::string AlignDetectors::name() const { return "AlignDetectors"; }
 
 int AlignDetectors::version() const { return 1; }
 
-const std::string AlignDetectors::category() const { return "Diffraction"; }
+const std::string AlignDetectors::category() const {
+  return "Diffraction\\Calibration";
+}
 
 const std::string AlignDetectors::summary() const {
   return "Performs a unit change from TOF to dSpacing, correcting the X "
diff --git a/Framework/Algorithms/src/CalculateDIFC.cpp b/Framework/Algorithms/src/CalculateDIFC.cpp
index 0c8dc30be7a38f0a327df0b6b2a3017ed1243e94..96520e66fb4cbc0222a677db652bcf2687cf9358 100644
--- a/Framework/Algorithms/src/CalculateDIFC.cpp
+++ b/Framework/Algorithms/src/CalculateDIFC.cpp
@@ -36,7 +36,9 @@ const std::string CalculateDIFC::name() const { return "CalculateDIFC"; }
 int CalculateDIFC::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
-const std::string CalculateDIFC::category() const { return "Diffraction"; }
+const std::string CalculateDIFC::category() const {
+  return "Diffraction\\Utility";
+}
 
 /// Algorithm's summary for use in the GUI and help. @see Algorithm::summary
 const std::string CalculateDIFC::summary() const {
diff --git a/Framework/Algorithms/src/ClearMaskFlag.cpp b/Framework/Algorithms/src/ClearMaskFlag.cpp
index ba16cd12b7f8044256c751457a1aa14eeb3b6a06..bf5db63795b465225a350e9fbd96140665c9263c 100644
--- a/Framework/Algorithms/src/ClearMaskFlag.cpp
+++ b/Framework/Algorithms/src/ClearMaskFlag.cpp
@@ -27,7 +27,9 @@ const std::string ClearMaskFlag::name() const { return "ClearMaskFlag"; }
 int ClearMaskFlag::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
-const std::string ClearMaskFlag::category() const { return "Utility"; }
+const std::string ClearMaskFlag::category() const {
+  return "Transforms\\Masking";
+}
 
 //----------------------------------------------------------------------------------------------
 /** Initialize the algorithm's properties.
diff --git a/Framework/Algorithms/src/Comment.cpp b/Framework/Algorithms/src/Comment.cpp
index d09c984008fa599b17c28f3ce06efecadc5d3c44..277fdeeabcc3a97c0cf740d35c2f2b4e9830365b 100644
--- a/Framework/Algorithms/src/Comment.cpp
+++ b/Framework/Algorithms/src/Comment.cpp
@@ -31,7 +31,7 @@ const std::string Comment::name() const { return "Comment"; }
 int Comment::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
-const std::string Comment::category() const { return "DataHandling"; }
+const std::string Comment::category() const { return "Utility\\Workspaces"; }
 
 /// Algorithm's summary for use in the GUI and help. @see Algorithm::summary
 const std::string Comment::summary() const {
diff --git a/Framework/Algorithms/src/ConvertDiffCal.cpp b/Framework/Algorithms/src/ConvertDiffCal.cpp
index 6b887627b9f8d8e1872b4d38544145bf10c5c7a9..9190f08166e12b14a24597dc32b082ceee162850 100644
--- a/Framework/Algorithms/src/ConvertDiffCal.cpp
+++ b/Framework/Algorithms/src/ConvertDiffCal.cpp
@@ -44,7 +44,9 @@ const std::string ConvertDiffCal::name() const { return "ConvertDiffCal"; }
 int ConvertDiffCal::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
-const std::string ConvertDiffCal::category() const { return "Diffraction"; }
+const std::string ConvertDiffCal::category() const {
+  return "Diffraction\\Utility";
+}
 
 /// Algorithm's summary for use in the GUI and help. @see Algorithm::summary
 const std::string ConvertDiffCal::summary() const {
diff --git a/Framework/Algorithms/src/DetectorEfficiencyCorUser.cpp b/Framework/Algorithms/src/DetectorEfficiencyCorUser.cpp
index 88085ac6165e01bc82d870d1f087876049b6f9a2..35f01d9ab32b06457b07900e2006ccb368f49e53 100644
--- a/Framework/Algorithms/src/DetectorEfficiencyCorUser.cpp
+++ b/Framework/Algorithms/src/DetectorEfficiencyCorUser.cpp
@@ -38,7 +38,7 @@ int DetectorEfficiencyCorUser::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string DetectorEfficiencyCorUser::category() const {
-  return "CorrectionFunctions\\EfficiencyCorrections;Inelastic";
+  return "CorrectionFunctions\\EfficiencyCorrections;Inelastic\\Corrections";
 }
 
 //----------------------------------------------------------------------------------------------
diff --git a/Framework/Algorithms/src/EditInstrumentGeometry.cpp b/Framework/Algorithms/src/EditInstrumentGeometry.cpp
index 929265f98cb1651fbac943be21c829d1c1971655..60bb3606852676310fd8831dab3155462411c132 100644
--- a/Framework/Algorithms/src/EditInstrumentGeometry.cpp
+++ b/Framework/Algorithms/src/EditInstrumentGeometry.cpp
@@ -32,7 +32,7 @@ const std::string EditInstrumentGeometry::name() const {
 }
 
 const std::string EditInstrumentGeometry::category() const {
-  return "Diffraction";
+  return "Diffraction\\DataHandling;DataHandling\\Instrument";
 }
 
 int EditInstrumentGeometry::version() const { return 1; }
diff --git a/Framework/Algorithms/src/EstimateResolutionDiffraction.cpp b/Framework/Algorithms/src/EstimateResolutionDiffraction.cpp
index 22889f58a46289d350254477958cc2d8b2a5e05a..2c39dfdf1fd20134c28b40ca86667af244aea883 100644
--- a/Framework/Algorithms/src/EstimateResolutionDiffraction.cpp
+++ b/Framework/Algorithms/src/EstimateResolutionDiffraction.cpp
@@ -61,7 +61,7 @@ const std::string EstimateResolutionDiffraction::summary() const {
 int EstimateResolutionDiffraction::version() const { return 1; }
 
 const std::string EstimateResolutionDiffraction::category() const {
-  return "Diffraction";
+  return "Diffraction\\Utility";
 }
 
 //----------------------------------------------------------------------------------------------
diff --git a/Framework/Algorithms/src/LorentzCorrection.cpp b/Framework/Algorithms/src/LorentzCorrection.cpp
index b83c575d271cfecb3d9583b4fa27a821a738e865..e60e563f6c1b570533e950ea0b97680ce00cef75 100644
--- a/Framework/Algorithms/src/LorentzCorrection.cpp
+++ b/Framework/Algorithms/src/LorentzCorrection.cpp
@@ -34,7 +34,9 @@ LorentzCorrection::~LorentzCorrection() {}
 int LorentzCorrection::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
-const std::string LorentzCorrection::category() const { return "Crystal"; }
+const std::string LorentzCorrection::category() const {
+  return "Crystal\\Corrections";
+}
 
 /// Algorithm's summary for use in the GUI and help. @see Algorithm::summary
 const std::string LorentzCorrection::summary() const {
diff --git a/Framework/Algorithms/src/PDFFourierTransform.cpp b/Framework/Algorithms/src/PDFFourierTransform.cpp
index c535813ba1e16eb49cdb089c19f3a28d6dbf4c1e..ff91ab5cf25bbd550358b38f7a63f31ec7c662b7 100644
--- a/Framework/Algorithms/src/PDFFourierTransform.cpp
+++ b/Framework/Algorithms/src/PDFFourierTransform.cpp
@@ -51,7 +51,7 @@ const std::string PDFFourierTransform::name() const {
 int PDFFourierTransform::version() const { return 1; }
 
 const std::string PDFFourierTransform::category() const {
-  return "Diffraction";
+  return "Diffraction\\Utility";
 }
 
 //----------------------------------------------------------------------------------------------
diff --git a/Framework/Algorithms/src/RadiusSum.cpp b/Framework/Algorithms/src/RadiusSum.cpp
index cdf1233ec48ca35dc0b98cfdb44d6ca93cfb2002..d9894b7def1a7bcdbf14c065d4ace5e4abe384eb 100644
--- a/Framework/Algorithms/src/RadiusSum.cpp
+++ b/Framework/Algorithms/src/RadiusSum.cpp
@@ -39,7 +39,7 @@ const std::string RadiusSum::name() const { return "RadiusSum"; }
 int RadiusSum::version() const { return 1; }
 
 /// Algorithm's category for identification.
-const std::string RadiusSum::category() const { return "Transforms"; }
+const std::string RadiusSum::category() const { return "Transforms\\Grouping"; }
 
 //----------------------------------------------------------------------------------------------
 
diff --git a/Framework/Algorithms/src/RemoveLowResTOF.cpp b/Framework/Algorithms/src/RemoveLowResTOF.cpp
index 47c65f788a2dcedd00454e6deedd04158edf912f..94f1cfa956888ee30c8d8441151b610858a1ff7b 100644
--- a/Framework/Algorithms/src/RemoveLowResTOF.cpp
+++ b/Framework/Algorithms/src/RemoveLowResTOF.cpp
@@ -42,7 +42,9 @@ const string RemoveLowResTOF::name() const { return "RemoveLowResTOF"; }
 int RemoveLowResTOF::version() const { return 1; }
 
 /// Algorithm's category for identification overriding a virtual method
-const string RemoveLowResTOF::category() const { return "Diffraction"; }
+const string RemoveLowResTOF::category() const {
+  return "Diffraction\\Corrections";
+}
 
 void RemoveLowResTOF::init() {
   auto wsValidator = boost::make_shared<CompositeValidator>();
diff --git a/Framework/Algorithms/src/RemoveWorkspaceHistory.cpp b/Framework/Algorithms/src/RemoveWorkspaceHistory.cpp
index 4d6ecc74b7c086e20ae676fb58379e41b5325b97..33f54b02eb7ce537f681df10905202dfde4428cd 100644
--- a/Framework/Algorithms/src/RemoveWorkspaceHistory.cpp
+++ b/Framework/Algorithms/src/RemoveWorkspaceHistory.cpp
@@ -30,7 +30,9 @@ const std::string RemoveWorkspaceHistory::name() const {
 int RemoveWorkspaceHistory::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
-const std::string RemoveWorkspaceHistory::category() const { return "Utility"; }
+const std::string RemoveWorkspaceHistory::category() const {
+  return "Utility\\Workspaces";
+}
 
 /// Algorithm's summary for identification. @see Algorithm::summary
 const std::string RemoveWorkspaceHistory::summary() const {
diff --git a/Framework/Algorithms/src/ResetNegatives.cpp b/Framework/Algorithms/src/ResetNegatives.cpp
index 695b8237766acd006e37905b21e70e281b91d4ed..18b109c3fc146f8f850cbf4948c5a0271466c1ec 100644
--- a/Framework/Algorithms/src/ResetNegatives.cpp
+++ b/Framework/Algorithms/src/ResetNegatives.cpp
@@ -29,7 +29,9 @@ const std::string ResetNegatives::name() const { return "ResetNegatives"; }
 int ResetNegatives::version() const { return 1; }
 
 /// @copydoc Mantid::API::IAlgorithm::category()
-const std::string ResetNegatives::category() const { return "Utility"; }
+const std::string ResetNegatives::category() const {
+  return "CorrectionFunctions\\SpecialCorrections";
+}
 
 //----------------------------------------------------------------------------------------------
 /// @copydoc Mantid::API::Algorithm::init()
diff --git a/Framework/Algorithms/src/SignalOverError.cpp b/Framework/Algorithms/src/SignalOverError.cpp
index 9d36340512c7e2d896b13d5280fa570ff412d6ed..b0524f7c9f3681621b6128004860d782e2390f1a 100644
--- a/Framework/Algorithms/src/SignalOverError.cpp
+++ b/Framework/Algorithms/src/SignalOverError.cpp
@@ -31,7 +31,9 @@ const std::string SignalOverError::name() const { return "SignalOverError"; }
 int SignalOverError::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
-const std::string SignalOverError::category() const { return "Arithmetic"; }
+const std::string SignalOverError::category() const {
+  return "Arithmetic\\Errors";
+}
 
 //----------------------------------------------------------------------------------------------
 
diff --git a/Framework/Algorithms/src/SofQWNormalisedPolygon.cpp b/Framework/Algorithms/src/SofQWNormalisedPolygon.cpp
index c48fcbc91855000f1ee1d893cf3fc60fe6ad978a..139c3356f855038c783a37f7ecc7554eff70fba0 100644
--- a/Framework/Algorithms/src/SofQWNormalisedPolygon.cpp
+++ b/Framework/Algorithms/src/SofQWNormalisedPolygon.cpp
@@ -48,7 +48,7 @@ int SofQWNormalisedPolygon::version() const { return 1; }
  * @return the category list for the Algorithm
  */
 const std::string SofQWNormalisedPolygon::category() const {
-  return "Inelastic";
+  return "Inelastic\\SofQW";
 }
 
 /**
diff --git a/Framework/Algorithms/src/UpdateScriptRepository.cpp b/Framework/Algorithms/src/UpdateScriptRepository.cpp
index 45e620542ce14a6f0d2a28b3e1af3f2bdea1df28..a0a8e10eb472ccaeadb9736b93f333fa94b0465e 100644
--- a/Framework/Algorithms/src/UpdateScriptRepository.cpp
+++ b/Framework/Algorithms/src/UpdateScriptRepository.cpp
@@ -28,7 +28,9 @@ const std::string UpdateScriptRepository::name() const {
 int UpdateScriptRepository::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
-const std::string UpdateScriptRepository::category() const { return "Utility"; }
+const std::string UpdateScriptRepository::category() const {
+  return "Utility\\Python";
+}
 
 //----------------------------------------------------------------------------------------------
 
diff --git a/Framework/Algorithms/src/VesuvioL1ThetaResolution.cpp b/Framework/Algorithms/src/VesuvioL1ThetaResolution.cpp
index 3fe533aa0a42e54d2158931e60ba95982d1bc15a..37967d046ec3eca00e3943bdd93dfcb3448c8d34 100644
--- a/Framework/Algorithms/src/VesuvioL1ThetaResolution.cpp
+++ b/Framework/Algorithms/src/VesuvioL1ThetaResolution.cpp
@@ -56,7 +56,7 @@ int VesuvioL1ThetaResolution::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string VesuvioL1ThetaResolution::category() const {
-  return "CorrectionFunctions";
+  return "CorrectionFunctions\\SpecialCorrections";
 }
 
 /// Algorithm's summary for use in the GUI and help. @see Algorithm::summary
diff --git a/Framework/Algorithms/test/AlignDetectorsTest.h b/Framework/Algorithms/test/AlignDetectorsTest.h
index 3c123b2ed977c615987f169cf89e4ea54cba0497..08155cdc729a746282f803943c0a702032b285d3 100644
--- a/Framework/Algorithms/test/AlignDetectorsTest.h
+++ b/Framework/Algorithms/test/AlignDetectorsTest.h
@@ -36,7 +36,6 @@ public:
   void testTheBasics() {
     TS_ASSERT_EQUALS(align.name(), "AlignDetectors");
     TS_ASSERT_EQUALS(align.version(), 1);
-    TS_ASSERT_EQUALS(align.category(), "Diffraction");
   }
 
   void testInit() {
diff --git a/Framework/Algorithms/test/DiffractionFocussing2Test.h b/Framework/Algorithms/test/DiffractionFocussing2Test.h
index d3fceddc9ed342fe43aba20f0772bc6697da9e32..59e85081f299adef2713c427bbeb563813382774 100644
--- a/Framework/Algorithms/test/DiffractionFocussing2Test.h
+++ b/Framework/Algorithms/test/DiffractionFocussing2Test.h
@@ -29,8 +29,6 @@ public:
 
   void testVersion() { TS_ASSERT_EQUALS(focus.version(), 2); }
 
-  void testCategory() { TS_ASSERT_EQUALS(focus.category(), "Diffraction"); }
-
   void testInit() {
     focus.initialize();
     TS_ASSERT(focus.isInitialized());
diff --git a/Framework/Algorithms/test/DiffractionFocussingTest.h b/Framework/Algorithms/test/DiffractionFocussingTest.h
index 824365c9dac5ba85cdb2b29bdee8308fdad1870b..5b7d83030c4a327c3c4b4c461fe546a096c31dba 100644
--- a/Framework/Algorithms/test/DiffractionFocussingTest.h
+++ b/Framework/Algorithms/test/DiffractionFocussingTest.h
@@ -16,8 +16,6 @@ public:
 
   void testVersion() { TS_ASSERT_EQUALS(focus.version(), 1); }
 
-  void testCategory() { TS_ASSERT_EQUALS(focus.category(), "Diffraction"); }
-
   void testInit() {
     focus.initialize();
     TS_ASSERT(focus.isInitialized());
diff --git a/Framework/Algorithms/test/ExponentialCorrectionTest.h b/Framework/Algorithms/test/ExponentialCorrectionTest.h
index 6872490ad631c5a6ad06325c1f9d31d98b75e3f6..a1c1ee432b2c6e1c6c367e709a47b5df82ad11b3 100644
--- a/Framework/Algorithms/test/ExponentialCorrectionTest.h
+++ b/Framework/Algorithms/test/ExponentialCorrectionTest.h
@@ -18,10 +18,6 @@ public:
 
   void testVersion() { TS_ASSERT_EQUALS(expon.version(), 1) }
 
-  void testCategory() {
-    TS_ASSERT_EQUALS(expon.category(), "CorrectionFunctions;Arithmetic")
-  }
-
   void testInit() {
     Mantid::Algorithms::ExponentialCorrection expon2;
     TS_ASSERT_THROWS_NOTHING(expon2.initialize())
diff --git a/Framework/Algorithms/test/GetDetOffsetsMultiPeaksTest.h b/Framework/Algorithms/test/GetDetOffsetsMultiPeaksTest.h
index e97478f610248938d99ae8859e94dfb4840ddf5d..640af864ac022a5ee84bc67a0c3728491b8853ef 100644
--- a/Framework/Algorithms/test/GetDetOffsetsMultiPeaksTest.h
+++ b/Framework/Algorithms/test/GetDetOffsetsMultiPeaksTest.h
@@ -32,7 +32,6 @@ public:
   void testTheBasics() {
     TS_ASSERT_EQUALS(offsets.name(), "GetDetOffsetsMultiPeaks");
     TS_ASSERT_EQUALS(offsets.version(), 1);
-    TS_ASSERT_EQUALS(offsets.category(), "Diffraction");
   }
 
   void testInit() {
diff --git a/Framework/Algorithms/test/GetDetectorOffsetsTest.h b/Framework/Algorithms/test/GetDetectorOffsetsTest.h
index 0b0c908ed57b81ac340c07048dc5bde7357c3961..fe45227052a7ce87ff2374792ef56eb46f58bfd9 100644
--- a/Framework/Algorithms/test/GetDetectorOffsetsTest.h
+++ b/Framework/Algorithms/test/GetDetectorOffsetsTest.h
@@ -29,7 +29,6 @@ public:
   void testTheBasics() {
     TS_ASSERT_EQUALS(offsets.name(), "GetDetectorOffsets");
     TS_ASSERT_EQUALS(offsets.version(), 1);
-    TS_ASSERT_EQUALS(offsets.category(), "Diffraction");
   }
 
   void testInit() {
diff --git a/Framework/Algorithms/test/HRPDSlabCanAbsorptionTest.h b/Framework/Algorithms/test/HRPDSlabCanAbsorptionTest.h
index 9122302b36b981a93859831255f9736afafff5e4..4d577a5057130f84914d80fb89884a31acaa905e 100644
--- a/Framework/Algorithms/test/HRPDSlabCanAbsorptionTest.h
+++ b/Framework/Algorithms/test/HRPDSlabCanAbsorptionTest.h
@@ -17,8 +17,6 @@ public:
 
   void testVersion() { TS_ASSERT_EQUALS(atten.version(), 1); }
 
-  void testCategory() { TS_ASSERT_EQUALS(atten.category(), "Diffraction"); }
-
   void testInit() {
     TS_ASSERT_THROWS_NOTHING(atten.initialize());
     TS_ASSERT(atten.isInitialized());
diff --git a/Framework/Algorithms/test/MultiplyRangeTest.h b/Framework/Algorithms/test/MultiplyRangeTest.h
index c9a71ba0a514924b17f0c6a079c32e03054682f4..1dae36bdeec7f6d6a7bc0557d2c9f2aab1421b2f 100644
--- a/Framework/Algorithms/test/MultiplyRangeTest.h
+++ b/Framework/Algorithms/test/MultiplyRangeTest.h
@@ -14,10 +14,6 @@ public:
 
   void testVersion() { TS_ASSERT_EQUALS(mr.version(), 1); }
 
-  void testCategory() {
-    TS_ASSERT_EQUALS(mr.category(), "CorrectionFunctions");
-  }
-
   void testInit() {
     TS_ASSERT_THROWS_NOTHING(mr.initialize());
     TS_ASSERT(mr.isInitialized());
diff --git a/Framework/Algorithms/test/SofQWCentreTest.h b/Framework/Algorithms/test/SofQWCentreTest.h
index d3848430dea52eb584b4b457a372539bc1d56b08..8190b361b2867f7cb5d199c8fd2c66d9f2219235 100644
--- a/Framework/Algorithms/test/SofQWCentreTest.h
+++ b/Framework/Algorithms/test/SofQWCentreTest.h
@@ -21,11 +21,6 @@ public:
     TS_ASSERT_EQUALS(sqw.version(), 1);
   }
 
-  void testCategory() {
-    Mantid::Algorithms::SofQWCentre sqw;
-    TS_ASSERT_EQUALS(sqw.category(), "Inelastic");
-  }
-
   void testInit() {
     Mantid::Algorithms::SofQWCentre sqw;
     TS_ASSERT_THROWS_NOTHING(sqw.initialize());
diff --git a/Framework/Algorithms/test/SofQWTest.h b/Framework/Algorithms/test/SofQWTest.h
index 289a0cdefb43e3db4b1f00bb715072f58851e9b2..0b5c658e78af557ebfeb3fc9a039b56a42b4517e 100644
--- a/Framework/Algorithms/test/SofQWTest.h
+++ b/Framework/Algorithms/test/SofQWTest.h
@@ -61,11 +61,6 @@ public:
     TS_ASSERT_EQUALS(sqw.version(), 1);
   }
 
-  void testCategory() {
-    Mantid::Algorithms::SofQW sqw;
-    TS_ASSERT_EQUALS(sqw.category(), "Inelastic");
-  }
-
   void testInit() {
     Mantid::Algorithms::SofQW sqw;
     TS_ASSERT_THROWS_NOTHING(sqw.initialize());
diff --git a/Framework/Crystal/inc/MantidCrystal/AnvredCorrection.h b/Framework/Crystal/inc/MantidCrystal/AnvredCorrection.h
index 4295b5631f8930178a96d71fab48822a151c1e77..5dc83b6a6246be690dac624e6f9f143435f775e6 100644
--- a/Framework/Crystal/inc/MantidCrystal/AnvredCorrection.h
+++ b/Framework/Crystal/inc/MantidCrystal/AnvredCorrection.h
@@ -91,7 +91,7 @@ public:
   virtual int version() const { return 1; }
   /// Algorithm's category for identification overriding a virtual method
   virtual const std::string category() const {
-    return "Crystal;CorrectionFunctions\\AbsorptionCorrections";
+    return "Crystal\\Corrections;CorrectionFunctions\\AbsorptionCorrections";
   }
 
 protected:
diff --git a/Framework/Crystal/inc/MantidCrystal/CalculateUMatrix.h b/Framework/Crystal/inc/MantidCrystal/CalculateUMatrix.h
index 56c1d741d6cace832c97b126d987a24412287d41..d751904acbe466ed6669898ea43d038d40f3728c 100644
--- a/Framework/Crystal/inc/MantidCrystal/CalculateUMatrix.h
+++ b/Framework/Crystal/inc/MantidCrystal/CalculateUMatrix.h
@@ -50,7 +50,7 @@ public:
   /// Algorithm's version for identification
   virtual int version() const { return 1; };
   /// Algorithm's category for identification
-  virtual const std::string category() const { return "Crystal"; }
+  virtual const std::string category() const { return "Crystal\\UBMatrix"; }
 
 private:
   /// Initialise the properties
diff --git a/Framework/Crystal/inc/MantidCrystal/CentroidPeaks.h b/Framework/Crystal/inc/MantidCrystal/CentroidPeaks.h
index 11da1579c8bcb5ec1efb31481b83b6035cea1603..9c50fb9f1da82952ddf743563a473e7b25cf085d 100644
--- a/Framework/Crystal/inc/MantidCrystal/CentroidPeaks.h
+++ b/Framework/Crystal/inc/MantidCrystal/CentroidPeaks.h
@@ -31,7 +31,7 @@ public:
   /// Algorithm's version for identification
   virtual int version() const { return 1; };
   /// Algorithm's category for identification
-  virtual const std::string category() const { return "Crystal"; }
+  virtual const std::string category() const { return "Crystal\\Peaks"; }
 
 private:
   /// Initialise the properties
diff --git a/Framework/Crystal/inc/MantidCrystal/FindSXPeaks.h b/Framework/Crystal/inc/MantidCrystal/FindSXPeaks.h
index 5ab61ce0b15ae310e3a02d99687e3841e825e010..6597e066ae790822207ad47136b6d2cf02cebbcb 100644
--- a/Framework/Crystal/inc/MantidCrystal/FindSXPeaks.h
+++ b/Framework/Crystal/inc/MantidCrystal/FindSXPeaks.h
@@ -208,7 +208,7 @@ public:
   virtual int version() const { return (1); }
   /// Algorithm's category for identification overriding a virtual method
   virtual const std::string category() const {
-    return "Crystal;Optimization\\PeakFinding";
+    return "Crystal\\Peaks;Optimization\\PeakFinding";
   }
 
 private:
diff --git a/Framework/Crystal/inc/MantidCrystal/FindUBUsingIndexedPeaks.h b/Framework/Crystal/inc/MantidCrystal/FindUBUsingIndexedPeaks.h
index 24fa813fabfa2bfce3b1423c544a03fdd665adef..d7f6c41dd7f51f663919e283dab96ddb561acbe3 100644
--- a/Framework/Crystal/inc/MantidCrystal/FindUBUsingIndexedPeaks.h
+++ b/Framework/Crystal/inc/MantidCrystal/FindUBUsingIndexedPeaks.h
@@ -46,7 +46,7 @@ public:
   virtual int version() const { return 1; };
 
   /// Algorithm's category for identification
-  virtual const std::string category() const { return "Crystal"; }
+  virtual const std::string category() const { return "Crystal\\UBMatrix"; }
 
   /// Summary of algorithms purpose
   virtual const std::string summary() const {
diff --git a/Framework/Crystal/inc/MantidCrystal/FindUBUsingLatticeParameters.h b/Framework/Crystal/inc/MantidCrystal/FindUBUsingLatticeParameters.h
index fe5473c091451e1ef5dca7a7f93bce59b6f6b9e0..b1663d84cdeb39d9154f1d48421a215b36332fab 100644
--- a/Framework/Crystal/inc/MantidCrystal/FindUBUsingLatticeParameters.h
+++ b/Framework/Crystal/inc/MantidCrystal/FindUBUsingLatticeParameters.h
@@ -48,7 +48,7 @@ public:
   virtual int version() const { return 1; };
 
   /// Algorithm's category for identification
-  virtual const std::string category() const { return "Crystal"; }
+  virtual const std::string category() const { return "Crystal\\UBMatrix"; }
 
   /// Summary of algorithms purpose
   virtual const std::string summary() const {
diff --git a/Framework/Crystal/inc/MantidCrystal/GoniometerAnglesFromPhiRotation.h b/Framework/Crystal/inc/MantidCrystal/GoniometerAnglesFromPhiRotation.h
index 27ce997768d89531004ef51eaf02b3c1c684d48a..a146bed77921b4126dd88d318b8dc9ddba03185a 100644
--- a/Framework/Crystal/inc/MantidCrystal/GoniometerAnglesFromPhiRotation.h
+++ b/Framework/Crystal/inc/MantidCrystal/GoniometerAnglesFromPhiRotation.h
@@ -59,7 +59,7 @@ public:
   int version() const { return 1; }
 
   /// Algorithm's category for identification
-  const std::string category() const { return "Crystal"; }
+  const std::string category() const { return "Crystal\\Goniometer"; }
 
 private:
   /// Initialise the properties
diff --git a/Framework/Crystal/inc/MantidCrystal/IndexPeaks.h b/Framework/Crystal/inc/MantidCrystal/IndexPeaks.h
index 2f1b8572676b5fde5749ddd3edcf09e0df4ab182..7d0d4f7c3fbee28e83421b4d7a1b42fbfaabacf7 100644
--- a/Framework/Crystal/inc/MantidCrystal/IndexPeaks.h
+++ b/Framework/Crystal/inc/MantidCrystal/IndexPeaks.h
@@ -50,7 +50,7 @@ public:
   virtual int version() const { return 1; }
 
   /// Algorithm's category for identification
-  virtual const std::string category() const { return "Crystal"; }
+  virtual const std::string category() const { return "Crystal\\Peaks"; }
 
 private:
   /// Initialise the properties
diff --git a/Framework/Crystal/inc/MantidCrystal/IndexSXPeaks.h b/Framework/Crystal/inc/MantidCrystal/IndexSXPeaks.h
index 32ecfd639c47c71958c120bdced4074a5952dcff..1da33074a3a1d2a41c059c46d2c34a6870962218 100644
--- a/Framework/Crystal/inc/MantidCrystal/IndexSXPeaks.h
+++ b/Framework/Crystal/inc/MantidCrystal/IndexSXPeaks.h
@@ -170,7 +170,7 @@ public:
   /// Algorithm's version for identification overriding a virtual method
   virtual int version() const { return (1); }
   /// Algorithm's category for identification overriding a virtual method
-  virtual const std::string category() const { return "Crystal"; }
+  virtual const std::string category() const { return "Crystal\\Peaks"; }
 
 private:
   // Helper method to cull potential hkls off each peak.
diff --git a/Framework/Crystal/inc/MantidCrystal/IntegratePeakTimeSlices.h b/Framework/Crystal/inc/MantidCrystal/IntegratePeakTimeSlices.h
index 8ed7fea923b19c26e3dc95110b44b7a0c15b51c2..613ea215729143b6b8c21771123cf83f0bd0d775 100644
--- a/Framework/Crystal/inc/MantidCrystal/IntegratePeakTimeSlices.h
+++ b/Framework/Crystal/inc/MantidCrystal/IntegratePeakTimeSlices.h
@@ -242,7 +242,7 @@ public:
   virtual int version() const { return 1; }
 
   /// Algorithm's category for identification overriding a virtual method
-  virtual const std::string category() const { return "Crystal"; }
+  virtual const std::string category() const { return "Crystal\\Integration"; }
 
 private:
   void init();
diff --git a/Framework/Crystal/inc/MantidCrystal/LoadHKL.h b/Framework/Crystal/inc/MantidCrystal/LoadHKL.h
index 80c07b2f9d44e96c0d6a7680f84a56530b4864da..0e14642c8711e91c9f6d7719caabd0755fddd6e1 100644
--- a/Framework/Crystal/inc/MantidCrystal/LoadHKL.h
+++ b/Framework/Crystal/inc/MantidCrystal/LoadHKL.h
@@ -32,7 +32,7 @@ public:
   virtual int version() const { return 1; };
   /// Algorithm's category for identification
   virtual const std::string category() const {
-    return "Crystal;DataHandling\\Text";
+    return "Crystal\\DataHandling;DataHandling\\Text";
   }
 
 private:
diff --git a/Framework/Crystal/inc/MantidCrystal/LoadIsawPeaks.h b/Framework/Crystal/inc/MantidCrystal/LoadIsawPeaks.h
index f051bc0a419caa4d5082e0b14bdc4c526ff882c6..1ecb3c3c954cc50d4c6bdf35e63a4a2d53148943 100644
--- a/Framework/Crystal/inc/MantidCrystal/LoadIsawPeaks.h
+++ b/Framework/Crystal/inc/MantidCrystal/LoadIsawPeaks.h
@@ -34,7 +34,7 @@ public:
 
   /// Algorithm's category for identification
   virtual const std::string category() const {
-    return "Crystal;DataHandling\\Isaw";
+    return "Crystal\\DataHandling;DataHandling\\Isaw";
   }
 
   /// Returns a confidence value that this algorithm can load a file
diff --git a/Framework/Crystal/inc/MantidCrystal/LoadIsawSpectrum.h b/Framework/Crystal/inc/MantidCrystal/LoadIsawSpectrum.h
index 25b61df20dcbfda5bfecd9ab9bbdc94b5ff52b9a..d47e54ad963637cd03cc259332103cc3d90f5c78 100644
--- a/Framework/Crystal/inc/MantidCrystal/LoadIsawSpectrum.h
+++ b/Framework/Crystal/inc/MantidCrystal/LoadIsawSpectrum.h
@@ -48,7 +48,7 @@ public:
   virtual int version() const { return 1; };
   /// Algorithm's category for identification
   virtual const std::string category() const {
-    return "Crystal;DataHandling\\Text";
+    return "Crystal\\DataHandling;DataHandling\\Text";
   }
 
 private:
diff --git a/Framework/Crystal/inc/MantidCrystal/LoadIsawUB.h b/Framework/Crystal/inc/MantidCrystal/LoadIsawUB.h
index e0573fcd12ba55bc8faa8ff7cc2fc554d8017eea..c8d3bbd95f1ad47c53f175db5b089b022eaf029f 100644
--- a/Framework/Crystal/inc/MantidCrystal/LoadIsawUB.h
+++ b/Framework/Crystal/inc/MantidCrystal/LoadIsawUB.h
@@ -31,7 +31,7 @@ public:
   virtual int version() const { return 1; };
   /// Algorithm's category for identification
   virtual const std::string category() const {
-    return "Crystal;DataHandling\\Isaw";
+    return "Crystal\\DataHandling;DataHandling\\Isaw";
   }
 
 private:
diff --git a/Framework/Crystal/inc/MantidCrystal/MaskPeaksWorkspace.h b/Framework/Crystal/inc/MantidCrystal/MaskPeaksWorkspace.h
index 678bbedbcbae13c45f512bd3b1f7fa33010d5873..ba171d73bd6d866f6a46ffefb63c6c9687742182 100644
--- a/Framework/Crystal/inc/MantidCrystal/MaskPeaksWorkspace.h
+++ b/Framework/Crystal/inc/MantidCrystal/MaskPeaksWorkspace.h
@@ -48,7 +48,7 @@ public:
   /// Algorithm's version for identification overriding a virtual method
   virtual int version() const { return 1; }
   /// Algorithm's category for identification overriding a virtual method
-  virtual const std::string category() const { return "Crystal"; }
+  virtual const std::string category() const { return "Crystal\\Peaks"; }
 
   /// Summary of algorithms purpose
   virtual const std::string summary() const {
diff --git a/Framework/Crystal/inc/MantidCrystal/NormaliseVanadium.h b/Framework/Crystal/inc/MantidCrystal/NormaliseVanadium.h
index b05dc00745959767bfe7bd28f9cee9f222893d7c..80381cf1984b38b35408ffbe2e2dbb9a276e05ad 100644
--- a/Framework/Crystal/inc/MantidCrystal/NormaliseVanadium.h
+++ b/Framework/Crystal/inc/MantidCrystal/NormaliseVanadium.h
@@ -62,7 +62,7 @@ public:
   virtual int version() const { return 1; }
   /// Algorithm's category for identification overriding a virtual method
   virtual const std::string category() const {
-    return "Crystal;CorrectionFunctions\\NormalisationCorrections";
+    return "Crystal\\Corrections;CorrectionFunctions\\NormalisationCorrections";
   }
 
 protected:
diff --git a/Framework/Crystal/inc/MantidCrystal/OptimizeCrystalPlacement.h b/Framework/Crystal/inc/MantidCrystal/OptimizeCrystalPlacement.h
index 58140a6af2e1498b591098741e24942b18e0d6e2..3fe3a68dd1f25bf62ae180437b11807fd8503c10 100644
--- a/Framework/Crystal/inc/MantidCrystal/OptimizeCrystalPlacement.h
+++ b/Framework/Crystal/inc/MantidCrystal/OptimizeCrystalPlacement.h
@@ -60,7 +60,7 @@ public:
 
   virtual int version() const { return 1; };
 
-  const std::string category() const { return "Crystal"; };
+  const std::string category() const { return "Crystal\\Corrections"; };
 
 private:
   void init();
diff --git a/Framework/Crystal/inc/MantidCrystal/OptimizeExtinctionParameters.h b/Framework/Crystal/inc/MantidCrystal/OptimizeExtinctionParameters.h
index aa205743f47756380403ab56897db2dc75c4594d..c03704c4590d91f3804d8af0f46771473d1a1a86 100644
--- a/Framework/Crystal/inc/MantidCrystal/OptimizeExtinctionParameters.h
+++ b/Framework/Crystal/inc/MantidCrystal/OptimizeExtinctionParameters.h
@@ -57,7 +57,7 @@ public:
   /// Algorithm's version for identification overriding a virtual method
   virtual int version() const { return 1; }
   /// Algorithm's category for identification overriding a virtual method
-  virtual const std::string category() const { return "Crystal"; }
+  virtual const std::string category() const { return "Crystal\\Corrections"; }
   /// Call TOFExtinction as a Child Algorithm to get statistics of the peaks
   double fitMosaic(double mosaic, double rcrystallite, std::string inname,
                    std::string corrOption, std::string pointOption,
diff --git a/Framework/Crystal/inc/MantidCrystal/OptimizeLatticeForCellType.h b/Framework/Crystal/inc/MantidCrystal/OptimizeLatticeForCellType.h
index 038c50820a1ee2a1501af418be31b1984e21f2d8..bd6df7fe2ec061c9e74795d6005111aa789ea20c 100644
--- a/Framework/Crystal/inc/MantidCrystal/OptimizeLatticeForCellType.h
+++ b/Framework/Crystal/inc/MantidCrystal/OptimizeLatticeForCellType.h
@@ -60,7 +60,7 @@ public:
   /// Algorithm's version for identification overriding a virtual method
   virtual int version() const { return 1; }
   /// Algorithm's category for identification overriding a virtual method
-  virtual const std::string category() const { return "Crystal"; }
+  virtual const std::string category() const { return "Crystal\\Cell"; }
 
   API::ILatticeFunction_sptr
   getLatticeFunction(const std::string &cellType,
diff --git a/Framework/Crystal/inc/MantidCrystal/PeakIntegration.h b/Framework/Crystal/inc/MantidCrystal/PeakIntegration.h
index 028c61d021d65404745c4822a059dda6aeed5747..9613a020b3b14d65ec0be05e7d5a00423130ae58 100644
--- a/Framework/Crystal/inc/MantidCrystal/PeakIntegration.h
+++ b/Framework/Crystal/inc/MantidCrystal/PeakIntegration.h
@@ -48,7 +48,7 @@ public:
   /// Algorithm's version for identification overriding a virtual method
   virtual int version() const { return 1; }
   /// Algorithm's category for identification overriding a virtual method
-  virtual const std::string category() const { return "Crystal"; }
+  virtual const std::string category() const { return "Crystal\\Integration"; }
   /// Summary of algorithms purpose
   virtual const std::string summary() const {
     return "Integrate single crystal peaks using IkedaCarpenter fit TOF";
diff --git a/Framework/Crystal/inc/MantidCrystal/PredictFractionalPeaks.h b/Framework/Crystal/inc/MantidCrystal/PredictFractionalPeaks.h
index 2b7360467fa55dbb30a3ed07e3a350d62c87443b..4237b5526679524ec8ed44e9ba94f895f93ff1a4 100644
--- a/Framework/Crystal/inc/MantidCrystal/PredictFractionalPeaks.h
+++ b/Framework/Crystal/inc/MantidCrystal/PredictFractionalPeaks.h
@@ -52,7 +52,7 @@ public:
   virtual int version() const { return 1; };
 
   /// Algorithm's category for identification
-  virtual const std::string category() const { return "Crystal"; }
+  virtual const std::string category() const { return "Crystal\\Peaks"; }
 
 private:
   /// Initialise the properties
diff --git a/Framework/Crystal/inc/MantidCrystal/PredictPeaks.h b/Framework/Crystal/inc/MantidCrystal/PredictPeaks.h
index 22c014451fbf75b5665ef0165dc1c844a996b1d5..b3fcb7eeae95b907be9ce0bbb70cba994c7004f6 100644
--- a/Framework/Crystal/inc/MantidCrystal/PredictPeaks.h
+++ b/Framework/Crystal/inc/MantidCrystal/PredictPeaks.h
@@ -37,7 +37,7 @@ public:
   /// Algorithm's version for identification
   virtual int version() const { return 1; };
   /// Algorithm's category for identification
-  virtual const std::string category() const { return "Crystal"; }
+  virtual const std::string category() const { return "Crystal\\Peaks"; }
 
 private:
   /// Initialise the properties
diff --git a/Framework/Crystal/inc/MantidCrystal/SaveHKL.h b/Framework/Crystal/inc/MantidCrystal/SaveHKL.h
index 887e0496097bb3064e63f13c4ddb3cccdd91a838..bf11a810394ef7a33868beb498d3502875bae8ab 100644
--- a/Framework/Crystal/inc/MantidCrystal/SaveHKL.h
+++ b/Framework/Crystal/inc/MantidCrystal/SaveHKL.h
@@ -30,7 +30,7 @@ public:
   virtual int version() const { return 1; };
   /// Algorithm's category for identification
   virtual const std::string category() const {
-    return "Crystal;DataHandling\\Text";
+    return "Crystal\\DataHandling;DataHandling\\Text";
   }
 
 private:
diff --git a/Framework/Crystal/inc/MantidCrystal/SaveIsawPeaks.h b/Framework/Crystal/inc/MantidCrystal/SaveIsawPeaks.h
index f4435bc545f764535f51b6b561c8d4d8c16c49a5..f58ef01c10342fa24185b1da4ee253c14763c9fc 100644
--- a/Framework/Crystal/inc/MantidCrystal/SaveIsawPeaks.h
+++ b/Framework/Crystal/inc/MantidCrystal/SaveIsawPeaks.h
@@ -28,7 +28,7 @@ public:
   virtual int version() const { return 1; };
   /// Algorithm's category for identification
   virtual const std::string category() const {
-    return "Crystal;DataHandling\\Isaw";
+    return "Crystal\\DataHandling;DataHandling\\Isaw";
   }
 
 private:
diff --git a/Framework/Crystal/inc/MantidCrystal/SaveIsawUB.h b/Framework/Crystal/inc/MantidCrystal/SaveIsawUB.h
index 6ee866ca117f6f6bc1fb243225a2634402f81113..8d03536ed96a890b43bc99fa284313fbbdcfa545 100644
--- a/Framework/Crystal/inc/MantidCrystal/SaveIsawUB.h
+++ b/Framework/Crystal/inc/MantidCrystal/SaveIsawUB.h
@@ -54,7 +54,7 @@ public:
   virtual int version() const { return 1; };
   /// Algorithm's category for identification
   virtual const std::string category() const {
-    return "Crystal;DataHandling\\Isaw";
+    return "Crystal\\DataHandling;DataHandling\\Isaw";
   }
 
 private:
diff --git a/Framework/Crystal/inc/MantidCrystal/SaveLauenorm.h b/Framework/Crystal/inc/MantidCrystal/SaveLauenorm.h
index 9569e742acd321d24e6a42938e213c3642427904..3bcdc23c05355c19b1876e268292df41ad49246d 100644
--- a/Framework/Crystal/inc/MantidCrystal/SaveLauenorm.h
+++ b/Framework/Crystal/inc/MantidCrystal/SaveLauenorm.h
@@ -31,7 +31,7 @@ public:
   virtual int version() const { return 1; };
   /// Algorithm's category for identification
   virtual const std::string category() const {
-    return "Crystal;DataHandling\\Text";
+    return "Crystal\\DataHandling;DataHandling\\Text";
   }
 
 private:
diff --git a/Framework/Crystal/inc/MantidCrystal/SelectCellOfType.h b/Framework/Crystal/inc/MantidCrystal/SelectCellOfType.h
index 3a6ff5d0e2adf0f2a3b8db0c2bf99b0c723d1046..afe1bc0d206ad73fff995ef60b2f79db1548e31d 100644
--- a/Framework/Crystal/inc/MantidCrystal/SelectCellOfType.h
+++ b/Framework/Crystal/inc/MantidCrystal/SelectCellOfType.h
@@ -48,7 +48,7 @@ public:
   virtual int version() const { return 1; };
 
   /// Algorithm's category for identification
-  virtual const std::string category() const { return "Crystal"; }
+  virtual const std::string category() const { return "Crystal\\Cell"; }
 
   /// Summary of algorithms purpose
   virtual const std::string summary() const {
diff --git a/Framework/Crystal/inc/MantidCrystal/SelectCellWithForm.h b/Framework/Crystal/inc/MantidCrystal/SelectCellWithForm.h
index 98055f732833461a71e38cf382122df246e8ff2f..68d2fd5778e367b07672521ce60462ade420f70e 100644
--- a/Framework/Crystal/inc/MantidCrystal/SelectCellWithForm.h
+++ b/Framework/Crystal/inc/MantidCrystal/SelectCellWithForm.h
@@ -49,7 +49,7 @@ public:
   virtual int version() const { return 1; };
 
   /// Algorithm's category for identification
-  virtual const std::string category() const { return "Crystal"; }
+  virtual const std::string category() const { return "Crystal\\Cell"; }
 
   /// Summary of algorithms purpose
   virtual const std::string summary() const {
diff --git a/Framework/Crystal/inc/MantidCrystal/SetGoniometer.h b/Framework/Crystal/inc/MantidCrystal/SetGoniometer.h
index 3d6a729d173fd0ccea46fa08c9a21c853e84c6ce..e5f085e1920edcc0651ee169efaa9453c2bf07f7 100644
--- a/Framework/Crystal/inc/MantidCrystal/SetGoniometer.h
+++ b/Framework/Crystal/inc/MantidCrystal/SetGoniometer.h
@@ -29,7 +29,7 @@ public:
   /// Algorithm's version for identification
   virtual int version() const { return 1; };
   /// Algorithm's category for identification
-  virtual const std::string category() const { return "Crystal"; }
+  virtual const std::string category() const { return "Crystal\\Goniometer"; }
 
 private:
   /// Initialise the properties
diff --git a/Framework/Crystal/inc/MantidCrystal/ShowPeakHKLOffsets.h b/Framework/Crystal/inc/MantidCrystal/ShowPeakHKLOffsets.h
index 9e011c112de33ddfc82e17da823b22beaa6b447a..a45d12e500a22c6597d614e24b0139b89d0bab7d 100644
--- a/Framework/Crystal/inc/MantidCrystal/ShowPeakHKLOffsets.h
+++ b/Framework/Crystal/inc/MantidCrystal/ShowPeakHKLOffsets.h
@@ -57,7 +57,7 @@ public:
 
   virtual int version() const { return 1; };
 
-  const std::string category() const { return "Crystal"; };
+  const std::string category() const { return "Crystal\\Peaks"; };
 
 private:
   void init();
diff --git a/Framework/Crystal/inc/MantidCrystal/ShowPossibleCells.h b/Framework/Crystal/inc/MantidCrystal/ShowPossibleCells.h
index 4deb78a4e37a30348a6994081217bfc0bd6a487a..8922394c8925ff447f32e6ea3568db0a92f98744 100644
--- a/Framework/Crystal/inc/MantidCrystal/ShowPossibleCells.h
+++ b/Framework/Crystal/inc/MantidCrystal/ShowPossibleCells.h
@@ -48,7 +48,7 @@ public:
   virtual int version() const { return 1; };
 
   /// Algorithm's category for identification
-  virtual const std::string category() const { return "Crystal"; }
+  virtual const std::string category() const { return "Crystal\\Cell"; }
 
   /// Summary of algorithms purpose
   virtual const std::string summary() const {
diff --git a/Framework/Crystal/inc/MantidCrystal/SortHKL.h b/Framework/Crystal/inc/MantidCrystal/SortHKL.h
index 4455673c39bd67a673d2d4fdf6ac10a1abbacde3..ce4362c8c0f032245c78acea419ffa2f57d2b69e 100644
--- a/Framework/Crystal/inc/MantidCrystal/SortHKL.h
+++ b/Framework/Crystal/inc/MantidCrystal/SortHKL.h
@@ -32,7 +32,7 @@ public:
   virtual int version() const { return 1; };
   /// Algorithm's category for identification
   virtual const std::string category() const {
-    return "Crystal;DataHandling\\Text";
+    return "Crystal\\Peaks;DataHandling\\Text;Utility\\Sorting";
   }
 
 private:
diff --git a/Framework/Crystal/inc/MantidCrystal/StatisticsOfPeaksWorkspace.h b/Framework/Crystal/inc/MantidCrystal/StatisticsOfPeaksWorkspace.h
index f06fd8677bdcde848c14eba7358997c6f6011681..c7eb6d6d271a051e796e0a25d98622e7670c9096 100644
--- a/Framework/Crystal/inc/MantidCrystal/StatisticsOfPeaksWorkspace.h
+++ b/Framework/Crystal/inc/MantidCrystal/StatisticsOfPeaksWorkspace.h
@@ -32,7 +32,7 @@ public:
   virtual int version() const { return 1; };
   /// Algorithm's category for identification
   virtual const std::string category() const {
-    return "Crystal;DataHandling\\Text";
+    return "Crystal\\Peaks;DataHandling\\Text";
   }
 
 private:
diff --git a/Framework/Crystal/src/AddPeakHKL.cpp b/Framework/Crystal/src/AddPeakHKL.cpp
index 5483addc516d8c92035a27a6bb2472a42b62df7a..59540b48b47d5d2327d39eb6cdcdc56b63a3dc8e 100644
--- a/Framework/Crystal/src/AddPeakHKL.cpp
+++ b/Framework/Crystal/src/AddPeakHKL.cpp
@@ -34,7 +34,7 @@ const std::string AddPeakHKL::name() const { return "AddPeakHKL"; }
 int AddPeakHKL::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
-const std::string AddPeakHKL::category() const { return "Crystal"; }
+const std::string AddPeakHKL::category() const { return "Crystal\\Peaks"; }
 
 /// Algorithm's summary for use in the GUI and help. @see Algorithm::summary
 const std::string AddPeakHKL::summary() const {
diff --git a/Framework/Crystal/src/CalculatePeaksHKL.cpp b/Framework/Crystal/src/CalculatePeaksHKL.cpp
index aa6723c5af08996a8d3119595c803493a6afaaae..b2a1f05e718f4d18f399a0c25152f78714e9c160 100644
--- a/Framework/Crystal/src/CalculatePeaksHKL.cpp
+++ b/Framework/Crystal/src/CalculatePeaksHKL.cpp
@@ -34,7 +34,9 @@ const std::string CalculatePeaksHKL::name() const {
 int CalculatePeaksHKL::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
-const std::string CalculatePeaksHKL::category() const { return "Crystal"; }
+const std::string CalculatePeaksHKL::category() const {
+  return "Crystal\\Peaks";
+}
 
 //----------------------------------------------------------------------------------------------
 
diff --git a/Framework/Crystal/src/ClearUB.cpp b/Framework/Crystal/src/ClearUB.cpp
index df9f8e73fbf35714eb80fc9d3739744052a9abb2..883ccd7ad28f427859e691317705e0189e5827c2 100644
--- a/Framework/Crystal/src/ClearUB.cpp
+++ b/Framework/Crystal/src/ClearUB.cpp
@@ -28,7 +28,7 @@ const std::string ClearUB::name() const { return "ClearUB"; }
 int ClearUB::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
-const std::string ClearUB::category() const { return "Crystal"; }
+const std::string ClearUB::category() const { return "Crystal\\UBMatrix"; }
 
 //----------------------------------------------------------------------------------------------
 
diff --git a/Framework/Crystal/src/CombinePeaksWorkspaces.cpp b/Framework/Crystal/src/CombinePeaksWorkspaces.cpp
index 7e9fef2be5082acd67c04590b683b2ecf61a9591..292aae1d67d38ee168bd0aa2412a7df56f3db1ab 100644
--- a/Framework/Crystal/src/CombinePeaksWorkspaces.cpp
+++ b/Framework/Crystal/src/CombinePeaksWorkspaces.cpp
@@ -30,7 +30,9 @@ const std::string CombinePeaksWorkspaces::name() const {
 /// Algorithm's version for identification. @see Algorithm::version
 int CombinePeaksWorkspaces::version() const { return 1; }
 /// Algorithm's category for identification. @see Algorithm::category
-const std::string CombinePeaksWorkspaces::category() const { return "Crystal"; }
+const std::string CombinePeaksWorkspaces::category() const {
+  return "Crystal\\Peaks";
+}
 
 /** Initialises the algorithm's properties.
  */
diff --git a/Framework/Crystal/src/DiffPeaksWorkspaces.cpp b/Framework/Crystal/src/DiffPeaksWorkspaces.cpp
index 3e2e50614d576efef9a7a2f3bd44aa78bedacc49..69d29d1048e3310fedb10ad5fb048c18709e266d 100644
--- a/Framework/Crystal/src/DiffPeaksWorkspaces.cpp
+++ b/Framework/Crystal/src/DiffPeaksWorkspaces.cpp
@@ -29,7 +29,9 @@ const std::string DiffPeaksWorkspaces::name() const {
 /// Algorithm's version for identification. @see Algorithm::version
 int DiffPeaksWorkspaces::version() const { return 1; }
 /// Algorithm's category for identification. @see Algorithm::category
-const std::string DiffPeaksWorkspaces::category() const { return "Crystal"; }
+const std::string DiffPeaksWorkspaces::category() const {
+  return "Crystal\\Peaks";
+}
 
 /** Initialises the algorithm's properties.
  */
diff --git a/Framework/Crystal/src/FilterPeaks.cpp b/Framework/Crystal/src/FilterPeaks.cpp
index f60acecea9586ca7449801c11b174ecdbefd7e16..7c2540a4efa2fb7fc3da9b57eb74949874caecef 100644
--- a/Framework/Crystal/src/FilterPeaks.cpp
+++ b/Framework/Crystal/src/FilterPeaks.cpp
@@ -44,7 +44,7 @@ const std::string FilterPeaks::name() const { return "FilterPeaks"; }
 /// Algorithm's version for identification. @see Algorithm::version
 int FilterPeaks::version() const { return 1; }
 /// Algorithm's category for identification. @see Algorithm::category
-const std::string FilterPeaks::category() const { return "Crystal"; }
+const std::string FilterPeaks::category() const { return "Crystal\\Peaks"; }
 
 /** Initialize the algorithm's properties.
  */
diff --git a/Framework/Crystal/src/FindClusterFaces.cpp b/Framework/Crystal/src/FindClusterFaces.cpp
index 01d67008462935595c6304c39c178964251728e9..f8baf134b37bd4091616c4ad0894db3ebebfcdb5 100644
--- a/Framework/Crystal/src/FindClusterFaces.cpp
+++ b/Framework/Crystal/src/FindClusterFaces.cpp
@@ -266,7 +266,9 @@ const std::string FindClusterFaces::name() const { return "FindClusterFaces"; }
 int FindClusterFaces::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
-const std::string FindClusterFaces::category() const { return "Crystal"; }
+const std::string FindClusterFaces::category() const {
+  return "Crystal\\Integration";
+}
 
 //----------------------------------------------------------------------------------------------
 
diff --git a/Framework/Crystal/src/FindUBUsingFFT.cpp b/Framework/Crystal/src/FindUBUsingFFT.cpp
index 4be3531f733caeba602042b1e0507fbbc6b78456..7feea67b90f981c41b1a0c693e3bbfadb39aaa3b 100644
--- a/Framework/Crystal/src/FindUBUsingFFT.cpp
+++ b/Framework/Crystal/src/FindUBUsingFFT.cpp
@@ -28,7 +28,9 @@ const std::string FindUBUsingFFT::name() const { return "FindUBUsingFFT"; }
 
 int FindUBUsingFFT::version() const { return 1; }
 
-const std::string FindUBUsingFFT::category() const { return "Crystal"; }
+const std::string FindUBUsingFFT::category() const {
+  return "Crystal\\UBMatrix";
+}
 
 //--------------------------------------------------------------------------
 /** Initialize the algorithm's properties.
diff --git a/Framework/Crystal/src/FindUBUsingMinMaxD.cpp b/Framework/Crystal/src/FindUBUsingMinMaxD.cpp
index b008fe742f9166dc69725f1588fb6e5f64687e86..c8f888e0fdb7f54bf964a671217fc0c5556f8052 100644
--- a/Framework/Crystal/src/FindUBUsingMinMaxD.cpp
+++ b/Framework/Crystal/src/FindUBUsingMinMaxD.cpp
@@ -33,7 +33,9 @@ const std::string FindUBUsingMinMaxD::name() const {
 
 int FindUBUsingMinMaxD::version() const { return 1; }
 
-const std::string FindUBUsingMinMaxD::category() const { return "Crystal"; }
+const std::string FindUBUsingMinMaxD::category() const {
+  return "Crystal\\UBMatrix";
+}
 
 //--------------------------------------------------------------------------
 /** Initialize the algorithm's properties.
diff --git a/Framework/Crystal/src/HasUB.cpp b/Framework/Crystal/src/HasUB.cpp
index 37f74c329be79557c54e4df70497d7e71a80df8d..38ce273377944a3b0c546627376d46e9f61b7aa9 100644
--- a/Framework/Crystal/src/HasUB.cpp
+++ b/Framework/Crystal/src/HasUB.cpp
@@ -27,7 +27,7 @@ const std::string HasUB::name() const { return "HasUB"; }
 int HasUB::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
-const std::string HasUB::category() const { return "Crystal"; }
+const std::string HasUB::category() const { return "Crystal\\UBMatrix"; }
 
 //----------------------------------------------------------------------------------------------
 
diff --git a/Framework/Crystal/src/IntegratePeaksHybrid.cpp b/Framework/Crystal/src/IntegratePeaksHybrid.cpp
index 61293d241dec0d2354f96e56e41ecedb016f74fd..886f5cc4ea49278a11ab0a0428fdca9d12442bf5 100644
--- a/Framework/Crystal/src/IntegratePeaksHybrid.cpp
+++ b/Framework/Crystal/src/IntegratePeaksHybrid.cpp
@@ -102,7 +102,7 @@ int IntegratePeaksHybrid::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string IntegratePeaksHybrid::category() const {
-  return "MDAlgorithms";
+  return "MDAlgorithms\\Peaks;Crystal\\Integration";
 }
 
 //----------------------------------------------------------------------------------------------
diff --git a/Framework/Crystal/src/IntegratePeaksUsingClusters.cpp b/Framework/Crystal/src/IntegratePeaksUsingClusters.cpp
index 41727475e5924a404f49e09232eeb1b4472e335c..2ee8477d083154fa435d9b0b517a9bc1e76d20e0 100644
--- a/Framework/Crystal/src/IntegratePeaksUsingClusters.cpp
+++ b/Framework/Crystal/src/IntegratePeaksUsingClusters.cpp
@@ -47,7 +47,7 @@ int IntegratePeaksUsingClusters::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string IntegratePeaksUsingClusters::category() const {
-  return "MDAlgorithms";
+  return "MDAlgorithms\\Peaks;Crystal\\Integration";
 }
 
 //----------------------------------------------------------------------------------------------
diff --git a/Framework/Crystal/src/PeakIntensityVsRadius.cpp b/Framework/Crystal/src/PeakIntensityVsRadius.cpp
index 041cedeffcc00e3f3351e4c6c79724cc0d6e8492..9f21a085cc0b19a53043378980eaab4d751ec223 100644
--- a/Framework/Crystal/src/PeakIntensityVsRadius.cpp
+++ b/Framework/Crystal/src/PeakIntensityVsRadius.cpp
@@ -34,7 +34,9 @@ const std::string PeakIntensityVsRadius::name() const {
 int PeakIntensityVsRadius::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
-const std::string PeakIntensityVsRadius::category() const { return "Crystal"; }
+const std::string PeakIntensityVsRadius::category() const {
+  return "Crystal\\Integration";
+}
 
 //----------------------------------------------------------------------------------------------
 
diff --git a/Framework/Crystal/src/PeaksInRegion.cpp b/Framework/Crystal/src/PeaksInRegion.cpp
index 193af17761abbec97d9322237d800fbaf00db54c..45f836cc5289a6a354d794bf8b6c32e6550a4b39 100644
--- a/Framework/Crystal/src/PeaksInRegion.cpp
+++ b/Framework/Crystal/src/PeaksInRegion.cpp
@@ -31,7 +31,7 @@ const std::string PeaksInRegion::name() const { return "PeaksInRegion"; }
 int PeaksInRegion::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
-const std::string PeaksInRegion::category() const { return "Crystal"; }
+const std::string PeaksInRegion::category() const { return "Crystal\\Peaks"; }
 
 //----------------------------------------------------------------------------------------------
 
diff --git a/Framework/Crystal/src/PeaksOnSurface.cpp b/Framework/Crystal/src/PeaksOnSurface.cpp
index 8bf6cfc5c0d4c87c1638ecd5382ceb0fbea56684..9caae6967c6dcfb58f0992f6e45c82077f86214a 100644
--- a/Framework/Crystal/src/PeaksOnSurface.cpp
+++ b/Framework/Crystal/src/PeaksOnSurface.cpp
@@ -30,7 +30,7 @@ const std::string PeaksOnSurface::name() const { return "PeaksOnSurface"; }
 int PeaksOnSurface::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
-const std::string PeaksOnSurface::category() const { return "Crystal"; }
+const std::string PeaksOnSurface::category() const { return "Crystal\\Peaks"; }
 
 //----------------------------------------------------------------------------------------------
 
diff --git a/Framework/Crystal/src/SCDCalibratePanels.cpp b/Framework/Crystal/src/SCDCalibratePanels.cpp
index a33ffe0e7ec88dafc015f61850223d9de856c04c..27956f98b467436fdd8edc569c04375029212a6f 100644
--- a/Framework/Crystal/src/SCDCalibratePanels.cpp
+++ b/Framework/Crystal/src/SCDCalibratePanels.cpp
@@ -41,7 +41,9 @@ const std::string SCDCalibratePanels::name() const {
 
 int SCDCalibratePanels::version() const { return 1; }
 
-const std::string SCDCalibratePanels::category() const { return "Crystal"; }
+const std::string SCDCalibratePanels::category() const {
+  return "Crystal\\Corrections";
+}
 
 /**
  * Converts a Quaternion to a corresponding matrix produce Rotx*Roty*Rotz,
diff --git a/Framework/Crystal/src/SetSpecialCoordinates.cpp b/Framework/Crystal/src/SetSpecialCoordinates.cpp
index 28c6e5755b5ba2ab4a4db81dcf2c45ad9bd54dc5..80a1abc51a4f85193fda35049e0e709dc19b2051 100644
--- a/Framework/Crystal/src/SetSpecialCoordinates.cpp
+++ b/Framework/Crystal/src/SetSpecialCoordinates.cpp
@@ -64,7 +64,9 @@ const std::string SetSpecialCoordinates::name() const {
 int SetSpecialCoordinates::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
-const std::string SetSpecialCoordinates::category() const { return "Crystal"; }
+const std::string SetSpecialCoordinates::category() const {
+  return "Crystal\\Corrections";
+}
 
 //----------------------------------------------------------------------------------------------
 
diff --git a/Framework/Crystal/src/SetUB.cpp b/Framework/Crystal/src/SetUB.cpp
index c4abd6ca2b16999276506cf086fdde5d3b0dfe8c..3303c2f5d3227af60f611f26c3890aab927a61b8 100644
--- a/Framework/Crystal/src/SetUB.cpp
+++ b/Framework/Crystal/src/SetUB.cpp
@@ -33,7 +33,7 @@ const std::string SetUB::name() const { return "SetUB"; }
 int SetUB::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
-const std::string SetUB::category() const { return "Crystal"; }
+const std::string SetUB::category() const { return "Crystal\\UBMatrix"; }
 
 //----------------------------------------------------------------------------------------------
 
diff --git a/Framework/Crystal/src/SortPeaksWorkspace.cpp b/Framework/Crystal/src/SortPeaksWorkspace.cpp
index 92659a4d5ef3a7fddd0a9690351726b258ac5651..61f7d502290f4e9b9ef77adf6c34ad903582a988 100644
--- a/Framework/Crystal/src/SortPeaksWorkspace.cpp
+++ b/Framework/Crystal/src/SortPeaksWorkspace.cpp
@@ -31,7 +31,9 @@ const std::string SortPeaksWorkspace::name() const {
 int SortPeaksWorkspace::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
-const std::string SortPeaksWorkspace::category() const { return "Crystal"; }
+const std::string SortPeaksWorkspace::category() const {
+  return "Crystal\\Peaks;Utility\\Sorting";
+}
 
 //----------------------------------------------------------------------------------------------
 
diff --git a/Framework/Crystal/src/TransformHKL.cpp b/Framework/Crystal/src/TransformHKL.cpp
index e8a2dd2764cbaee9821fc2277446f896e95ef546..c1c770a2eb98d8a1245cec6f30d0b432ece4ab39 100644
--- a/Framework/Crystal/src/TransformHKL.cpp
+++ b/Framework/Crystal/src/TransformHKL.cpp
@@ -31,7 +31,7 @@ const std::string TransformHKL::name() const { return "TransformHKL"; }
 
 int TransformHKL::version() const { return 1; }
 
-const std::string TransformHKL::category() const { return "Crystal"; }
+const std::string TransformHKL::category() const { return "Crystal\\Peaks"; }
 
 //--------------------------------------------------------------------------
 /** Initialize the algorithm's properties.
diff --git a/Framework/CurveFitting/inc/MantidCurveFitting/Algorithms/CalculateMSVesuvio.h b/Framework/CurveFitting/inc/MantidCurveFitting/Algorithms/CalculateMSVesuvio.h
index 96d84d452dadbbff40e58b32c09184768055420b..06b1cbd635b8fa3333653c641f9482566ee5720b 100644
--- a/Framework/CurveFitting/inc/MantidCurveFitting/Algorithms/CalculateMSVesuvio.h
+++ b/Framework/CurveFitting/inc/MantidCurveFitting/Algorithms/CalculateMSVesuvio.h
@@ -74,7 +74,9 @@ public:
   /// @copydoc Algorithm::version
   virtual int version() const { return 1; }
   /// @copydoc Algorithm::category
-  virtual const std::string category() const { return "ISIS"; }
+  virtual const std::string category() const {
+    return "CorrectionFunctions\\SpecialCorrections";
+  }
   /// @copydoc Algorithm::summary
   virtual const std::string summary() const {
     return "Calculates the contributions of multiple scattering "
diff --git a/Framework/CurveFitting/inc/MantidCurveFitting/Algorithms/FitPowderDiffPeaks.h b/Framework/CurveFitting/inc/MantidCurveFitting/Algorithms/FitPowderDiffPeaks.h
index 5436f304f29d3fd7a7076d4dcfca9dab48dd0b03..1c983df6b4b5e0c65c3e86b832a65ee65c46d3ec 100644
--- a/Framework/CurveFitting/inc/MantidCurveFitting/Algorithms/FitPowderDiffPeaks.h
+++ b/Framework/CurveFitting/inc/MantidCurveFitting/Algorithms/FitPowderDiffPeaks.h
@@ -74,7 +74,7 @@ public:
   virtual int version() const { return 1; }
 
   /// Algorithm's category for identification overriding a virtual method
-  virtual const std::string category() const { return "Diffraction"; }
+  virtual const std::string category() const { return "Diffraction\\Fitting"; }
 
 private:
   /// Implement abstract Algorithm methods
diff --git a/Framework/CurveFitting/inc/MantidCurveFitting/Algorithms/LeBailFit.h b/Framework/CurveFitting/inc/MantidCurveFitting/Algorithms/LeBailFit.h
index dd92a572da7db455acf9c7552bbc80132b9fb799..7a76297e1492b2e4bd941d6dfe318552309ac8af 100644
--- a/Framework/CurveFitting/inc/MantidCurveFitting/Algorithms/LeBailFit.h
+++ b/Framework/CurveFitting/inc/MantidCurveFitting/Algorithms/LeBailFit.h
@@ -88,7 +88,7 @@ public:
   virtual int version() const { return 1; }
 
   /// Algorithm's category for identification overriding a virtual method
-  virtual const std::string category() const { return "Diffraction"; }
+  virtual const std::string category() const { return "Diffraction\\Fitting"; }
 
 private:
   // Implement abstract Algorithm methods
diff --git a/Framework/CurveFitting/inc/MantidCurveFitting/Algorithms/PawleyFit.h b/Framework/CurveFitting/inc/MantidCurveFitting/Algorithms/PawleyFit.h
index 7bddf3ec39884df67505bda3e8c5f800eda0ed2e..39ae763992dd249dbf298d0fdff052d8f75370af 100644
--- a/Framework/CurveFitting/inc/MantidCurveFitting/Algorithms/PawleyFit.h
+++ b/Framework/CurveFitting/inc/MantidCurveFitting/Algorithms/PawleyFit.h
@@ -72,7 +72,7 @@ public:
   const std::string name() const { return "PawleyFit"; }
   int version() const { return 1; }
   const std::string summary() const;
-  const std::string category() const { return "Diffraction"; }
+  const std::string category() const { return "Diffraction\\Fitting"; }
 
 protected:
   double getTransformedCenter(double d, const Kernel::Unit_sptr &unit) const;
diff --git a/Framework/CurveFitting/inc/MantidCurveFitting/Algorithms/RefinePowderInstrumentParameters.h b/Framework/CurveFitting/inc/MantidCurveFitting/Algorithms/RefinePowderInstrumentParameters.h
index 9d3eeba57a4f02f257190c767a07f51f4f6f6df0..fc90a7c52679b442bc320e4db1ada380c5f76fb7 100644
--- a/Framework/CurveFitting/inc/MantidCurveFitting/Algorithms/RefinePowderInstrumentParameters.h
+++ b/Framework/CurveFitting/inc/MantidCurveFitting/Algorithms/RefinePowderInstrumentParameters.h
@@ -69,7 +69,7 @@ public:
   virtual int version() const { return 2; }
 
   /// Algorithm's category for identification overriding a virtual method
-  virtual const std::string category() const { return "Diffraction"; }
+  virtual const std::string category() const { return "Diffraction\\Fitting"; }
 
 private:
   // Implement abstract Algorithm methods
diff --git a/Framework/CurveFitting/inc/MantidCurveFitting/Algorithms/RefinePowderInstrumentParameters3.h b/Framework/CurveFitting/inc/MantidCurveFitting/Algorithms/RefinePowderInstrumentParameters3.h
index 56875c6c88568c1c49d67c13d29018a34627fb3b..764b6e74f1a71d903c7a7dd2239f7b4fe852e3e4 100644
--- a/Framework/CurveFitting/inc/MantidCurveFitting/Algorithms/RefinePowderInstrumentParameters3.h
+++ b/Framework/CurveFitting/inc/MantidCurveFitting/Algorithms/RefinePowderInstrumentParameters3.h
@@ -57,7 +57,7 @@ public:
   virtual int version() const { return 3; }
 
   /// Algorithm's category for identification overriding a virtual method
-  virtual const std::string category() const { return "Diffraction"; }
+  virtual const std::string category() const { return "Diffraction\\Fitting"; }
 
 private:
   /// Implement abstract Algorithm methods
diff --git a/Framework/CurveFitting/src/Algorithms/CalculateGammaBackground.cpp b/Framework/CurveFitting/src/Algorithms/CalculateGammaBackground.cpp
index 0daa71f91663bea98e7a610601556e78d77aa205..2586dd49c2a092a6643104f1118a88319c0d76e2 100644
--- a/Framework/CurveFitting/src/Algorithms/CalculateGammaBackground.cpp
+++ b/Framework/CurveFitting/src/Algorithms/CalculateGammaBackground.cpp
@@ -73,7 +73,7 @@ const std::string CalculateGammaBackground::name() const {
 int CalculateGammaBackground::version() const { return 1; }
 
 const std::string CalculateGammaBackground::category() const {
-  return "CorrectionFunctions";
+  return "CorrectionFunctions\\BackgroundCorrections";
 }
 
 void CalculateGammaBackground::init() {
diff --git a/Framework/DataHandling/inc/MantidDataHandling/CreateSampleShape.h b/Framework/DataHandling/inc/MantidDataHandling/CreateSampleShape.h
index 03e8bfc1fdc0e2e47803bf3dd2c12f345927a5d3..e7ce5519698d7d679d5046a040c3c83c140330c0 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/CreateSampleShape.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/CreateSampleShape.h
@@ -54,7 +54,7 @@ public:
   /// Algorithm's version
   virtual int version() const { return (1); }
   /// Algorithm's category for identification
-  virtual const std::string category() const { return "Sample;DataHandling"; }
+  virtual const std::string category() const { return "Sample;"; }
 
 private:
   /// Initialisation code
diff --git a/Framework/DataHandling/inc/MantidDataHandling/FindDetectorsInShape.h b/Framework/DataHandling/inc/MantidDataHandling/FindDetectorsInShape.h
index 1c7c33b13f0552b88456f570e2b0e0489b19b798..5e5bf5684e4818955e6cd94de129c9115459a4c7 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/FindDetectorsInShape.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/FindDetectorsInShape.h
@@ -71,7 +71,7 @@ public:
   /// Algorithm's version for identification overriding a virtual method
   virtual int version() const { return 1; };
   /// Algorithm's category for identification overriding a virtual method
-  virtual const std::string category() const { return "Utility"; }
+  virtual const std::string category() const { return "Utility\\Instrument"; }
 
 private:
   // Implement abstract Algorithm methods
diff --git a/Framework/DataHandling/inc/MantidDataHandling/LoadBBY.h b/Framework/DataHandling/inc/MantidDataHandling/LoadBBY.h
index 37cfc22c64995142aff1445f08cc7d68b660b4fd..7cabf92f0a8c93437ac1e5568cf94675ec82e6fc 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/LoadBBY.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/LoadBBY.h
@@ -78,7 +78,7 @@ public:
   // description
   virtual int version() const { return 1; }
   virtual const std::string name() const { return "LoadBBY"; }
-  virtual const std::string category() const { return "DataHandling"; }
+  virtual const std::string category() const { return "DataHandling\\Nexus"; }
   virtual const std::string summary() const {
     return "Loads a BilBy data file into an workspace.";
   }
diff --git a/Framework/DataHandling/inc/MantidDataHandling/LoadCalFile.h b/Framework/DataHandling/inc/MantidDataHandling/LoadCalFile.h
index 5768b9268a7da06aae3d8af34fe1b7d5f894c846..ecdc7eb2bc8212b8ae7b57e4e437ee8b4eabd570 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/LoadCalFile.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/LoadCalFile.h
@@ -36,7 +36,7 @@ public:
   virtual int version() const { return 1; };
   /// Algorithm's category for identification
   virtual const std::string category() const {
-    return "DataHandling\\Text;Diffraction";
+    return "DataHandling\\Text;Diffraction\\DataHandling\\CalFiles";
   }
 
   static void getInstrument3WaysInit(Mantid::API::Algorithm *alg);
diff --git a/Framework/DataHandling/inc/MantidDataHandling/LoadCanSAS1D.h b/Framework/DataHandling/inc/MantidDataHandling/LoadCanSAS1D.h
index 1eda352bd1a4da384fdd79e9baffd19f09632c90..234cc7876d45de381950efd6b8429afa8db7feb6 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/LoadCanSAS1D.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/LoadCanSAS1D.h
@@ -68,7 +68,9 @@ public:
   /// Algorithm's version for identification overriding a virtual method
   virtual int version() const { return 1; }
   /// Algorithm's category for identification overriding a virtual method
-  virtual const std::string category() const { return "DataHandling\\XML"; }
+  virtual const std::string category() const {
+    return "DataHandling\\XML;SANS\\DataHandling";
+  }
 
   /// Returns a confidence value that this algorithm can load a file
   virtual int confidence(Kernel::FileDescriptor &descriptor) const;
diff --git a/Framework/DataHandling/inc/MantidDataHandling/LoadDaveGrp.h b/Framework/DataHandling/inc/MantidDataHandling/LoadDaveGrp.h
index 047dde6139024b464f2fbe492ea9aeaff795fcbc..21e04b825361dba4b1eeb058d0c5a114169b6c32 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/LoadDaveGrp.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/LoadDaveGrp.h
@@ -59,7 +59,7 @@ public:
   virtual int version() const { return (1); }
   /// Algorithm's category for identification
   virtual const std::string category() const {
-    return "DataHandling\\Text;Inelastic";
+    return "DataHandling\\Text;Inelastic\\DataHandling";
   }
   /// Returns a confidence value that this algorithm can load a file
   virtual int confidence(Kernel::FileDescriptor &descriptor) const;
diff --git a/Framework/DataHandling/inc/MantidDataHandling/LoadDetectorInfo.h b/Framework/DataHandling/inc/MantidDataHandling/LoadDetectorInfo.h
index 8bbb823f03f2247d0e8230b76727acf509971a2d..e82267fe0c11eec870a15250031522c12524cecd 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/LoadDetectorInfo.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/LoadDetectorInfo.h
@@ -47,7 +47,7 @@ public:
   /// Algorithm's version for identification overriding a virtual method
   virtual int version() const { return 1; }
   /// Algorithm's category for identification overriding a virtual method
-  virtual const std::string category() const { return "DataHandling"; }
+  virtual const std::string category() const { return "DataHandling\\Raw"; }
 
 private:
   /// Simple data holder for passing the detector info around when
diff --git a/Framework/DataHandling/inc/MantidDataHandling/LoadDetectorsGroupingFile.h b/Framework/DataHandling/inc/MantidDataHandling/LoadDetectorsGroupingFile.h
index 5acddb4236f398f94c4606a577419238883aeb10..23111f80d043c3aa82d3b68ae876350a3b8856fb 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/LoadDetectorsGroupingFile.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/LoadDetectorsGroupingFile.h
@@ -67,7 +67,7 @@ public:
   virtual int version() const { return 1; };
   /// Algorithm's category for identification
   virtual const std::string category() const {
-    return "DataHandling;Transforms\\Grouping";
+    return "DataHandling\\Grouping;Transforms\\Grouping";
   }
 
 private:
diff --git a/Framework/DataHandling/inc/MantidDataHandling/LoadDspacemap.h b/Framework/DataHandling/inc/MantidDataHandling/LoadDspacemap.h
index f78daa0423be8d28bc94051ff663442815555bc3..365366da601eb6ccb729a806015f58566c30aa6c 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/LoadDspacemap.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/LoadDspacemap.h
@@ -32,7 +32,7 @@ public:
   /// Algorithm's version for identification
   virtual int version() const { return 1; };
   /// Algorithm's category for identification
-  virtual const std::string category() const { return "DataHandling"; }
+  virtual const std::string category() const { return "DataHandling\\Text"; }
 
 private:
   /// Initialise the properties
diff --git a/Framework/DataHandling/inc/MantidDataHandling/LoadFITS.h b/Framework/DataHandling/inc/MantidDataHandling/LoadFITS.h
index 5fde56823b2848b7e5fb8ded443e2722059f2ebc..79f446aa389f2418f70a049cab414e1af2ce7f7d 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/LoadFITS.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/LoadFITS.h
@@ -81,7 +81,7 @@ public:
 
   /// Algorithm's category for identification overriding a virtual method
   virtual const std::string category() const {
-    return "DataHandling;DataHandling\\Tomography";
+    return "DataHandling\\Tomography";
   }
 
   /// Returns a confidence value that this algorithm can load a file
diff --git a/Framework/DataHandling/inc/MantidDataHandling/LoadFullprofResolution.h b/Framework/DataHandling/inc/MantidDataHandling/LoadFullprofResolution.h
index 911826388958100f5d1aad0264ee0fd4c87209aa..0f365d85dd86476852bdcf3c9048b2da77495deb 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/LoadFullprofResolution.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/LoadFullprofResolution.h
@@ -51,7 +51,9 @@ public:
   virtual int version() const { return 1; }
 
   /// Algorithm's category for identification overriding a virtual method
-  virtual const std::string category() const { return "Diffraction"; }
+  virtual const std::string category() const {
+    return "Diffraction\\DataHandling";
+  }
   /// Summary of algorithms purpose
   virtual const std::string summary() const {
     return "Load Fullprof's resolution (.irf) file to one or multiple "
diff --git a/Framework/DataHandling/inc/MantidDataHandling/LoadGSASInstrumentFile.h b/Framework/DataHandling/inc/MantidDataHandling/LoadGSASInstrumentFile.h
index d26c348082c97f7f8cefdd902dcdb9fb7a6633f0..1f998b15ee3d3fe653120fe893a23eacde992d85 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/LoadGSASInstrumentFile.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/LoadGSASInstrumentFile.h
@@ -54,7 +54,9 @@ public:
   virtual int version() const { return 1; }
 
   /// Algorithm's category for identification overriding a virtual method
-  virtual const std::string category() const { return "Diffraction"; }
+  virtual const std::string category() const {
+    return "Diffraction\\DataHandling";
+  }
 
 private:
   /// Implement abstract Algorithm methods
diff --git a/Framework/DataHandling/inc/MantidDataHandling/LoadGSS.h b/Framework/DataHandling/inc/MantidDataHandling/LoadGSS.h
index a0a63b489391a13caab2da6421b691c27d1e07c2..141174955d001b183fd96083f01e9d2fe270598b 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/LoadGSS.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/LoadGSS.h
@@ -61,7 +61,7 @@ public:
 
   /// Algorithm's category for identification
   virtual const std::string category() const {
-    return "Diffraction;DataHandling\\Text";
+    return "Diffraction\\DataHandling;DataHandling\\Text";
   }
 
   /// Returns a confidence value that this algorithm can load a file
diff --git a/Framework/DataHandling/inc/MantidDataHandling/LoadILL.h b/Framework/DataHandling/inc/MantidDataHandling/LoadILL.h
index 792a97f732492674d5e2d17e7de9628c61a883eb..82c532a8d6b3d0595218cc4942af7c0b4d2e2d11 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/LoadILL.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/LoadILL.h
@@ -49,7 +49,7 @@ public:
   /// Algorithm's version
   virtual int version() const { return (1); }
   /// Algorithm's category for identification
-  virtual const std::string category() const { return "DataHandling"; }
+  virtual const std::string category() const { return "DataHandling\\Nexus"; }
 
   /// Returns a confidence value that this algorithm can load a file
   int confidence(Kernel::NexusDescriptor &descriptor) const;
diff --git a/Framework/DataHandling/inc/MantidDataHandling/LoadIsawDetCal.h b/Framework/DataHandling/inc/MantidDataHandling/LoadIsawDetCal.h
index 65dce045094d0c534654bed7749e496ba0c94b40..bc1431107eb0b5b333bb70cd5eb2889a42fdc7ff 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/LoadIsawDetCal.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/LoadIsawDetCal.h
@@ -62,7 +62,7 @@ public:
   virtual int version() const { return 1; }
   /// Algorithm's category for identification overriding a virtual method
   virtual const std::string category() const {
-    return "Diffraction;DataHandling\\Isaw";
+    return "Diffraction\\DataHandling;DataHandling\\Isaw";
   }
   /// Function to optimize
   void center(double x, double y, double z, std::string detname,
diff --git a/Framework/DataHandling/inc/MantidDataHandling/LoadMask.h b/Framework/DataHandling/inc/MantidDataHandling/LoadMask.h
index 67641f9f37851b78e4ae1565fb6daa2ad6ae358c..cb3db73b498535f4ced995024728fdbed48cf055 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/LoadMask.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/LoadMask.h
@@ -61,7 +61,7 @@ public:
   virtual int version() const { return 1; };
   /// Algorithm's category for identification
   virtual const std::string category() const {
-    return "DataHandling;Transforms\\Masking";
+    return "DataHandling\\Masking;Transforms\\Masking";
   }
 
 private:
diff --git a/Framework/DataHandling/inc/MantidDataHandling/LoadMuonLog.h b/Framework/DataHandling/inc/MantidDataHandling/LoadMuonLog.h
index 0286540732758ee7577fe41eca76311796b5325f..df8de957cac498e9860194476cc808d2b03c23ee 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/LoadMuonLog.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/LoadMuonLog.h
@@ -71,7 +71,7 @@ public:
   virtual int version() const { return 1; };
   /// Algorithm's category for identification overriding a virtual method
   virtual const std::string category() const {
-    return "DataHandling\\Logs;Muon";
+    return "DataHandling\\Logs;Muon\\DataHandling";
   }
 
 private:
diff --git a/Framework/DataHandling/inc/MantidDataHandling/LoadMuonNexus.h b/Framework/DataHandling/inc/MantidDataHandling/LoadMuonNexus.h
index c5da559b144ee999d9711480568f9c610e1209b7..33369a5e26cf0189027955bde83c48427ea97bde 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/LoadMuonNexus.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/LoadMuonNexus.h
@@ -83,7 +83,7 @@ public:
   virtual int version() const { return 1; }
   /// Algorithm's category for identification overriding a virtual method
   virtual const std::string category() const {
-    return "DataHandling\\Nexus;Muon";
+    return "DataHandling\\Nexus;Muon\\DataHandling";
   }
 
   /// Returns a confidence value that this algorithm can load a file
diff --git a/Framework/DataHandling/inc/MantidDataHandling/LoadMuonNexus1.h b/Framework/DataHandling/inc/MantidDataHandling/LoadMuonNexus1.h
index 42dee00015c354f857cd60d10239abb2bdbbc60f..88659acb2dff34a540e7433e205c89ffbcb24b57 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/LoadMuonNexus1.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/LoadMuonNexus1.h
@@ -89,7 +89,7 @@ public:
   virtual int version() const { return 1; }
   /// Algorithm's category for identification overriding a virtual method
   virtual const std::string category() const {
-    return "DataHandling\\Nexus;Muon";
+    return "DataHandling\\Nexus;Muon\\DataHandling";
   }
 
   /// Returns a confidence value that this algorithm can load a file
diff --git a/Framework/DataHandling/inc/MantidDataHandling/LoadMuonNexus2.h b/Framework/DataHandling/inc/MantidDataHandling/LoadMuonNexus2.h
index 9ae92b00deb3acbbcf34e2e56c45a1dcacfc2d35..227034f4f53c2ef784de6b236b62f8d4df8d7a3f 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/LoadMuonNexus2.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/LoadMuonNexus2.h
@@ -79,7 +79,7 @@ public:
   virtual int version() const { return 2; }
   /// Algorithm's category for identification overriding a virtual method
   virtual const std::string category() const {
-    return "DataHandling\\Nexus;Muon";
+    return "DataHandling\\Nexus;Muon\\DataHandling";
   }
 
   /// Returns a confidence value that this algorithm can load a file
diff --git a/Framework/DataHandling/inc/MantidDataHandling/LoadNXSPE.h b/Framework/DataHandling/inc/MantidDataHandling/LoadNXSPE.h
index 5fb03b7c63c62cd9202d61d18843490f170b9f00..128a93ce59be578fc63ab43ae58bf02c42e66202 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/LoadNXSPE.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/LoadNXSPE.h
@@ -56,7 +56,7 @@ public:
   virtual int version() const { return 1; };
   /// Algorithm's category for identification
   virtual const std::string category() const {
-    return "DataHandling\\Nexus;DataHandling\\SPE;Inelastic";
+    return "DataHandling\\Nexus;DataHandling\\SPE;Inelastic\\DataHandling";
   }
 
   /// Returns a confidence value that this algorithm can load a file
diff --git a/Framework/DataHandling/inc/MantidDataHandling/LoadPDFgetNFile.h b/Framework/DataHandling/inc/MantidDataHandling/LoadPDFgetNFile.h
index 1ae3fbd5dd8f503fd0e0fcbc3f1c3664fba84cd2..660e38d32940b40f23ad8d13aa19781820d12a72 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/LoadPDFgetNFile.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/LoadPDFgetNFile.h
@@ -49,7 +49,7 @@ public:
 
   /// Algorithm's category for identification overriding a virtual method
   virtual const std::string category() const {
-    return "Diffraction;DataHandling\\Text";
+    return "Diffraction\\DataHandling;DataHandling\\Text";
   }
 
 private:
diff --git a/Framework/DataHandling/inc/MantidDataHandling/LoadQKK.h b/Framework/DataHandling/inc/MantidDataHandling/LoadQKK.h
index 1de5e4a297570464f8ba09f7bf77c47fb19165cc..dc9ae28a80e91b3ebd90cde5aea0d85663b17b2d 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/LoadQKK.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/LoadQKK.h
@@ -53,7 +53,7 @@ public:
   /// Algorithm's version
   virtual int version() const { return (1); }
   /// Algorithm's category for identification
-  virtual const std::string category() const { return "DataHandling"; }
+  virtual const std::string category() const { return "DataHandling\\Nexus"; }
 
   /// Returns a confidence value that this algorithm can load a file
   virtual int confidence(Kernel::NexusDescriptor &descriptor) const;
diff --git a/Framework/DataHandling/inc/MantidDataHandling/LoadRKH.h b/Framework/DataHandling/inc/MantidDataHandling/LoadRKH.h
index 04f4d559cefd4d001ef2d330d6e24d3658694be9..1520f1a6a0b143f2c5ff863dcdf957430a00f347 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/LoadRKH.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/LoadRKH.h
@@ -60,7 +60,7 @@ public:
   virtual int version() const { return (1); }
   /// Algorithm's category for identification
   virtual const std::string category() const {
-    return "DataHandling\\Text;SANS";
+    return "DataHandling\\Text;SANS\\DataHandling";
   }
 
   /// Returns a confidence value that this algorithm can load a file
diff --git a/Framework/DataHandling/inc/MantidDataHandling/LoadRawBin0.h b/Framework/DataHandling/inc/MantidDataHandling/LoadRawBin0.h
index d40ef9d6999129e37f84218b29bb16f617e990f6..3b84342ef48a7beca57594e0d0e0c5aca157b07d 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/LoadRawBin0.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/LoadRawBin0.h
@@ -81,7 +81,9 @@ public:
   /// Algorithm's version for identification overriding a virtual method
   virtual int version() const { return 1; }
   /// Algorithm's category for identification overriding a virtual method
-  virtual const std::string category() const { return "Diagnostics"; }
+  virtual const std::string category() const {
+    return "Diagnostics\\Raw;DataHandling\\Raw";
+  }
 
 private:
   /// Overwrites Algorithm method.
diff --git a/Framework/DataHandling/inc/MantidDataHandling/LoadRawSpectrum0.h b/Framework/DataHandling/inc/MantidDataHandling/LoadRawSpectrum0.h
index 5e82d737f438b3e9c7507c2302bdbc0c9bb3826d..1dc3a6ad9147fa7316c483bb5844e62da7b2f0ff 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/LoadRawSpectrum0.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/LoadRawSpectrum0.h
@@ -73,7 +73,9 @@ public:
   /// Algorithm's version for identification overriding a virtual method
   virtual int version() const { return 1; }
   /// Algorithm's category for identification overriding a virtual method
-  virtual const std::string category() const { return "Diagnostics"; }
+  virtual const std::string category() const {
+    return "Diagnostics\\Raw;DataHandling\\Raw";
+  }
 
 private:
   /// Overwrites Algorithm method.
diff --git a/Framework/DataHandling/inc/MantidDataHandling/LoadSNSspec.h b/Framework/DataHandling/inc/MantidDataHandling/LoadSNSspec.h
index cb5d2690eb8034f67549ea39db1437dbaeffd90f..8cbaae8b984ffe85235f83d9aef0563fb42b3854 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/LoadSNSspec.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/LoadSNSspec.h
@@ -57,7 +57,7 @@ public:
   }
 
   virtual int version() const { return 1; }
-  virtual const std::string category() const { return "DataHandling"; }
+  virtual const std::string category() const { return "DataHandling\\Text"; }
 
   /// Returns a confidence value that this algorithm can load a file
   virtual int confidence(Kernel::FileDescriptor &descriptor) const;
diff --git a/Framework/DataHandling/inc/MantidDataHandling/LoadSPE.h b/Framework/DataHandling/inc/MantidDataHandling/LoadSPE.h
index e78cd4562b534d834d04797aa220a18bd11e66e4..b46031ae1eaf8373056eaa4b932f4785dde7d3b0 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/LoadSPE.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/LoadSPE.h
@@ -58,7 +58,7 @@ public:
   virtual int version() const { return (1); }
   /// Algorithm's category for identification
   virtual const std::string category() const {
-    return "DataHandling\\SPE;Inelastic";
+    return "DataHandling\\SPE;Inelastic\\DataHandling";
   }
   /// Returns a confidence value that this algorithm can load a file
   virtual int confidence(Kernel::FileDescriptor &descriptor) const;
diff --git a/Framework/DataHandling/inc/MantidDataHandling/LoadSpec.h b/Framework/DataHandling/inc/MantidDataHandling/LoadSpec.h
index 23c1b46b8c6bc69b831bb33e988a2b897a02dfdf..6fb496f3ac663daad6ad0dc36e2f80017636a5cc 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/LoadSpec.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/LoadSpec.h
@@ -57,7 +57,7 @@ public:
   }
 
   virtual int version() const { return 1; }
-  virtual const std::string category() const { return "DataHandling"; }
+  virtual const std::string category() const { return "DataHandling\\Text"; }
 
 private:
   void init();
diff --git a/Framework/DataHandling/inc/MantidDataHandling/LoadSpice2D.h b/Framework/DataHandling/inc/MantidDataHandling/LoadSpice2D.h
index 570ff429b97948bc9171b65de3c4d61ac9cfaee2..00254e301bf08673b228a840743dcc63adb57295 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/LoadSpice2D.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/LoadSpice2D.h
@@ -66,7 +66,7 @@ public:
   virtual int version() const { return 1; }
   /// Algorithm's category for identification overriding a virtual method
   virtual const std::string category() const {
-    return "DataHandling\\Text;SANS";
+    return "DataHandling\\Text;SANS\\DataHandling";
   }
   /// Number of monitors
   static const int nMonitors = 2;
diff --git a/Framework/DataHandling/inc/MantidDataHandling/LoadTOFRawNexus.h b/Framework/DataHandling/inc/MantidDataHandling/LoadTOFRawNexus.h
index 58e0859985f48e0beb7a605f34bfd6647fb0c888..ba09ca893f78f7210eb851dd68dc652ecabeff35 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/LoadTOFRawNexus.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/LoadTOFRawNexus.h
@@ -60,9 +60,7 @@ public:
   virtual int version() const { return 1; }
 
   /// Algorithm's category for identification overriding a virtual method
-  virtual const std::string category() const {
-    return "DataHandling;DataHandling\\Nexus";
-  }
+  virtual const std::string category() const { return "DataHandling\\Nexus"; }
 
   static std::string getEntryName(const std::string &filename);
 
diff --git a/Framework/DataHandling/inc/MantidDataHandling/LoadVulcanCalFile.h b/Framework/DataHandling/inc/MantidDataHandling/LoadVulcanCalFile.h
index ee8dc7ceeaba5874eb49bf0172a19c49c25dd503..61a049fc32eb1f44e831b227dd5cf6df3b9b1b63 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/LoadVulcanCalFile.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/LoadVulcanCalFile.h
@@ -41,7 +41,7 @@ public:
   virtual int version() const { return 1; }
   /// Algorithm's category for identification
   virtual const std::string category() const {
-    return "DataHandling\\Text;Diffraction";
+    return "DataHandling\\Text;Diffraction\\DataHandling";
   }
 
   void getInstrument3WaysInit();
diff --git a/Framework/DataHandling/inc/MantidDataHandling/ModifyDetectorDotDatFile.h b/Framework/DataHandling/inc/MantidDataHandling/ModifyDetectorDotDatFile.h
index ab7ce17d1e65d71be13b05c2862bb485cd57cd04..3060bb28978028f2fb704b7bf0827ae85673a051 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/ModifyDetectorDotDatFile.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/ModifyDetectorDotDatFile.h
@@ -50,7 +50,9 @@ public:
   /// Algorithm's version for identification
   virtual int version() const { return 1; };
   /// Algorithm's category for identification
-  virtual const std::string category() const { return "DataHandling"; }
+  virtual const std::string category() const {
+    return "DataHandling\\Instrument";
+  }
 
 private:
   /// Initialise the properties
diff --git a/Framework/DataHandling/inc/MantidDataHandling/ProcessDasNexusLog.h b/Framework/DataHandling/inc/MantidDataHandling/ProcessDasNexusLog.h
index 27f963291ee4dfd84bbb3c25c82c4903a8cb1130..fd8bbcc0dc42fe1f2957ff56911d55f4c7c513c8 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/ProcessDasNexusLog.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/ProcessDasNexusLog.h
@@ -47,7 +47,7 @@ public:
   }
 
   virtual int version() const { return 1; };
-  virtual const std::string category() const { return "DataHandling"; };
+  virtual const std::string category() const { return "DataHandling\\Logs"; };
 
 private:
   void init();
diff --git a/Framework/DataHandling/inc/MantidDataHandling/SaveCalFile.h b/Framework/DataHandling/inc/MantidDataHandling/SaveCalFile.h
index ff69ed406812a1a36bce30677d7488a480415c87..7702f440226ce5d8efd8da0f80d91175c57c62a7 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/SaveCalFile.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/SaveCalFile.h
@@ -34,7 +34,7 @@ public:
   virtual int version() const { return 1; };
   /// Algorithm's category for identification
   virtual const std::string category() const {
-    return "DataHandling\\Text;Diffraction";
+    return "DataHandling\\Text;Diffraction\\DataHandling\\CalFiles";
   }
 
   void saveCalFile(const std::string &calFileName,
diff --git a/Framework/DataHandling/inc/MantidDataHandling/SaveCanSAS1D.h b/Framework/DataHandling/inc/MantidDataHandling/SaveCanSAS1D.h
index aa2d1707539b876b8e4a6666ee5cef8655011f2d..88f63ed69808fc4d5e4a00d7030beda505dd6944 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/SaveCanSAS1D.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/SaveCanSAS1D.h
@@ -106,7 +106,7 @@ public:
   }
   virtual int version() const { return 1; }
   virtual const std::string category() const {
-    return "DataHandling\\XML;SANS";
+    return "DataHandling\\XML;SANS\\DataHandling";
   }
 
 protected:
diff --git a/Framework/DataHandling/inc/MantidDataHandling/SaveDaveGrp.h b/Framework/DataHandling/inc/MantidDataHandling/SaveDaveGrp.h
index e98f037e7503d98d0fa0981b33dbaed603314aae..1f2b3f768c79c28508e9898dbd0a05baade537c7 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/SaveDaveGrp.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/SaveDaveGrp.h
@@ -59,7 +59,7 @@ public:
   virtual int version() const { return 1; };
   /// Algorithm's category for identification
   virtual const std::string category() const {
-    return "DataHandling\\Text;Inelastic";
+    return "DataHandling\\Text;Inelastic\\DataHandling";
   }
   /// Algorithm's aliases
   virtual const std::string alias() const { return "SaveDASC"; }
diff --git a/Framework/DataHandling/inc/MantidDataHandling/SaveDetectorsGrouping.h b/Framework/DataHandling/inc/MantidDataHandling/SaveDetectorsGrouping.h
index 5f47ff5f823e9be1410d51453769ef5cef828e4a..96fd3fdd1dd340d8f6811c77b5c60928be025341 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/SaveDetectorsGrouping.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/SaveDetectorsGrouping.h
@@ -48,7 +48,7 @@ public:
   virtual int version() const { return 1; };
   /// Algorithm's category for identification
   virtual const std::string category() const {
-    return "DataHandling;Transforms\\Grouping";
+    return "DataHandling\\Grouping;Transforms\\Grouping";
   }
 
 private:
diff --git a/Framework/DataHandling/inc/MantidDataHandling/SaveDspacemap.h b/Framework/DataHandling/inc/MantidDataHandling/SaveDspacemap.h
index 9350d72b120084dd48a510220fab993049ceda4b..4ba6fdd16b7d125c50ea112934f72cef2336cd0a 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/SaveDspacemap.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/SaveDspacemap.h
@@ -29,7 +29,7 @@ public:
   /// Algorithm's version for identification
   virtual int version() const { return 1; };
   /// Algorithm's category for identification
-  virtual const std::string category() const { return "DataHandling"; }
+  virtual const std::string category() const { return "DataHandling\\Text"; }
 
 private:
   /// Initialise the properties
diff --git a/Framework/DataHandling/inc/MantidDataHandling/SaveFocusedXYE.h b/Framework/DataHandling/inc/MantidDataHandling/SaveFocusedXYE.h
index ce609a1975901d032e4d201c7f76272960e7874a..6f939671be15c1ea1d69e73af05a8573d0f3f842 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/SaveFocusedXYE.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/SaveFocusedXYE.h
@@ -78,7 +78,7 @@ public:
   virtual int version() const { return (1); }
   /// Algorithm's category for identification
   virtual const std::string category() const {
-    return "Diffraction;DataHandling\\Text";
+    return "Diffraction\\DataHandling;DataHandling\\Text";
   }
 
 private:
diff --git a/Framework/DataHandling/inc/MantidDataHandling/SaveFullprofResolution.h b/Framework/DataHandling/inc/MantidDataHandling/SaveFullprofResolution.h
index eefa2a3a9f3d5f4b79b77cc7b5c69262e46351c1..8f5f301a4b14f31253b66ea1a88975b0f865e223 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/SaveFullprofResolution.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/SaveFullprofResolution.h
@@ -48,7 +48,7 @@ public:
   virtual int version() const { return (1); }
   /// Algorithm's category for identification
   virtual const std::string category() const {
-    return "Diffraction;DataHandling\\Text";
+    return "Diffraction\\DataHandling;DataHandling\\Text";
   }
 
 private:
diff --git a/Framework/DataHandling/inc/MantidDataHandling/SaveGSS.h b/Framework/DataHandling/inc/MantidDataHandling/SaveGSS.h
index a3929b434cb302f12a4dea8c4549449cd78f9a02..805b2a3a9b873a0f2ce02e6ec54b6578a6ac6738 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/SaveGSS.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/SaveGSS.h
@@ -77,7 +77,7 @@ public:
   virtual int version() const { return (1); }
   /// Algorithm's category for identification
   virtual const std::string category() const {
-    return "Diffraction;DataHandling\\Text";
+    return "Diffraction\\DataHandling;DataHandling\\Text";
   }
 
 private:
diff --git a/Framework/DataHandling/inc/MantidDataHandling/SaveIsawDetCal.h b/Framework/DataHandling/inc/MantidDataHandling/SaveIsawDetCal.h
index 6c83744d972e70821d4c06a6714596416720816c..65a87faa01647df4b9efc5c7e6ad3ba816d17926 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/SaveIsawDetCal.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/SaveIsawDetCal.h
@@ -50,7 +50,7 @@ public:
   virtual int version() const { return 1; };
   /// Algorithm's category for identification
   virtual const std::string category() const {
-    return "Diffraction;DataHandling\\Isaw";
+    return "Diffraction\\DataHandling;DataHandling\\Isaw";
   }
 
 private:
diff --git a/Framework/DataHandling/inc/MantidDataHandling/SaveMask.h b/Framework/DataHandling/inc/MantidDataHandling/SaveMask.h
index d503244ab0c17f38282995dc49ec47cd0b0115e9..5fefbe959f1a322b1d3bf9112d8d060c360a14f3 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/SaveMask.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/SaveMask.h
@@ -48,7 +48,7 @@ public:
   virtual int version() const { return 1; };
   /// Algorithm's category for identification
   virtual const std::string category() const {
-    return "DataHandling;Transforms\\Masking";
+    return "DataHandling\\Masking;Transforms\\Masking";
   }
 
 private:
diff --git a/Framework/DataHandling/inc/MantidDataHandling/SaveNXSPE.h b/Framework/DataHandling/inc/MantidDataHandling/SaveNXSPE.h
index 1df805df1501cfcc3c9b8cd8e87c898720115f40..d31cb3deee2c612f0007623490447035514b9f80 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/SaveNXSPE.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/SaveNXSPE.h
@@ -49,7 +49,7 @@ public:
   virtual int version() const { return (1); }
   /// Algorithm's category for identification
   virtual const std::string category() const {
-    return "DataHandling\\Nexus;DataHandling\\SPE;Inelastic";
+    return "DataHandling\\Nexus;DataHandling\\SPE;Inelastic\\DataHandling";
   }
 
 private:
diff --git a/Framework/DataHandling/inc/MantidDataHandling/SaveNXTomo.h b/Framework/DataHandling/inc/MantidDataHandling/SaveNXTomo.h
index 2144bc53f8ae131c369c412d3a982fcb4131c0f7..d2c82e6f9a0ff4270dd1d097cf42fc1aa25345b9 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/SaveNXTomo.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/SaveNXTomo.h
@@ -65,7 +65,8 @@ public:
 
   /// Algorithm's category for identification
   virtual const std::string category() const {
-    return "DataHandling\\Nexus;DataHandling\\Tomography;Diffraction";
+    return "DataHandling\\Nexus;DataHandling\\Tomography;"
+           "Diffraction\\DataHandling";
   }
 
 private:
diff --git a/Framework/DataHandling/inc/MantidDataHandling/SaveOpenGenieAscii.h b/Framework/DataHandling/inc/MantidDataHandling/SaveOpenGenieAscii.h
index 27ac2edade3b4ea6b0d164fda4b51cbf23c3e8fa..7ee37d3637d7c76390dcfec93f7cfb4d85a7b5de 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/SaveOpenGenieAscii.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/SaveOpenGenieAscii.h
@@ -32,7 +32,7 @@ public:
 
   /// Algorithm's category for identification
   virtual const std::string category() const {
-    return "Diffraction;DataHandling\\Text";
+    return "Diffraction\\DataHandling;DataHandling\\Text";
   }
 
 private:
diff --git a/Framework/DataHandling/inc/MantidDataHandling/SavePAR.h b/Framework/DataHandling/inc/MantidDataHandling/SavePAR.h
index de68965d40c8a9f95d3446da72479d316e205b9e..b29923912e80e1474d9330b6917fe85833f075ee 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/SavePAR.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/SavePAR.h
@@ -74,7 +74,7 @@ public:
   virtual int version() const { return (1); }
   /// Algorithm's category for identification
   virtual const std::string category() const {
-    return "DataHandling\\SPE;Inelastic";
+    return "DataHandling\\SPE;Inelastic\\DataHandling";
   }
   /** the method used in tests. It requested the ChildAlgorithm, which does the
    detectors
diff --git a/Framework/DataHandling/inc/MantidDataHandling/SavePHX.h b/Framework/DataHandling/inc/MantidDataHandling/SavePHX.h
index cb07afa5026f6e1273db82a7b3146cefe6fa086b..5fda68e14f4f657ef6bf72b351655f227adfebb8 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/SavePHX.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/SavePHX.h
@@ -59,7 +59,7 @@ public:
   virtual int version() const { return (1); }
   /// Algorithm's category for identification
   virtual const std::string category() const {
-    return "DataHandling\\SPE;Inelastic";
+    return "DataHandling\\SPE;Inelastic\\DataHandling";
   }
 
   /** the method used in tests. It requested the ChildAlgorithm, which does the
diff --git a/Framework/DataHandling/inc/MantidDataHandling/SaveRKH.h b/Framework/DataHandling/inc/MantidDataHandling/SaveRKH.h
index ffaea2557bcb2b54ba9f05e7d5f813cb3cf1f63b..10489e415021ed4f4879c1074c3eb840785a541b 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/SaveRKH.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/SaveRKH.h
@@ -59,7 +59,7 @@ public:
   /// Algorithm's version
   virtual int version() const { return (1); }
   /// Algorithm's category for identification
-  virtual const std::string category() const { return "DataHandling"; }
+  virtual const std::string category() const { return "DataHandling\\Text"; }
 
   /// Constants used in RKH files
   enum FileConstants {
diff --git a/Framework/DataHandling/inc/MantidDataHandling/SaveSPE.h b/Framework/DataHandling/inc/MantidDataHandling/SaveSPE.h
index bf60f23d1837c1bdf6ecb70b965cfea020bad0ba..e8a38a65bcd0da421bac018192b2fdecf372cf9c 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/SaveSPE.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/SaveSPE.h
@@ -55,7 +55,7 @@ public:
   virtual int version() const { return (1); }
   /// Algorithm's category for identification
   virtual const std::string category() const {
-    return "DataHandling\\SPE;Inelastic";
+    return "DataHandling\\SPE;Inelastic\\DataHandling";
   }
 
   /// the mask flag (=-1e30) from the SPE specification
diff --git a/Framework/DataHandling/src/CreateChopperModel.cpp b/Framework/DataHandling/src/CreateChopperModel.cpp
index 48274f1aa5f6cb83df567e3ac082d132a2b9a08d..ce1f56792c72f4cba5e62a98e7d5581700673bc8 100644
--- a/Framework/DataHandling/src/CreateChopperModel.cpp
+++ b/Framework/DataHandling/src/CreateChopperModel.cpp
@@ -28,7 +28,7 @@ int CreateChopperModel::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string CreateChopperModel::category() const {
-  return "DataHandling";
+  return "DataHandling\\Instrument";
 }
 
 //----------------------------------------------------------------------------------------------
diff --git a/Framework/DataHandling/src/CreateModeratorModel.cpp b/Framework/DataHandling/src/CreateModeratorModel.cpp
index d2008b1d47e5b5ed07d14a9153538feb51e8325b..6075c63e768beda6119fa1cffab216374e505d30 100644
--- a/Framework/DataHandling/src/CreateModeratorModel.cpp
+++ b/Framework/DataHandling/src/CreateModeratorModel.cpp
@@ -26,7 +26,7 @@ int CreateModeratorModel::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string CreateModeratorModel::category() const {
-  return "DataHandling";
+  return "DataHandling\\Instrument";
 }
 
 //----------------------------------------------------------------------------------------------
diff --git a/Framework/DataHandling/src/CreateSimulationWorkspace.cpp b/Framework/DataHandling/src/CreateSimulationWorkspace.cpp
index 0d1ce78c4bb1bbfceda7a8f541b63b5632986700..6df4e5e40aa2efa90294a968ef35819ccf1625a5 100644
--- a/Framework/DataHandling/src/CreateSimulationWorkspace.cpp
+++ b/Framework/DataHandling/src/CreateSimulationWorkspace.cpp
@@ -34,7 +34,7 @@ int CreateSimulationWorkspace::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string CreateSimulationWorkspace::category() const {
-  return "Quantification";
+  return "Inelastic\\Quantification";
 }
 
 //----------------------------------------------------------------------------------------------
diff --git a/Framework/DataHandling/src/ExtractMonitorWorkspace.cpp b/Framework/DataHandling/src/ExtractMonitorWorkspace.cpp
index 3461ebea7d901c66b8f82f1bcf787994741e3235..20fa3608bc4d996e3df4b91966953d52bb2eac9a 100644
--- a/Framework/DataHandling/src/ExtractMonitorWorkspace.cpp
+++ b/Framework/DataHandling/src/ExtractMonitorWorkspace.cpp
@@ -22,7 +22,7 @@ int ExtractMonitorWorkspace::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string ExtractMonitorWorkspace::category() const {
-  return "DataHandling";
+  return "Utility\\Workspaces";
 }
 
 /// Algorithm's summary for use in the GUI and help. @see Algorithm::summary
diff --git a/Framework/DataHandling/src/GenerateGroupingPowder.cpp b/Framework/DataHandling/src/GenerateGroupingPowder.cpp
index d925a4fd7bd850c850f43386a5e19c5d7b379406..a4e44686a1487535a287dfbb68b71fdaf221ad33 100644
--- a/Framework/DataHandling/src/GenerateGroupingPowder.cpp
+++ b/Framework/DataHandling/src/GenerateGroupingPowder.cpp
@@ -57,7 +57,7 @@ int GenerateGroupingPowder::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string GenerateGroupingPowder::category() const {
-  return "DataHandling";
+  return "DataHandling\\Grouping;Transforms\\Grouping;Diffraction\\Utility";
 }
 
 //----------------------------------------------------------------------------------------------
diff --git a/Framework/DataHandling/src/LoadDiffCal.cpp b/Framework/DataHandling/src/LoadDiffCal.cpp
index f5fc4ac63f3d5c4b6bf44d2d2943e46da7dd733c..b07bd86a8aa94fd51867c1f6bbcf79d659d6d740 100644
--- a/Framework/DataHandling/src/LoadDiffCal.cpp
+++ b/Framework/DataHandling/src/LoadDiffCal.cpp
@@ -54,7 +54,7 @@ int LoadDiffCal::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string LoadDiffCal::category() const {
-  return "DataHandling;Diffraction";
+  return "DataHandling\\Instrument;Diffraction\\DataHandling";
 }
 
 /// Algorithm's summary for use in the GUI and help. @see Algorithm::summary
diff --git a/Framework/DataHandling/src/LoadILLIndirect.cpp b/Framework/DataHandling/src/LoadILLIndirect.cpp
index 269c04e8bb0d431f50218baa900ddf5c6a1b34f9..06bb07aa0fdfe2797690aca152a58a951e208957 100644
--- a/Framework/DataHandling/src/LoadILLIndirect.cpp
+++ b/Framework/DataHandling/src/LoadILLIndirect.cpp
@@ -41,7 +41,9 @@ const std::string LoadILLIndirect::name() const { return "LoadILLIndirect"; }
 int LoadILLIndirect::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
-const std::string LoadILLIndirect::category() const { return "DataHandling"; }
+const std::string LoadILLIndirect::category() const {
+  return "DataHandling\\Nexus";
+}
 
 //----------------------------------------------------------------------------------------------
 
diff --git a/Framework/DataHandling/src/LoadILLReflectometry.cpp b/Framework/DataHandling/src/LoadILLReflectometry.cpp
index 18a7f5888d66210f3d3a443a45e13b9af4673e42..a8dcf73c9d2cdaa7180883f5c4030df533ccfc76 100644
--- a/Framework/DataHandling/src/LoadILLReflectometry.cpp
+++ b/Framework/DataHandling/src/LoadILLReflectometry.cpp
@@ -53,7 +53,7 @@ int LoadILLReflectometry::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string LoadILLReflectometry::category() const {
-  return "DataHandling";
+  return "DataHandling\\Nexus";
 }
 
 /**
diff --git a/Framework/DataHandling/src/LoadILLSANS.cpp b/Framework/DataHandling/src/LoadILLSANS.cpp
index f297a8ab4429bc9b3524e4e47fc2de8196be6c20..4e1dbb2d8ec9248de41d0bdbf944268e71168e64 100644
--- a/Framework/DataHandling/src/LoadILLSANS.cpp
+++ b/Framework/DataHandling/src/LoadILLSANS.cpp
@@ -36,7 +36,9 @@ const std::string LoadILLSANS::name() const { return "LoadILLSANS"; }
 int LoadILLSANS::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
-const std::string LoadILLSANS::category() const { return "DataHandling"; }
+const std::string LoadILLSANS::category() const {
+  return "DataHandling\\Nexus";
+}
 
 //----------------------------------------------------------------------------------------------
 
diff --git a/Framework/DataHandling/src/LoadLLB.cpp b/Framework/DataHandling/src/LoadLLB.cpp
index bc37e7062bcefcc6c1ebd042366bd6936c0577ed..a8bd587e4cc70436d7454cb4cbf19dacd684133c 100644
--- a/Framework/DataHandling/src/LoadLLB.cpp
+++ b/Framework/DataHandling/src/LoadLLB.cpp
@@ -43,7 +43,7 @@ const std::string LoadLLB::name() const { return "LoadLLB"; }
 int LoadLLB::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
-const std::string LoadLLB::category() const { return "DataHandling"; }
+const std::string LoadLLB::category() const { return "DataHandling\\Nexus"; }
 
 /**
  * Return the confidence with with this algorithm can load the file
diff --git a/Framework/DataHandling/src/LoadMLZ.cpp b/Framework/DataHandling/src/LoadMLZ.cpp
index 7f516fd0b87c3293659a9716d160ed8fe7c53742..3daaa90ce88cdacf4a27e6068947a93f884fbaac 100644
--- a/Framework/DataHandling/src/LoadMLZ.cpp
+++ b/Framework/DataHandling/src/LoadMLZ.cpp
@@ -61,7 +61,7 @@ const std::string LoadMLZ::name() const { return "LoadMLZ"; }
 int LoadMLZ::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
-const std::string LoadMLZ::category() const { return "DataHandling"; }
+const std::string LoadMLZ::category() const { return "DataHandling\\Nexus"; }
 
 //---------------------------------------------------------------------------
 /** Initialize the algorithm's properties.
diff --git a/Framework/DataHandling/src/LoadMcStas.cpp b/Framework/DataHandling/src/LoadMcStas.cpp
index 3d73a85223eba75dc22369cf75639ed51cb003b0..b10f5bb3e47e6cc496085f0d7bffc847b49bce2a 100644
--- a/Framework/DataHandling/src/LoadMcStas.cpp
+++ b/Framework/DataHandling/src/LoadMcStas.cpp
@@ -44,7 +44,7 @@ const std::string LoadMcStas::name() const { return "LoadMcStas"; }
 int LoadMcStas::version() const { return 1; }
 
 // Algorithm's category for identification. @see Algorithm::category
-const std::string LoadMcStas::category() const { return "DataHandling"; }
+const std::string LoadMcStas::category() const { return "DataHandling\\Nexus"; }
 
 //----------------------------------------------------------------------------------------------
 
diff --git a/Framework/DataHandling/src/LoadMcStasNexus.cpp b/Framework/DataHandling/src/LoadMcStasNexus.cpp
index b9d6986d76df11859f2e33e73ec4d7494efd176e..838c213b2699ad790c5d7f394e75f77d13784cc5 100644
--- a/Framework/DataHandling/src/LoadMcStasNexus.cpp
+++ b/Framework/DataHandling/src/LoadMcStasNexus.cpp
@@ -35,7 +35,9 @@ const std::string LoadMcStasNexus::name() const { return "LoadMcStasNexus"; }
 int LoadMcStasNexus::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
-const std::string LoadMcStasNexus::category() const { return "DataHandling"; }
+const std::string LoadMcStasNexus::category() const {
+  return "DataHandling\\Nexus";
+}
 
 /**
  * Return the confidence with with this algorithm can load the file
diff --git a/Framework/DataHandling/src/LoadNXSPE.cpp b/Framework/DataHandling/src/LoadNXSPE.cpp
index 10f70dff038bfb0af4f81f21e2d0e18459c9af2c..cb981d6575bbf22e3b13d8f79c8b491ae53e4542 100644
--- a/Framework/DataHandling/src/LoadNXSPE.cpp
+++ b/Framework/DataHandling/src/LoadNXSPE.cpp
@@ -368,14 +368,14 @@ Geometry::Object_sptr LoadNXSPE::createCuboid(double dx, double dy, double dz) {
   std::string S41 = "so 0.01"; // Sphere at origin radius 0.01
 
   // First create some surfaces
-  std::map<int, Geometry::Surface *> SphSurMap;
-  SphSurMap[41] = new Geometry::Sphere();
+  std::map<int, boost::shared_ptr<Geometry::Surface>> SphSurMap;
+  SphSurMap[41] = boost::make_shared<Geometry::Sphere>();
   SphSurMap[41]->setSurface(S41);
   SphSurMap[41]->setName(41);
 
   // A sphere
   std::string ObjSphere = "-41";
-  Geometry::Object_sptr retVal = Geometry::Object_sptr(new Geometry::Object);
+  Geometry::Object_sptr retVal = boost::make_shared<Geometry::Object>();
   retVal->setObject(41, ObjSphere);
   retVal->populate(SphSurMap);
 
diff --git a/Framework/DataHandling/src/LoadSINQFocus.cpp b/Framework/DataHandling/src/LoadSINQFocus.cpp
index 59d15f805e84b121b1cac833ae5131c78b734f68..7bfd2e0fefc048e573e19348f5158324fa9a0295 100644
--- a/Framework/DataHandling/src/LoadSINQFocus.cpp
+++ b/Framework/DataHandling/src/LoadSINQFocus.cpp
@@ -44,7 +44,9 @@ const std::string LoadSINQFocus::name() const { return "LoadSINQFocus"; }
 int LoadSINQFocus::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
-const std::string LoadSINQFocus::category() const { return "DataHandling"; }
+const std::string LoadSINQFocus::category() const {
+  return "DataHandling\\Nexus";
+}
 
 //----------------------------------------------------------------------------------------------
 
diff --git a/Framework/DataHandling/src/LoadSpiceAscii.cpp b/Framework/DataHandling/src/LoadSpiceAscii.cpp
index 3c102b15b35895bde64bf4fd73bceaac1fbda86a..73e328e21d49c3b0ba3e8e2a37c89382aa6284db 100644
--- a/Framework/DataHandling/src/LoadSpiceAscii.cpp
+++ b/Framework/DataHandling/src/LoadSpiceAscii.cpp
@@ -83,7 +83,9 @@ int LoadSpiceAscii::version() const { return 1; }
 //----------------------------------------------------------------------------------------------
 /** Category
  */
-const std::string LoadSpiceAscii::category() const { return "DataHandling"; }
+const std::string LoadSpiceAscii::category() const {
+  return "DataHandling\\Text";
+}
 
 //----------------------------------------------------------------------------------------------
 /** Summary
diff --git a/Framework/DataHandling/src/LoadSpiceXML2DDet.cpp b/Framework/DataHandling/src/LoadSpiceXML2DDet.cpp
index 5defd4a05be97697762812dec559c5e255ca7bf5..ceb48123dc0e37c3df5079869b690965493a5a9c 100644
--- a/Framework/DataHandling/src/LoadSpiceXML2DDet.cpp
+++ b/Framework/DataHandling/src/LoadSpiceXML2DDet.cpp
@@ -166,7 +166,9 @@ const std::string LoadSpiceXML2DDet::name() const {
 int LoadSpiceXML2DDet::version() const { return 1; }
 
 //----------------------------------------------------------------------------------------------
-const std::string LoadSpiceXML2DDet::category() const { return "DataHandling"; }
+const std::string LoadSpiceXML2DDet::category() const {
+  return "DataHandling\\XML";
+}
 
 //----------------------------------------------------------------------------------------------
 const std::string LoadSpiceXML2DDet::summary() const {
diff --git a/Framework/DataHandling/src/SaveDiffCal.cpp b/Framework/DataHandling/src/SaveDiffCal.cpp
index 96c2cbe07747c32a9b817a67505126fa137752eb..9d17f2e8a92aeb6c2af8d0c4ba3930c6e4e0c41b 100644
--- a/Framework/DataHandling/src/SaveDiffCal.cpp
+++ b/Framework/DataHandling/src/SaveDiffCal.cpp
@@ -48,7 +48,7 @@ int SaveDiffCal::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string SaveDiffCal::category() const {
-  return "DataHandling;Diffraction";
+  return "DataHandling\\Instrument;Diffraction\\DataHandling";
 }
 
 /// Algorithm's summary for use in the GUI and help. @see Algorithm::summary
diff --git a/Framework/DataHandling/src/SavePDFGui.cpp b/Framework/DataHandling/src/SavePDFGui.cpp
index 5afcbc2d76bcc9e1aef9f24b8b38b8bf08d609fc..0cbe02293abf81d851adc716f7f29d0b2c0ebed9 100644
--- a/Framework/DataHandling/src/SavePDFGui.cpp
+++ b/Framework/DataHandling/src/SavePDFGui.cpp
@@ -31,7 +31,7 @@ const std::string SavePDFGui::name() const { return "SavePDFGui"; }
 int SavePDFGui::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
-const std::string SavePDFGui::category() const { return "DataHandling"; }
+const std::string SavePDFGui::category() const { return "DataHandling\\Text"; }
 
 /// Algorithm's summary for use in the GUI and help. @see Algorithm::summary
 const std::string SavePDFGui::summary() const {
diff --git a/Framework/DataHandling/src/SetSampleMaterial.cpp b/Framework/DataHandling/src/SetSampleMaterial.cpp
index edebc10a1596215c36de02f09cca61f920ec2875..8d76dd8195c816b29ec4d52906d9d320edb79a53 100644
--- a/Framework/DataHandling/src/SetSampleMaterial.cpp
+++ b/Framework/DataHandling/src/SetSampleMaterial.cpp
@@ -29,9 +29,7 @@ const std::string SetSampleMaterial::name() const {
 
 int SetSampleMaterial::version() const { return (1); }
 
-const std::string SetSampleMaterial::category() const {
-  return "Sample;DataHandling";
-}
+const std::string SetSampleMaterial::category() const { return "Sample"; }
 
 using namespace Mantid::DataHandling;
 using namespace Mantid::API;
diff --git a/Framework/DataHandling/src/SortTableWorkspace.cpp b/Framework/DataHandling/src/SortTableWorkspace.cpp
index cb9119ca6ec786f4b093ddceffa395efa77bee75..81e0c979ab24d9bdf8cb57eaa9a0e2d1e08e3799 100644
--- a/Framework/DataHandling/src/SortTableWorkspace.cpp
+++ b/Framework/DataHandling/src/SortTableWorkspace.cpp
@@ -27,7 +27,9 @@ SortTableWorkspace::~SortTableWorkspace() {}
 int SortTableWorkspace::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
-const std::string SortTableWorkspace::category() const { return "Utility"; }
+const std::string SortTableWorkspace::category() const {
+  return "Utility\\Sorting";
+}
 
 /// Algorithm's summary for use in the GUI and help. @see Algorithm::summary
 const std::string SortTableWorkspace::summary() const {
diff --git a/Framework/DataHandling/test/LoadGSSTest.h b/Framework/DataHandling/test/LoadGSSTest.h
index 628641457d31816104c7bcf1dad9f71ac39d38d4..60e2cf5006633c76420bb498e3ebca1a38b3e9ce 100644
--- a/Framework/DataHandling/test/LoadGSSTest.h
+++ b/Framework/DataHandling/test/LoadGSSTest.h
@@ -16,7 +16,6 @@ public:
     Mantid::DataHandling::LoadGSS loader;
     TS_ASSERT_THROWS_NOTHING(loader.initialize())
     TS_ASSERT_EQUALS(loader.name(), "LoadGSS")
-    TS_ASSERT_EQUALS(loader.category(), "Diffraction;DataHandling\\Text")
     TS_ASSERT_EQUALS(loader.version(), 1)
   }
 
diff --git a/Framework/DataHandling/test/LoadSNSspecTest.h b/Framework/DataHandling/test/LoadSNSspecTest.h
index 4632e64032baf40216962b53d2b2336bbf9f6e7b..06558c84852a10cb1f256ae8a1789e06b53ab27a 100644
--- a/Framework/DataHandling/test/LoadSNSspecTest.h
+++ b/Framework/DataHandling/test/LoadSNSspecTest.h
@@ -22,8 +22,6 @@ public:
 
   void testVersion() { TS_ASSERT_EQUALS(loader.version(), 1); }
 
-  void testCategory() { TS_ASSERT_EQUALS(loader.category(), "DataHandling"); }
-
   void testInit() {
     TS_ASSERT_THROWS_NOTHING(loader.initialize());
     TS_ASSERT(loader.isInitialized());
diff --git a/Framework/DataHandling/test/SaveGSSTest.h b/Framework/DataHandling/test/SaveGSSTest.h
index da4c404a2141b32f4c5610b6de70d889c2050b0c..4e49a442ae8dbd9489144ebeadae05b03f2dc373 100644
--- a/Framework/DataHandling/test/SaveGSSTest.h
+++ b/Framework/DataHandling/test/SaveGSSTest.h
@@ -24,7 +24,6 @@ public:
     Mantid::DataHandling::SaveGSS saver;
     TS_ASSERT_THROWS_NOTHING(saver.initialize())
     TS_ASSERT_EQUALS(saver.name(), "SaveGSS")
-    TS_ASSERT_EQUALS(saver.category(), "Diffraction;DataHandling\\Text")
     TS_ASSERT_EQUALS(saver.version(), 1)
   }
 
diff --git a/Framework/Geometry/CMakeLists.txt b/Framework/Geometry/CMakeLists.txt
index 9c87fe5799580cff26fbdf93f0dbfedce84457af..79edc8cbe7c36100b14e9eba25cece9b5f5ad213 100644
--- a/Framework/Geometry/CMakeLists.txt
+++ b/Framework/Geometry/CMakeLists.txt
@@ -265,6 +265,17 @@ set ( INC_FILES
 	inc/MantidGeometry/Rendering/vtkGeometryCacheReader.h
 	inc/MantidGeometry/Rendering/vtkGeometryCacheWriter.h
 	inc/MantidGeometry/Surfaces/BaseVisit.h
+	inc/MantidGeometry/Surfaces/Cone.h
+	inc/MantidGeometry/Surfaces/Cylinder.h
+	inc/MantidGeometry/Surfaces/General.h
+	inc/MantidGeometry/Surfaces/Line.h
+	inc/MantidGeometry/Surfaces/LineIntersectVisit.h
+	inc/MantidGeometry/Surfaces/Plane.h
+	inc/MantidGeometry/Surfaces/Quadratic.h
+	inc/MantidGeometry/Surfaces/Sphere.h
+	inc/MantidGeometry/Surfaces/Surface.h
+	inc/MantidGeometry/Surfaces/SurfaceFactory.h
+	inc/MantidGeometry/Surfaces/Torus.h
 )
 
 set ( TEST_FILES
@@ -431,7 +442,7 @@ endif ()
 # Add to the 'Framework' group in VS
 set_property ( TARGET Geometry PROPERTY FOLDER "MantidFramework" )
 
-target_link_libraries ( Geometry LINK_PRIVATE ${TCMALLOC_LIBRARIES_LINKTIME} ${MANTIDLIBS}  ${OPENGL_LIBRARIES} ${GSL_LIBRARIES} ${NEXUS_LIBRARIES} )
+target_link_libraries ( Geometry LINK_PRIVATE ${TCMALLOC_LIBRARIES_LINKTIME} ${MANTIDLIBS}  ${OPENGL_LIBRARIES} ${GSL_LIBRARIES} ${NEXUS_LIBRARIES} ${JSONCPP_LIBRARIES} )
 
 if (ENABLE_OPENCASCADE)
   target_link_libraries ( Geometry LINK_PRIVATE ${OPENCASCADE_LIBRARIES} )
diff --git a/Framework/Geometry/inc/MantidGeometry/Objects/Object.h b/Framework/Geometry/inc/MantidGeometry/Objects/Object.h
index fba5b12c405f6d6825c189e5a253edb121c809e5..888c0ae989aad25d0cd49af554b8cf22d4756e38 100644
--- a/Framework/Geometry/inc/MantidGeometry/Objects/Object.h
+++ b/Framework/Geometry/inc/MantidGeometry/Objects/Object.h
@@ -85,11 +85,12 @@ public:
                           std::string &Ln); ///< Process a complementary object
   int hasComplement() const;
 
-  int populate(const std::map<int, Surface *> &);
+  int populate(const std::map<int, boost::shared_ptr<Surface>> &);
   int createSurfaceList(const int outFlag = 0); ///< create Surface list
   int addSurfString(const std::string &);       ///< Not implemented
   int removeSurface(const int SurfN);
-  int substituteSurf(const int SurfN, const int NsurfN, Surface *SPtr);
+  int substituteSurf(const int SurfN, const int NsurfN,
+                     const boost::shared_ptr<Surface> &SPtr);
   void makeComplement();
   void convertComplement(const std::map<int, Object> &);
 
diff --git a/Framework/Geometry/inc/MantidGeometry/Objects/Rules.h b/Framework/Geometry/inc/MantidGeometry/Objects/Rules.h
index 19b087753a6de29a79c71385c392fbe07d4671bc..ff61775548656938c0b6cdf2be05ede02324488c 100644
--- a/Framework/Geometry/inc/MantidGeometry/Objects/Rules.h
+++ b/Framework/Geometry/inc/MantidGeometry/Objects/Rules.h
@@ -2,6 +2,7 @@
 #define Rules_h
 
 #include <map>
+#include <boost/shared_ptr.hpp>
 
 class TopoDS_Shape;
 
@@ -95,7 +96,8 @@ public:
   } ///< Always returns false (0)
 
   int Eliminate(); ///< elimination not written
-  int substituteSurf(const int SurfN, const int newSurfN, Surface *SPtr);
+  int substituteSurf(const int SurfN, const int newSurfN,
+                     const boost::shared_ptr<Surface> &SPtr);
 
   /// Abstract Display
   virtual std::string display() const = 0;
@@ -228,15 +230,12 @@ be calculated
 
 class MANTID_GEOMETRY_DLL SurfPoint : public Rule {
 private:
-  Surface *key; ///< Actual Surface Base Object
-  int keyN;     ///< Key Number (identifer)
-  int sign;     ///< +/- in Object unit
+  boost::shared_ptr<Surface> m_key; ///< Actual Surface Base Object
+  int keyN;                         ///< Key Number (identifer)
+  int sign;                         ///< +/- in Object unit
 public:
   SurfPoint();
-  SurfPoint(const SurfPoint &);
   SurfPoint *clone() const;
-  SurfPoint &operator=(const SurfPoint &);
-  ~SurfPoint();
   virtual std::string className() const {
     return "SurfPoint";
   } ///< Returns class name as string
@@ -250,14 +249,14 @@ public:
   int type() const { return 0; } ///< Effective name
 
   void setKeyN(const int Ky); ///< set keyNumber
-  void setKey(Surface *);
+  void setKey(const boost::shared_ptr<Surface> &key);
   bool isValid(const Kernel::V3D &) const;
   bool isValid(const std::map<int, int> &) const;
   int getSign() const { return sign; } ///< Get Sign
   int getKeyN() const { return keyN; } ///< Get Key
   int simplify();
 
-  Surface *getKey() const { return key; } ///< Get Surface Ptr
+  Surface *getKey() const { return m_key.get(); } ///< Get Surface Ptr
   std::string display() const;
   std::string displayAddress() const;
   void getBoundingBox(double &xmax, double &ymax, double &zmax, double &xmin,
diff --git a/Framework/Geometry/inc/MantidGeometry/Objects/ShapeFactory.h b/Framework/Geometry/inc/MantidGeometry/Objects/ShapeFactory.h
index f80693a4c131af5e944559b09407a1f67b76baf6..283b9920c0f93f306f4fb3a0dbe148456cb8a628 100644
--- a/Framework/Geometry/inc/MantidGeometry/Objects/ShapeFactory.h
+++ b/Framework/Geometry/inc/MantidGeometry/Objects/ShapeFactory.h
@@ -83,32 +83,47 @@ public:
 
 private:
   std::string parseSphere(Poco::XML::Element *pElem,
-                          std::map<int, Surface *> &prim, int &l_id);
-  std::string parseInfinitePlane(Poco::XML::Element *pElem,
-                                 std::map<int, Surface *> &prim, int &l_id);
-  std::string parseInfiniteCylinder(Poco::XML::Element *pElem,
-                                    std::map<int, Surface *> &prim, int &l_id);
+                          std::map<int, boost::shared_ptr<Surface>> &prim,
+                          int &l_id);
+  std::string
+  parseInfinitePlane(Poco::XML::Element *pElem,
+                     std::map<int, boost::shared_ptr<Surface>> &prim,
+                     int &l_id);
+  std::string
+  parseInfiniteCylinder(Poco::XML::Element *pElem,
+                        std::map<int, boost::shared_ptr<Surface>> &prim,
+                        int &l_id);
   std::string parseCylinder(Poco::XML::Element *pElem,
-                            std::map<int, Surface *> &prim, int &l_id);
-  std::string parseSegmentedCylinder(Poco::XML::Element *pElem,
-                                     std::map<int, Surface *> &prim, int &l_id);
+                            std::map<int, boost::shared_ptr<Surface>> &prim,
+                            int &l_id);
+  std::string
+  parseSegmentedCylinder(Poco::XML::Element *pElem,
+                         std::map<int, boost::shared_ptr<Surface>> &prim,
+                         int &l_id);
 
   CuboidCorners parseCuboid(Poco::XML::Element *pElem);
   std::string parseCuboid(Poco::XML::Element *pElem,
-                          std::map<int, Surface *> &prim, int &l_id);
+                          std::map<int, boost::shared_ptr<Surface>> &prim,
+                          int &l_id);
   std::string parseInfiniteCone(Poco::XML::Element *pElem,
-                                std::map<int, Surface *> &prim, int &l_id);
+                                std::map<int, boost::shared_ptr<Surface>> &prim,
+                                int &l_id);
   std::string parseCone(Poco::XML::Element *pElem,
-                        std::map<int, Surface *> &prim, int &l_id);
+                        std::map<int, boost::shared_ptr<Surface>> &prim,
+                        int &l_id);
   std::string parseHexahedron(Poco::XML::Element *pElem,
-                              std::map<int, Surface *> &prim, int &l_id);
+                              std::map<int, boost::shared_ptr<Surface>> &prim,
+                              int &l_id);
   std::string parseTaperedGuide(Poco::XML::Element *pElem,
-                                std::map<int, Surface *> &prim, int &l_id);
+                                std::map<int, boost::shared_ptr<Surface>> &prim,
+                                int &l_id);
   std::string parseTorus(Poco::XML::Element *pElem,
-                         std::map<int, Surface *> &prim, int &l_id);
-  std::string parseSliceOfCylinderRing(Poco::XML::Element *pElem,
-                                       std::map<int, Surface *> &prim,
-                                       int &l_id);
+                         std::map<int, boost::shared_ptr<Surface>> &prim,
+                         int &l_id);
+  std::string
+  parseSliceOfCylinderRing(Poco::XML::Element *pElem,
+                           std::map<int, boost::shared_ptr<Surface>> &prim,
+                           int &l_id);
 
   Poco::XML::Element *getShapeElement(Poco::XML::Element *pElem,
                                       const std::string &name);
diff --git a/Framework/Geometry/inc/MantidGeometry/Surfaces/Cone.h b/Framework/Geometry/inc/MantidGeometry/Surfaces/Cone.h
index 1bbb794ba2d7a992f0cf6afb99e4767b7b3a765f..dd5bc1c7bf89a831e51265ee31eaeacf0c930e4d 100644
--- a/Framework/Geometry/inc/MantidGeometry/Surfaces/Cone.h
+++ b/Framework/Geometry/inc/MantidGeometry/Surfaces/Cone.h
@@ -49,17 +49,18 @@ private:
 
   void rotate(const Kernel::Matrix<double> &);
   void displace(const Kernel::V3D &);
+  Cone *doClone() const;
+
+protected:
+  Cone(const Cone &);
+  Cone &operator=(const Cone &);
 
 public:
   /// Public identifer
   virtual std::string className() const { return "Cone"; }
   Cone();
-  Cone(const Cone &);
-  Cone *clone() const;
-  Cone &operator=(const Cone &);
+  std::unique_ptr<Cone> clone() const;
   int operator==(const Cone &) const;
-  ~Cone();
-
   /// Calculate if the point R is within the cone (return -1) or outside (return
   /// 1)
   int side(const Kernel::V3D &R) const;
diff --git a/Framework/Geometry/inc/MantidGeometry/Surfaces/Cylinder.h b/Framework/Geometry/inc/MantidGeometry/Surfaces/Cylinder.h
index 9184521f2e6c8e81a882991cdab2dde10510ac7a..32b3c748b06a880670f46b9c1dced217760e38e3 100644
--- a/Framework/Geometry/inc/MantidGeometry/Surfaces/Cylinder.h
+++ b/Framework/Geometry/inc/MantidGeometry/Surfaces/Cylinder.h
@@ -56,16 +56,18 @@ private:
   void rotate(const Kernel::Matrix<double> &);
   void displace(const Kernel::V3D &);
   void setNvec(); ///< check to obtain orientation
+  Cylinder *doClone() const;
+
+protected:
+  Cylinder(const Cylinder &);
+  Cylinder &operator=(const Cylinder &);
 
 public:
   /// Public identifer
   virtual std::string className() const { return "Cylinder"; }
 
   Cylinder();
-  Cylinder(const Cylinder &);
-  Cylinder *clone() const;
-  Cylinder &operator=(const Cylinder &);
-  ~Cylinder();
+  std::unique_ptr<Cylinder> clone() const;
 
   // Visit acceptor
   virtual void acceptVisitor(BaseVisit &A) const { A.Accept(*this); }
diff --git a/Framework/Geometry/inc/MantidGeometry/Surfaces/General.h b/Framework/Geometry/inc/MantidGeometry/Surfaces/General.h
index 20ff5f181bc54d8bf71064985d938a07c58cf0db..3893a44b5a87a0559412804389236d9bdf786ebd 100644
--- a/Framework/Geometry/inc/MantidGeometry/Surfaces/General.h
+++ b/Framework/Geometry/inc/MantidGeometry/Surfaces/General.h
@@ -41,12 +41,16 @@ namespace Geometry {
 */
 
 class MANTID_GEOMETRY_DLL General : public Quadratic {
-public:
-  General();
+private:
+  General *doClone() const;
+
+protected:
   General(const General &);
-  General *clone() const;
   General &operator=(const General &);
-  ~General();
+
+public:
+  General();
+  std::unique_ptr<General> clone() const;
 
   int setSurface(const std::string &);
   void setBaseEqn();
diff --git a/Framework/Geometry/inc/MantidGeometry/Surfaces/Plane.h b/Framework/Geometry/inc/MantidGeometry/Surfaces/Plane.h
index dabfe313367521e49d6e280feb4b1d149207eee4..60c2793ebb3e4ce9d62a4a35a02f6fb51e69c814 100644
--- a/Framework/Geometry/inc/MantidGeometry/Surfaces/Plane.h
+++ b/Framework/Geometry/inc/MantidGeometry/Surfaces/Plane.h
@@ -53,16 +53,18 @@ private:
   double Dist;       ///< Distance
 
   std::size_t planeType() const; ///< are we alined on an axis
+  Plane *doClone() const;
+
+protected:
+  Plane(const Plane &);
+  Plane &operator=(const Plane &);
 
 public:
   /// Effective typename
   virtual std::string className() const { return "Plane"; }
 
   Plane();
-  Plane(const Plane &);
-  Plane *clone() const;
-  Plane &operator=(const Plane &);
-  virtual ~Plane();
+  std::unique_ptr<Plane> clone() const;
 
   virtual void acceptVisitor(BaseVisit &A) const { A.Accept(*this); }
 
diff --git a/Framework/Geometry/inc/MantidGeometry/Surfaces/Quadratic.h b/Framework/Geometry/inc/MantidGeometry/Surfaces/Quadratic.h
index 93b266c7e182f79c3d525f9f5ab891bfd1006fb7..977456c60c10072066ef5368fa51856d0f55707d 100644
--- a/Framework/Geometry/inc/MantidGeometry/Surfaces/Quadratic.h
+++ b/Framework/Geometry/inc/MantidGeometry/Surfaces/Quadratic.h
@@ -24,18 +24,18 @@ Holds a basic surface with equation form
 class MANTID_GEOMETRY_DLL Quadratic : public Surface {
 private:
   void matrixForm(Kernel::Matrix<double> &, Kernel::V3D &, double &) const;
+  Quadratic *doClone() const = 0;
 
 protected:
   std::vector<double> BaseEqn; ///< Base equation (as a 10 point vector)
+  Quadratic(const Quadratic &);
+  Quadratic &operator=(const Quadratic &);
 
 public:
   static const int Nprecision = 10; ///< Precision of the output
 
   Quadratic();
-  Quadratic(const Quadratic &);
-  virtual Quadratic *clone() const = 0; ///< Abstract clone function
-  Quadratic &operator=(const Quadratic &);
-  virtual ~Quadratic();
+  std::unique_ptr<Quadratic> clone() const;
 
   /// Accept visitor for line calculation
   virtual void acceptVisitor(BaseVisit &A) const { A.Accept(*this); }
diff --git a/Framework/Geometry/inc/MantidGeometry/Surfaces/Sphere.h b/Framework/Geometry/inc/MantidGeometry/Surfaces/Sphere.h
index 63dfe057f58db9821fcc717b3f95ea4886b4a516..f363f7302a3b96f2aa329319bb29010d77edb72c 100644
--- a/Framework/Geometry/inc/MantidGeometry/Surfaces/Sphere.h
+++ b/Framework/Geometry/inc/MantidGeometry/Surfaces/Sphere.h
@@ -49,13 +49,15 @@ private:
   void displace(const Kernel::V3D &);
   /// Compute the distance from the centre of the sphere to the given point
   double centreToPoint(const Kernel::V3D &pt) const;
+  Sphere *doClone() const;
 
-public:
-  Sphere();
+protected:
   Sphere(const Sphere &);
-  Sphere *clone() const;
   Sphere &operator=(const Sphere &);
-  ~Sphere();
+
+public:
+  Sphere();
+  std::unique_ptr<Sphere> clone() const;
   /// Effective typename
   virtual std::string className() const { return "Sphere"; }
   // Visit acceptor
diff --git a/Framework/Geometry/inc/MantidGeometry/Surfaces/Surface.h b/Framework/Geometry/inc/MantidGeometry/Surfaces/Surface.h
index 7372435ca684fdd7d86d0f2b2d55770f3395c568..9bda7fcc16d5caa00c292ce9590a3ae7cb099996 100644
--- a/Framework/Geometry/inc/MantidGeometry/Surfaces/Surface.h
+++ b/Framework/Geometry/inc/MantidGeometry/Surfaces/Surface.h
@@ -4,6 +4,7 @@
 #include "MantidGeometry/DllConfig.h"
 #include "BaseVisit.h"
 #include <string>
+#include <memory>
 
 class TopoDS_Shape;
 
@@ -46,14 +47,16 @@ namespace Geometry {
 */
 class MANTID_GEOMETRY_DLL Surface {
 private:
-  int Name; ///< Surface number (MCNPX identifier)
-
+  int Name;                             ///< Surface number (MCNPX identifier)
+  virtual Surface *doClone() const = 0; ///< Abstract clone function
 public:
   static const int Nprecision = 10; ///< Precision of the output
 
   Surface();
   Surface(const Surface &);
-  virtual Surface *clone() const = 0; ///< Abstract clone function
+  std::unique_ptr<Surface> clone() const {
+    return std::unique_ptr<Surface>(doClone());
+  };
   Surface &operator=(const Surface &);
   virtual ~Surface();
 
diff --git a/Framework/Geometry/inc/MantidGeometry/Surfaces/SurfaceFactory.h b/Framework/Geometry/inc/MantidGeometry/Surfaces/SurfaceFactory.h
index 298e9e90d29da1a3f511895d751d6a018056d760..4fa9b29fc6177f690437a4c8274040c44545af54 100644
--- a/Framework/Geometry/inc/MantidGeometry/Surfaces/SurfaceFactory.h
+++ b/Framework/Geometry/inc/MantidGeometry/Surfaces/SurfaceFactory.h
@@ -40,9 +40,10 @@ namespace Geometry {
 
 class MANTID_GEOMETRY_DLL SurfaceFactory {
 private:
-  typedef std::map<std::string, Surface *>
-      MapType; ///< Storage of surface pointers
-
+  // workaround because gcc 4.4 cannot have std::unique_ptr inside a std::map.
+  // http://stackoverflow.com/questions/7342703/gcc-4-4-4-5-unique-ptr-not-work-for-unordered-set-unordered-map
+  typedef std::vector<std::pair<std::string, std::unique_ptr<Surface>>>
+      MapType;                 ///< Storage of surface pointers
   static SurfaceFactory *FOBJ; ///< Effective "this"
 
   MapType SGrid;                  ///< The tally stack
@@ -60,9 +61,9 @@ public:
   static SurfaceFactory *Instance();
   ~SurfaceFactory();
 
-  Surface *createSurface(const std::string &) const;
-  Surface *createSurfaceID(const std::string &) const;
-  Surface *processLine(const std::string &) const;
+  std::unique_ptr<Surface> createSurface(const std::string &) const;
+  std::unique_ptr<Surface> createSurfaceID(const std::string &) const;
+  std::unique_ptr<Surface> processLine(const std::string &) const;
 };
 
 } // NAMESPACE Geometry
diff --git a/Framework/Geometry/inc/MantidGeometry/Surfaces/Torus.h b/Framework/Geometry/inc/MantidGeometry/Surfaces/Torus.h
index 6737fa55e7384ed41a4baf331594a5cc63dce189..cea5f95b03f80ff08a061f62e6ba53dd17a6c640 100644
--- a/Framework/Geometry/inc/MantidGeometry/Surfaces/Torus.h
+++ b/Framework/Geometry/inc/MantidGeometry/Surfaces/Torus.h
@@ -50,17 +50,19 @@ private:
 
   void rotate(const Kernel::Matrix<double> &);
   void displace(const Kernel::V3D &);
+  Torus *doClone() const;
+
+protected:
+  Torus(const Torus &);
+  Torus &operator=(const Torus &);
 
 public:
   /// Public identifier
   virtual std::string className() const { return "Torus"; }
 
   Torus();
-  Torus(const Torus &);
-  Torus *clone() const;
-  Torus &operator=(const Torus &);
+  std::unique_ptr<Torus> clone() const;
   int operator==(const Torus &) const;
-  ~Torus();
 
   /// Accept visitor for line calculation
   virtual void acceptVisitor(BaseVisit &A) const { A.Accept(*this); }
diff --git a/Framework/Geometry/src/Crystal/CompositeBraggScatterer.cpp b/Framework/Geometry/src/Crystal/CompositeBraggScatterer.cpp
index 7a58df47252a25f6fffaca657c66a6f8cc00c81d..0e8c9c5c80dbdb0093234212ab3cb3e7d6077d39 100644
--- a/Framework/Geometry/src/Crystal/CompositeBraggScatterer.cpp
+++ b/Framework/Geometry/src/Crystal/CompositeBraggScatterer.cpp
@@ -41,7 +41,7 @@ BraggScatterer_sptr CompositeBraggScatterer::clone() const {
 
   clone->setScatterers(m_scatterers);
 
-  clone->setProperties(this->asString(false, ';'));
+  clone->setProperties(this->asString(false));
 
   return clone;
 }
diff --git a/Framework/Geometry/src/Crystal/IsotropicAtomBraggScatterer.cpp b/Framework/Geometry/src/Crystal/IsotropicAtomBraggScatterer.cpp
index 6797299f9b47dfe25d63f7db5c9fa6b834d8f244..7f68db419bfe0b34d0250abff180447d596dc1db 100644
--- a/Framework/Geometry/src/Crystal/IsotropicAtomBraggScatterer.cpp
+++ b/Framework/Geometry/src/Crystal/IsotropicAtomBraggScatterer.cpp
@@ -11,6 +11,8 @@
 #include <boost/algorithm/string.hpp>
 #include <boost/assign.hpp>
 
+#include <json/json.h>
+
 namespace Mantid {
 namespace Geometry {
 
@@ -26,7 +28,7 @@ BraggScatterer_sptr IsotropicAtomBraggScatterer::clone() const {
   IsotropicAtomBraggScatterer_sptr clone =
       boost::make_shared<IsotropicAtomBraggScatterer>();
   clone->initialize();
-  clone->setProperties(this->asString(false, ';'));
+  clone->setProperties(this->asString(false));
 
   return clone;
 }
@@ -179,11 +181,14 @@ BraggScatterer_sptr IsotropicAtomBraggScattererParser::getScatterer(
       boost::assign::list_of("Element")("Position")("Occupancy")("U")
           .convert_to_container<std::vector<std::string>>();
 
-  std::string initString;
+  ::Json::Value root;
   for (size_t i = 0; i < cleanScattererTokens.size(); ++i) {
-    initString += properties[i] + "=" + cleanScattererTokens[i] + ";";
+    root[properties[i]] = cleanScattererTokens[i];
   }
 
+  ::Json::FastWriter writer;
+  std::string initString = writer.write(root);
+
   return BraggScattererFactory::Instance().createScatterer(
       "IsotropicAtomBraggScatterer", initString);
 }
diff --git a/Framework/Geometry/src/Objects/Object.cpp b/Framework/Geometry/src/Objects/Object.cpp
index 3c36a5a016b26b84a2055a23a377e902948dfe14..fe6b64745b34b25b440c2899a1e1248fd746ea21 100644
--- a/Framework/Geometry/src/Objects/Object.cpp
+++ b/Framework/Geometry/src/Objects/Object.cpp
@@ -267,7 +267,7 @@ int Object::hasComplement() const {
 * @retval 1000+ keyNumber :: Error with keyNumber
 * @retval 0 :: successfully populated all the whole Object.
 */
-int Object::populate(const std::map<int, Surface *> &Smap) {
+int Object::populate(const std::map<int, boost::shared_ptr<Surface>> &Smap) {
   std::deque<Rule *> Rst;
   Rst.push_back(TopRule);
   Rule *TA, *TB; // Tmp. for storage
@@ -281,7 +281,8 @@ int Object::populate(const std::map<int, Surface *> &Smap) {
       SurfPoint *KV = dynamic_cast<SurfPoint *>(T1);
       if (KV) {
         // Ensure that we have a it in the surface list:
-        std::map<int, Surface *>::const_iterator mf = Smap.find(KV->getKeyN());
+        std::map<int, boost::shared_ptr<Surface>>::const_iterator mf =
+            Smap.find(KV->getKeyN());
         if (mf != Smap.end()) {
           KV->setKey(mf->second);
           Rcount++;
@@ -549,7 +550,8 @@ int Object::removeSurface(const int SurfN) {
 * @param SPtr :: Surface pointer for surface NsurfN
 * @return number of surfaces substituted
 */
-int Object::substituteSurf(const int SurfN, const int NsurfN, Surface *SPtr) {
+int Object::substituteSurf(const int SurfN, const int NsurfN,
+                           const boost::shared_ptr<Surface> &SPtr) {
   if (!TopRule)
     return 0;
   const int out = TopRule->substituteSurf(SurfN, NsurfN, SPtr);
diff --git a/Framework/Geometry/src/Objects/RuleItems.cpp b/Framework/Geometry/src/Objects/RuleItems.cpp
index 648acf16494f7c8eee73aa1c26f424b8be6becf3..38266f5dae657baef855fda1d794b7347206b121 100644
--- a/Framework/Geometry/src/Objects/RuleItems.cpp
+++ b/Framework/Geometry/src/Objects/RuleItems.cpp
@@ -697,20 +697,12 @@ TopoDS_Shape Union::analyze() {
 //---------------------------------------------------------------
 
 SurfPoint::SurfPoint()
-    : Rule(), key(NULL), keyN(0), sign(1)
+    : Rule(), m_key(), keyN(0), sign(1)
 /**
   Constructor with null key/number
 */
 {}
 
-SurfPoint::SurfPoint(const SurfPoint &A)
-    : Rule(), key(A.key->clone()), keyN(A.keyN), sign(A.sign)
-/**
-  Copy constructor
-  @param A :: SurfPoint to copy
-*/
-{}
-
 SurfPoint *SurfPoint::clone() const
 /**
   Clone constructor
@@ -720,30 +712,6 @@ SurfPoint *SurfPoint::clone() const
   return new SurfPoint(*this);
 }
 
-SurfPoint &SurfPoint::operator=(const SurfPoint &A)
-/**
-  Assigment operator
-  @param A :: Object to copy
-  @return *this
-*/
-{
-  if (&A != this) {
-    delete key;
-    key = A.key->clone();
-    keyN = A.keyN;
-    sign = A.sign;
-  }
-  return *this;
-}
-
-SurfPoint::~SurfPoint()
-/**
-  Destructor
-*/
-{
-  delete key;
-}
-
 void SurfPoint::setLeaf(Rule *nR, const int)
 /**
   Replaces a leaf with a rule.
@@ -806,15 +774,13 @@ void SurfPoint::setKeyN(const int Ky)
   return;
 }
 
-void SurfPoint::setKey(Surface *Spoint)
+void SurfPoint::setKey(const boost::shared_ptr<Surface> &Spoint)
 /**
   Sets the key pointer. The class takes ownership.
   @param Spoint :: new key values
 */
 {
-  if (key != Spoint)
-    delete key;
-  key = Spoint;
+  m_key = Spoint;
   return;
 }
 
@@ -837,8 +803,8 @@ bool SurfPoint::isValid(const Kernel::V3D &Pt) const
   @retval 0 :: Pt is on the -ve side of the surface
 */
 {
-  if (key) {
-    return (key->side(Pt) * sign) >= 0;
+  if (m_key) {
+    return (m_key->side(Pt) * sign) >= 0;
   }
   return false;
 }
@@ -894,7 +860,7 @@ std::string SurfPoint::displayAddress() const
 void SurfPoint::getBoundingBox(double &xmax, double &ymax, double &zmax,
                                double &xmin, double &ymin, double &zmin) {
   if (this->sign < 1) // If the object sign is positive then include
-    key->getBoundingBox(xmax, ymax, zmax, xmin, ymin, zmin);
+    m_key->getBoundingBox(xmax, ymax, zmax, xmin, ymin, zmin);
   else { // if the object sign is negative then get the complement
     std::vector<V3D> listOfPoints;
     double gXmax, gYmax, gZmax, gXmin, gYmin, gZmin;
@@ -904,7 +870,7 @@ void SurfPoint::getBoundingBox(double &xmax, double &ymax, double &zmax,
     gXmin = xmin;
     gYmin = ymin;
     gZmin = zmin;
-    key->getBoundingBox(gXmax, gYmax, gZmax, gXmin, gYmin, gZmin);
+    m_key->getBoundingBox(gXmax, gYmax, gZmax, gXmin, gYmin, gZmin);
     if (!((xmax <= gXmax && xmax >= gXmin) &&
           (ymax <= gYmax && ymax >= gYmin) && (zmax <= gZmax && zmax >= gZmin)))
       listOfPoints.push_back(V3D(xmax, ymax, zmax));
@@ -990,10 +956,10 @@ void SurfPoint::getBoundingBox(double &xmax, double &ymax, double &zmax,
 #ifdef ENABLE_OPENCASCADE
 TopoDS_Shape SurfPoint::analyze() {
   // Check for individual type of surfaces
-  TopoDS_Shape Result = key->createShape();
+  TopoDS_Shape Result = m_key->createShape();
   if (sign > 0)
     Result.Complement();
-  if (key->className() == "Plane") {
+  if (m_key->className() == "Plane") {
     // build a box
     gp_Pnt p(-1000.0, -1000.0, -1000.0);
     TopoDS_Shape world = BRepPrimAPI_MakeBox(p, 2000.0, 2000.0, 2000.0).Shape();
diff --git a/Framework/Geometry/src/Objects/Rules.cpp b/Framework/Geometry/src/Objects/Rules.cpp
index 3e7a9641f380c0dc9a094beb66ce7bbc594b1158..c9de7378025c2e8943e0bdbad583e9988ca03005 100644
--- a/Framework/Geometry/src/Objects/Rules.cpp
+++ b/Framework/Geometry/src/Objects/Rules.cpp
@@ -421,7 +421,7 @@ int Rule::removeItem(Rule *&TRule, const int SurfN)
         throw std::logic_error("Failed to cast Rule object to SurfPoint");
       }
       SX->setKeyN(0);
-      SX->setKey(0);
+      SX->setKey(boost::shared_ptr<Surface>());
       return cnt + 1;
     }
     delete Ptr;
@@ -578,7 +578,8 @@ int Rule::commonType() const
   return rtype;
 }
 
-int Rule::substituteSurf(const int SurfN, const int newSurfN, Surface *SPtr)
+int Rule::substituteSurf(const int SurfN, const int newSurfN,
+                         const boost::shared_ptr<Surface> &SPtr)
 /**
   Substitues a surface item if within a rule
   @param SurfN :: Number number to change
@@ -591,12 +592,11 @@ int Rule::substituteSurf(const int SurfN, const int newSurfN, Surface *SPtr)
   SurfPoint *Ptr = dynamic_cast<SurfPoint *>(findKey(SurfN));
   while (Ptr) {
     Ptr->setKeyN(Ptr->getSign() * newSurfN);
-    Ptr->setKey(SPtr->clone()); // Clone to ensure uniqueness
+    Ptr->setKey(SPtr);
     cnt++;
     // get next key
     Ptr = dynamic_cast<SurfPoint *>(findKey(SurfN));
   }
-  delete SPtr; // Delete incoming pointer
   return cnt;
 }
 
diff --git a/Framework/Geometry/src/Objects/ShapeFactory.cpp b/Framework/Geometry/src/Objects/ShapeFactory.cpp
index 4341e7e21b071d591ca801bcca6d4830c751437e..69e7181d95a3d1e99f9545854de88ac3f2f23aa6 100644
--- a/Framework/Geometry/src/Objects/ShapeFactory.cpp
+++ b/Framework/Geometry/src/Objects/ShapeFactory.cpp
@@ -24,6 +24,8 @@
 #include <Poco/DOM/Element.h>
 #include <Poco/DOM/NodeList.h>
 
+#include "boost/make_shared.hpp"
+
 using Poco::XML::DOMParser;
 using Poco::XML::Document;
 using Poco::XML::Element;
@@ -110,8 +112,7 @@ boost::shared_ptr<Object> ShapeFactory::createShape(Poco::XML::Element *pElem) {
 
   std::string shapeXML = xmlstream.str();
 
-  boost::shared_ptr<Object> retVal =
-      boost::shared_ptr<Object>(new Object(shapeXML));
+  boost::shared_ptr<Object> retVal = boost::make_shared<Object>(shapeXML);
 
   bool defaultAlgebra =
       false; // if no <algebra> element then use default algebra
@@ -141,8 +142,9 @@ boost::shared_ptr<Object> ShapeFactory::createShape(Poco::XML::Element *pElem) {
   unsigned long pNL_length = pNL->length();
   int numPrimitives =
       0; // used for counting number of primitives in this 'type' XML element
-  std::map<int, Surface *> primitives; // stores the primitives that will be
-                                       // used to build final shape
+  std::map<int, boost::shared_ptr<Surface>>
+      primitives; // stores the primitives that will be
+                  // used to build final shape
   int l_id = 1; // used to build up unique id's for each shape added. Must start
                 // from int > zero.
 
@@ -321,9 +323,10 @@ boost::shared_ptr<Object> ShapeFactory::createShape(Poco::XML::Element *pElem) {
  *  @throw InstrumentDefinitionError Thrown if issues with the content of XML
  *instrument file
  */
-std::string ShapeFactory::parseSphere(Poco::XML::Element *pElem,
-                                      std::map<int, Surface *> &prim,
-                                      int &l_id) {
+std::string
+ShapeFactory::parseSphere(Poco::XML::Element *pElem,
+                          std::map<int, boost::shared_ptr<Surface>> &prim,
+                          int &l_id) {
   Element *pElemCentre = getOptionalShapeElement(pElem, "centre");
   Element *pElemRadius = getShapeElement(pElem, "radius");
 
@@ -332,7 +335,7 @@ std::string ShapeFactory::parseSphere(Poco::XML::Element *pElem,
 
   // create sphere
   const V3D centre = pElemCentre ? parsePosition(pElemCentre) : DEFAULT_CENTRE;
-  Sphere *pSphere = new Sphere;
+  auto pSphere = boost::make_shared<Sphere>();
   pSphere->setCentre(centre);
   pSphere->setRadius(radius);
   prim[l_id] = pSphere;
@@ -354,14 +357,14 @@ std::string ShapeFactory::parseSphere(Poco::XML::Element *pElem,
  *  @throw InstrumentDefinitionError Thrown if issues with the content of XML
  *instrument file
  */
-std::string ShapeFactory::parseInfinitePlane(Poco::XML::Element *pElem,
-                                             std::map<int, Surface *> &prim,
-                                             int &l_id) {
+std::string ShapeFactory::parseInfinitePlane(
+    Poco::XML::Element *pElem, std::map<int, boost::shared_ptr<Surface>> &prim,
+    int &l_id) {
   Element *pElemPip = getShapeElement(pElem, "point-in-plane");
   Element *pElemNormal = getShapeElement(pElem, "normal-to-plane");
 
   // create infinite-plane
-  Plane *pPlane = new Plane();
+  auto pPlane = boost::make_shared<Plane>();
   pPlane->setPlane(parsePosition(pElemPip), parsePosition(pElemNormal));
   prim[l_id] = pPlane;
 
@@ -382,9 +385,9 @@ std::string ShapeFactory::parseInfinitePlane(Poco::XML::Element *pElem,
  *  @throw InstrumentDefinitionError Thrown if issues with the content of XML
  *instrument file
  */
-std::string ShapeFactory::parseInfiniteCylinder(Poco::XML::Element *pElem,
-                                                std::map<int, Surface *> &prim,
-                                                int &l_id) {
+std::string ShapeFactory::parseInfiniteCylinder(
+    Poco::XML::Element *pElem, std::map<int, boost::shared_ptr<Surface>> &prim,
+    int &l_id) {
   Element *pElemCentre = getShapeElement(pElem, "centre");
   Element *pElemAxis = getShapeElement(pElem, "axis");
   Element *pElemRadius = getShapeElement(pElem, "radius");
@@ -393,7 +396,7 @@ std::string ShapeFactory::parseInfiniteCylinder(Poco::XML::Element *pElem,
   const double radius = getDoubleAttribute(pElemRadius, "val");
 
   // create infinite-cylinder
-  Cylinder *pCylinder = new Cylinder();
+  auto pCylinder = boost::make_shared<Cylinder>();
   pCylinder->setCentre(parsePosition(pElemCentre));
 
   V3D dummy1 = pCylinder->getCentre();
@@ -421,9 +424,10 @@ std::string ShapeFactory::parseInfiniteCylinder(Poco::XML::Element *pElem,
  *  @throw InstrumentDefinitionError Thrown if issues with the content of XML
  *instrument file
  */
-std::string ShapeFactory::parseCylinder(Poco::XML::Element *pElem,
-                                        std::map<int, Surface *> &prim,
-                                        int &l_id) {
+std::string
+ShapeFactory::parseCylinder(Poco::XML::Element *pElem,
+                            std::map<int, boost::shared_ptr<Surface>> &prim,
+                            int &l_id) {
   Element *pElemBase = getShapeElement(pElem, "centre-of-bottom-base");
   Element *pElemAxis = getShapeElement(pElem, "axis");
   Element *pElemRadius = getShapeElement(pElem, "radius");
@@ -437,7 +441,7 @@ std::string ShapeFactory::parseCylinder(Poco::XML::Element *pElem,
   const double height = getDoubleAttribute(pElemHeight, "val");
 
   // add infinite cylinder
-  Cylinder *pCylinder = new Cylinder();
+  auto pCylinder = boost::make_shared<Cylinder>();
   V3D centreOfBottomBase = parsePosition(pElemBase);
   pCylinder->setCentre(centreOfBottomBase + normVec * (0.5 * height));
   pCylinder->setNorm(normVec);
@@ -449,7 +453,7 @@ std::string ShapeFactory::parseCylinder(Poco::XML::Element *pElem,
   l_id++;
 
   // add top plane
-  Plane *pPlaneTop = new Plane();
+  auto pPlaneTop = boost::make_shared<Plane>();
   // to get point in top plane
   V3D pointInPlane = centreOfBottomBase + (normVec * height);
   pPlaneTop->setPlane(pointInPlane, normVec);
@@ -458,7 +462,7 @@ std::string ShapeFactory::parseCylinder(Poco::XML::Element *pElem,
   l_id++;
 
   // add bottom plane
-  Plane *pPlaneBottom = new Plane();
+  auto pPlaneBottom = boost::make_shared<Plane>();
   pPlaneBottom->setPlane(centreOfBottomBase, normVec);
   prim[l_id] = pPlaneBottom;
   retAlgebraMatch << "" << l_id << ")";
@@ -478,9 +482,9 @@ std::string ShapeFactory::parseCylinder(Poco::XML::Element *pElem,
  *  @throw InstrumentDefinitionError Thrown if issues with the content of XML
  *instrument file
  */
-std::string ShapeFactory::parseSegmentedCylinder(Poco::XML::Element *pElem,
-                                                 std::map<int, Surface *> &prim,
-                                                 int &l_id) {
+std::string ShapeFactory::parseSegmentedCylinder(
+    Poco::XML::Element *pElem, std::map<int, boost::shared_ptr<Surface>> &prim,
+    int &l_id) {
   Element *pElemBase = getShapeElement(pElem, "centre-of-bottom-base");
   Element *pElemAxis = getShapeElement(pElem, "axis");
   Element *pElemRadius = getShapeElement(pElem, "radius");
@@ -494,7 +498,7 @@ std::string ShapeFactory::parseSegmentedCylinder(Poco::XML::Element *pElem,
   const double height = getDoubleAttribute(pElemHeight, "val");
 
   // add infinite cylinder
-  Cylinder *pCylinder = new Cylinder();
+  auto pCylinder = boost::make_shared<Cylinder>();
   V3D centreOfBottomBase = parsePosition(pElemBase);
   pCylinder->setCentre(centreOfBottomBase + normVec * (0.5 * height));
   pCylinder->setNorm(normVec);
@@ -506,7 +510,7 @@ std::string ShapeFactory::parseSegmentedCylinder(Poco::XML::Element *pElem,
   l_id++;
 
   // add top plane
-  Plane *pPlaneTop = new Plane();
+  auto pPlaneTop = boost::make_shared<Plane>();
   // to get point in top plane
   V3D pointInPlane = centreOfBottomBase + (normVec * height);
   pPlaneTop->setPlane(pointInPlane, normVec);
@@ -515,7 +519,7 @@ std::string ShapeFactory::parseSegmentedCylinder(Poco::XML::Element *pElem,
   l_id++;
 
   // add bottom plane
-  Plane *pPlaneBottom = new Plane();
+  auto pPlaneBottom = boost::make_shared<Plane>();
   pPlaneBottom->setPlane(centreOfBottomBase, normVec);
   prim[l_id] = pPlaneBottom;
   retAlgebraMatch << "" << l_id << ")";
@@ -626,20 +630,20 @@ CuboidCorners ShapeFactory::parseCuboid(Poco::XML::Element *pElem) {
  *  @throw InstrumentDefinitionError Thrown if issues with the content of XML
  *instrument file
  */
-std::string ShapeFactory::parseCuboid(Poco::XML::Element *pElem,
-                                      std::map<int, Surface *> &prim,
-                                      int &l_id) {
+std::string
+ShapeFactory::parseCuboid(Poco::XML::Element *pElem,
+                          std::map<int, boost::shared_ptr<Surface>> &prim,
+                          int &l_id) {
   auto corners = parseCuboid(pElem);
 
   V3D pointTowardBack = corners.lbb - corners.lfb;
   pointTowardBack.normalize();
 
   // add front plane cutoff
-  Plane *pPlaneFrontCutoff = new Plane();
+  auto pPlaneFrontCutoff = boost::make_shared<Plane>();
   try {
     pPlaneFrontCutoff->setPlane(corners.lfb, pointTowardBack);
   } catch (std::invalid_argument &) {
-    delete pPlaneFrontCutoff;
     throw;
   }
   prim[l_id] = pPlaneFrontCutoff;
@@ -649,11 +653,10 @@ std::string ShapeFactory::parseCuboid(Poco::XML::Element *pElem,
   l_id++;
 
   // add back plane cutoff
-  Plane *pPlaneBackCutoff = new Plane();
+  auto pPlaneBackCutoff = boost::make_shared<Plane>();
   try {
     pPlaneBackCutoff->setPlane(corners.lbb, pointTowardBack);
   } catch (std::invalid_argument &) {
-    delete pPlaneFrontCutoff;
     throw;
   }
   prim[l_id] = pPlaneBackCutoff;
@@ -664,11 +667,10 @@ std::string ShapeFactory::parseCuboid(Poco::XML::Element *pElem,
   pointTowardRight.normalize();
 
   // add left plane cutoff
-  Plane *pPlaneLeftCutoff = new Plane();
+  auto pPlaneLeftCutoff = boost::make_shared<Plane>();
   try {
     pPlaneLeftCutoff->setPlane(corners.lfb, pointTowardRight);
   } catch (std::invalid_argument &) {
-    delete pPlaneFrontCutoff;
     throw;
   }
   prim[l_id] = pPlaneLeftCutoff;
@@ -676,11 +678,10 @@ std::string ShapeFactory::parseCuboid(Poco::XML::Element *pElem,
   l_id++;
 
   // add right plane cutoff
-  Plane *pPlaneRightCutoff = new Plane();
+  auto pPlaneRightCutoff = boost::make_shared<Plane>();
   try {
     pPlaneRightCutoff->setPlane(corners.rfb, pointTowardRight);
   } catch (std::invalid_argument &) {
-    delete pPlaneFrontCutoff;
     throw;
   }
   prim[l_id] = pPlaneRightCutoff;
@@ -691,11 +692,10 @@ std::string ShapeFactory::parseCuboid(Poco::XML::Element *pElem,
   pointTowardTop.normalize();
 
   // add bottom plane cutoff
-  Plane *pPlaneBottomCutoff = new Plane();
+  auto pPlaneBottomCutoff = boost::make_shared<Plane>();
   try {
     pPlaneBottomCutoff->setPlane(corners.lfb, pointTowardTop);
   } catch (std::invalid_argument &) {
-    delete pPlaneFrontCutoff;
     throw;
   }
   prim[l_id] = pPlaneBottomCutoff;
@@ -703,11 +703,10 @@ std::string ShapeFactory::parseCuboid(Poco::XML::Element *pElem,
   l_id++;
 
   // add top plane cutoff
-  Plane *pPlaneTopCutoff = new Plane();
+  auto pPlaneTopCutoff = boost::make_shared<Plane>();
   try {
     pPlaneTopCutoff->setPlane(corners.lft, pointTowardTop);
   } catch (std::invalid_argument &) {
-    delete pPlaneFrontCutoff;
     throw;
   }
   prim[l_id] = pPlaneTopCutoff;
@@ -728,9 +727,10 @@ std::string ShapeFactory::parseCuboid(Poco::XML::Element *pElem,
  *  @throw InstrumentDefinitionError Thrown if issues with the content of XML
  *instrument file
  */
-std::string ShapeFactory::parseInfiniteCone(Poco::XML::Element *pElem,
-                                            std::map<int, Surface *> &prim,
-                                            int &l_id) {
+std::string
+ShapeFactory::parseInfiniteCone(Poco::XML::Element *pElem,
+                                std::map<int, boost::shared_ptr<Surface>> &prim,
+                                int &l_id) {
   Element *pElemTipPoint = getShapeElement(pElem, "tip-point");
   Element *pElemAxis = getShapeElement(pElem, "axis");
   Element *pElemAngle = getShapeElement(pElem, "angle");
@@ -742,7 +742,7 @@ std::string ShapeFactory::parseInfiniteCone(Poco::XML::Element *pElem,
   const double angle = getDoubleAttribute(pElemAngle, "val");
 
   // add infinite double cone
-  Cone *pCone = new Cone();
+  auto pCone = boost::make_shared<Cone>();
   pCone->setCentre(parsePosition(pElemTipPoint));
   pCone->setNorm(normVec);
   pCone->setAngle(angle);
@@ -753,7 +753,7 @@ std::string ShapeFactory::parseInfiniteCone(Poco::XML::Element *pElem,
   l_id++;
 
   // plane top cut of top part of double cone
-  Plane *pPlaneBottom = new Plane();
+  auto pPlaneBottom = boost::make_shared<Plane>();
   pPlaneBottom->setPlane(parsePosition(pElemTipPoint), normVec);
   prim[l_id] = pPlaneBottom;
   retAlgebraMatch << "-" << l_id << ")";
@@ -773,8 +773,10 @@ std::string ShapeFactory::parseInfiniteCone(Poco::XML::Element *pElem,
  *  @throw InstrumentDefinitionError Thrown if issues with the content of XML
  *instrument file
  */
-std::string ShapeFactory::parseCone(Poco::XML::Element *pElem,
-                                    std::map<int, Surface *> &prim, int &l_id) {
+std::string
+ShapeFactory::parseCone(Poco::XML::Element *pElem,
+                        std::map<int, boost::shared_ptr<Surface>> &prim,
+                        int &l_id) {
   Element *pElemTipPoint = getShapeElement(pElem, "tip-point");
   Element *pElemAxis = getShapeElement(pElem, "axis");
   Element *pElemAngle = getShapeElement(pElem, "angle");
@@ -788,7 +790,7 @@ std::string ShapeFactory::parseCone(Poco::XML::Element *pElem,
   const double height = getDoubleAttribute(pElemHeight, "val");
 
   // add infinite double cone
-  Cone *pCone = new Cone();
+  auto pCone = boost::make_shared<Cone>();
   pCone->setCentre(parsePosition(pElemTipPoint));
   pCone->setNorm(normVec);
   pCone->setAngle(angle);
@@ -799,7 +801,7 @@ std::string ShapeFactory::parseCone(Poco::XML::Element *pElem,
   l_id++;
 
   // Plane to cut off cone from below
-  Plane *pPlaneTop = new Plane();
+  auto pPlaneTop = boost::make_shared<Plane>();
   V3D pointInPlane = parsePosition(pElemTipPoint);
   pointInPlane -= (normVec * height);
   pPlaneTop->setPlane(pointInPlane, normVec);
@@ -808,7 +810,7 @@ std::string ShapeFactory::parseCone(Poco::XML::Element *pElem,
   l_id++;
 
   // plane top cut of top part of double cone
-  Plane *pPlaneBottom = new Plane();
+  auto pPlaneBottom = boost::make_shared<Plane>();
   pPlaneBottom->setPlane(parsePosition(pElemTipPoint), normVec);
   prim[l_id] = pPlaneBottom;
   retAlgebraMatch << "-" << l_id << ")";
@@ -836,16 +838,17 @@ struct Hexahedron {
  * the 8 points that make up either shape, the process of parsing them can be
  * exactly the same in both cases.
  */
-std::string parseHexahedronFromStruct(Hexahedron &hex,
-                                      std::map<int, Surface *> &prim,
-                                      int &l_id) {
+std::string
+parseHexahedronFromStruct(Hexahedron &hex,
+                          std::map<int, boost::shared_ptr<Surface>> &prim,
+                          int &l_id) {
   V3D pointTowardBack = hex.lbb - hex.lfb;
   pointTowardBack.normalize();
 
   V3D normal;
 
   // add front face
-  Plane *pPlaneFrontCutoff = new Plane();
+  auto pPlaneFrontCutoff = boost::make_shared<Plane>();
   normal = (hex.rfb - hex.lfb).cross_prod(hex.lft - hex.lfb);
 
   // V3D jjj = (normal*(rfb-rbb));
@@ -858,7 +861,7 @@ std::string parseHexahedronFromStruct(Hexahedron &hex,
   l_id++;
 
   // add back face
-  Plane *pPlaneBackCutoff = new Plane();
+  auto pPlaneBackCutoff = boost::make_shared<Plane>();
   normal = (hex.rbb - hex.lbb).cross_prod(hex.lbt - hex.lbb);
   if (normal.scalar_prod(hex.rfb - hex.rbb) < 0)
     normal *= -1.0;
@@ -868,7 +871,7 @@ std::string parseHexahedronFromStruct(Hexahedron &hex,
   l_id++;
 
   // add left face
-  Plane *pPlaneLeftCutoff = new Plane();
+  auto pPlaneLeftCutoff = boost::make_shared<Plane>();
   normal = (hex.lbb - hex.lfb).cross_prod(hex.lft - hex.lfb);
   if (normal.scalar_prod(hex.rfb - hex.lfb) < 0)
     normal *= -1.0;
@@ -878,7 +881,7 @@ std::string parseHexahedronFromStruct(Hexahedron &hex,
   l_id++;
 
   // add right face
-  Plane *pPlaneRightCutoff = new Plane();
+  auto pPlaneRightCutoff = boost::make_shared<Plane>();
   normal = (hex.rbb - hex.rfb).cross_prod(hex.rft - hex.rfb);
   if (normal.scalar_prod(hex.rfb - hex.lfb) < 0)
     normal *= -1.0;
@@ -888,7 +891,7 @@ std::string parseHexahedronFromStruct(Hexahedron &hex,
   l_id++;
 
   // add top face
-  Plane *pPlaneTopCutoff = new Plane();
+  auto pPlaneTopCutoff = boost::make_shared<Plane>();
   normal = (hex.rft - hex.lft).cross_prod(hex.lbt - hex.lft);
   if (normal.scalar_prod(hex.rft - hex.rfb) < 0)
     normal *= -1.0;
@@ -898,7 +901,7 @@ std::string parseHexahedronFromStruct(Hexahedron &hex,
   l_id++;
 
   // add bottom face
-  Plane *pPlaneBottomCutoff = new Plane();
+  auto pPlaneBottomCutoff = boost::make_shared<Plane>();
   normal = (hex.rfb - hex.lfb).cross_prod(hex.lbb - hex.lfb);
   if (normal.scalar_prod(hex.rft - hex.rfb) < 0)
     normal *= -1.0;
@@ -922,9 +925,10 @@ std::string parseHexahedronFromStruct(Hexahedron &hex,
  *  @throw InstrumentDefinitionError Thrown if issues with the content of XML
  *instrument file
  */
-std::string ShapeFactory::parseHexahedron(Poco::XML::Element *pElem,
-                                          std::map<int, Surface *> &prim,
-                                          int &l_id) {
+std::string
+ShapeFactory::parseHexahedron(Poco::XML::Element *pElem,
+                              std::map<int, boost::shared_ptr<Surface>> &prim,
+                              int &l_id) {
   Element *pElem_lfb = getShapeElement(pElem, "left-front-bottom-point");
   Element *pElem_lft = getShapeElement(pElem, "left-front-top-point");
   Element *pElem_lbb = getShapeElement(pElem, "left-back-bottom-point");
@@ -959,9 +963,10 @@ std::string ShapeFactory::parseHexahedron(Poco::XML::Element *pElem,
  *  @throw InstrumentDefinitionError Thrown if issues with the content of XML
  *instrument file
  */
-std::string ShapeFactory::parseTaperedGuide(Poco::XML::Element *pElem,
-                                            std::map<int, Surface *> &prim,
-                                            int &l_id) {
+std::string
+ShapeFactory::parseTaperedGuide(Poco::XML::Element *pElem,
+                                std::map<int, boost::shared_ptr<Surface>> &prim,
+                                int &l_id) {
   Element *pElemApertureStart = getShapeElement(pElem, "aperture-start");
   Element *pElemLength = getShapeElement(pElem, "length");
   Element *pElemApertureEnd = getShapeElement(pElem, "aperture-end");
@@ -1036,9 +1041,10 @@ std::string ShapeFactory::parseTaperedGuide(Poco::XML::Element *pElem,
  *  @throw InstrumentDefinitionError Thrown if issues with the content of XML
  *instrument file
  */
-std::string ShapeFactory::parseTorus(Poco::XML::Element *pElem,
-                                     std::map<int, Surface *> &prim,
-                                     int &l_id) {
+std::string
+ShapeFactory::parseTorus(Poco::XML::Element *pElem,
+                         std::map<int, boost::shared_ptr<Surface>> &prim,
+                         int &l_id) {
   Element *pElemCentre = getShapeElement(pElem, "centre");
   Element *pElemAxis = getShapeElement(pElem, "axis");
   Element *pElemRadiusFromCentre =
@@ -1053,7 +1059,7 @@ std::string ShapeFactory::parseTorus(Poco::XML::Element *pElem,
   const double radiusTube = getDoubleAttribute(pElemRadiusTube, "val");
 
   // add torus
-  Torus *pTorus = new Torus();
+  auto pTorus = boost::make_shared<Torus>();
   pTorus->setCentre(parsePosition(pElemCentre));
   pTorus->setNorm(normVec);
   pTorus->setDistanceFromCentreToTube(radiusCentre);
@@ -1080,7 +1086,8 @@ std::string ShapeFactory::parseTorus(Poco::XML::Element *pElem,
  *instrument file
  */
 std::string ShapeFactory::parseSliceOfCylinderRing(
-    Poco::XML::Element *pElem, std::map<int, Surface *> &prim, int &l_id) {
+    Poco::XML::Element *pElem, std::map<int, boost::shared_ptr<Surface>> &prim,
+    int &l_id) {
   Element *pElemArc = getShapeElement(pElem, "arc");
   Element *pElemInnerRadius = getShapeElement(pElem, "inner-radius");
   Element *pElemOuterRadius = getShapeElement(pElem, "outer-radius");
@@ -1097,7 +1104,7 @@ std::string ShapeFactory::parseSliceOfCylinderRing(
   V3D centrePoint(-middleRadius, 0, 0);
 
   // add inner infinite cylinder
-  Cylinder *pCylinder1 = new Cylinder();
+  auto pCylinder1 = boost::make_shared<Cylinder>();
   pCylinder1->setCentre(centrePoint);
   pCylinder1->setNorm(normVec);
   pCylinder1->setRadius(innerRadius);
@@ -1107,7 +1114,7 @@ std::string ShapeFactory::parseSliceOfCylinderRing(
   l_id++;
 
   // add outer infinite cylinder
-  Cylinder *pCylinder2 = new Cylinder();
+  auto pCylinder2 = boost::make_shared<Cylinder>();
   pCylinder2->setCentre(centrePoint);
   pCylinder2->setNorm(normVec);
   pCylinder2->setRadius(outerRadius);
@@ -1116,7 +1123,7 @@ std::string ShapeFactory::parseSliceOfCylinderRing(
   l_id++;
 
   // add top cutoff plane of infinite cylinder ring
-  Plane *pPlaneTop = new Plane();
+  auto pPlaneTop = boost::make_shared<Plane>();
   pPlaneTop->setPlane(V3D(0, 0, depth), normVec);
   prim[l_id] = pPlaneTop;
   retAlgebraMatch << "-" << l_id << " ";
@@ -1124,7 +1131,7 @@ std::string ShapeFactory::parseSliceOfCylinderRing(
 
   // add bottom cutoff plane (which is assumed to fase the sample)
   // which at this point will result in a cylinder ring
-  Plane *pPlaneBottom = new Plane();
+  auto pPlaneBottom = boost::make_shared<Plane>();
   pPlaneBottom->setPlane(V3D(0, 0, 0), normVec);
   prim[l_id] = pPlaneBottom;
   retAlgebraMatch << "" << l_id << " ";
@@ -1132,7 +1139,7 @@ std::string ShapeFactory::parseSliceOfCylinderRing(
 
   // the two planes that are going to cut a slice of the cylinder ring
 
-  Plane *pPlaneSlice1 = new Plane();
+  auto pPlaneSlice1 = boost::make_shared<Plane>();
   pPlaneSlice1->setPlane(
       V3D(-middleRadius, 0, 0),
       V3D(cos(arc / 2.0 + M_PI / 2.0), sin(arc / 2.0 + M_PI / 2.0), 0));
@@ -1140,7 +1147,7 @@ std::string ShapeFactory::parseSliceOfCylinderRing(
   retAlgebraMatch << "-" << l_id << " ";
   l_id++;
 
-  Plane *pPlaneSlice2 = new Plane();
+  auto pPlaneSlice2 = boost::make_shared<Plane>();
   pPlaneSlice2->setPlane(
       V3D(-middleRadius, 0, 0),
       V3D(cos(-arc / 2.0 + M_PI / 2.0), sin(-arc / 2.0 + M_PI / 2.0), 0));
diff --git a/Framework/Geometry/src/Surfaces/Cone.cpp b/Framework/Geometry/src/Surfaces/Cone.cpp
index 2109cb0c6c01ee0eb722d99c9bb75e439a6fc112..69dd4cb8dadd15e5c217e1d49c4d52857fa95ceb 100644
--- a/Framework/Geometry/src/Surfaces/Cone.cpp
+++ b/Framework/Geometry/src/Surfaces/Cone.cpp
@@ -73,7 +73,7 @@ Cone::Cone(const Cone &A)
  */
 {}
 
-Cone *Cone::clone() const
+Cone *Cone::doClone() const
 /**
  Makes a clone (implicit virtual copy constructor)
  @return new(*this)
@@ -82,6 +82,10 @@ Cone *Cone::clone() const
   return new Cone(*this);
 }
 
+std::unique_ptr<Cone> Cone::clone() const {
+  return std::unique_ptr<Cone>(doClone());
+}
+
 Cone &Cone::operator=(const Cone &A)
 /**
  Assignment operator
@@ -99,12 +103,6 @@ Cone &Cone::operator=(const Cone &A)
   return *this;
 }
 
-Cone::~Cone()
-/**
- Destructor
- */
-{}
-
 int Cone::setSurface(const std::string &Pstr)
 /**
  Processes a standard MCNPX cone string
diff --git a/Framework/Geometry/src/Surfaces/Cylinder.cpp b/Framework/Geometry/src/Surfaces/Cylinder.cpp
index cec74b732efe23240d7126f9799fceaab6bb587d..52fa90235b92995a7801265578bde700d887414f 100644
--- a/Framework/Geometry/src/Surfaces/Cylinder.cpp
+++ b/Framework/Geometry/src/Surfaces/Cylinder.cpp
@@ -61,7 +61,7 @@ Cylinder::Cylinder(const Cylinder &A)
  */
 {}
 
-Cylinder *Cylinder::clone() const
+Cylinder *Cylinder::doClone() const
 /**
  Makes a clone (implicit virtual copy constructor)
  @return Copy(*this)
@@ -70,6 +70,15 @@ Cylinder *Cylinder::clone() const
   return new Cylinder(*this);
 }
 
+std::unique_ptr<Cylinder> Cylinder::clone() const
+/**
+Makes a clone (implicit virtual copy constructor)
+@return Copy(*this)
+*/
+{
+  return std::unique_ptr<Cylinder>(doClone());
+}
+
 Cylinder &Cylinder::operator=(const Cylinder &A)
 /**
  Standard Assignment operator
@@ -87,12 +96,6 @@ Cylinder &Cylinder::operator=(const Cylinder &A)
   return *this;
 }
 
-Cylinder::~Cylinder()
-/**
- Standard Destructor
- */
-{}
-
 int Cylinder::setSurface(const std::string &Pstr)
 /**
  Processes a standard MCNPX cone string
diff --git a/Framework/Geometry/src/Surfaces/General.cpp b/Framework/Geometry/src/Surfaces/General.cpp
index 44537df8e4b48fa2ef115f6d6da818542ad839d6..3973776a639335a1620a9db335f8d6be8d000d70 100644
--- a/Framework/Geometry/src/Surfaces/General.cpp
+++ b/Framework/Geometry/src/Surfaces/General.cpp
@@ -21,13 +21,22 @@ General::General(const General &A)
 */
 {}
 
-General *General::clone() const
+General *General::doClone() const
+/**
+Makes a clone (implicit virtual copy constructor)
+@return General(this)
+*/
+{
+  return new General(*this);
+}
+
+std::unique_ptr<General> General::clone() const
 /**
   Makes a clone (implicit virtual copy constructor)
   @return General(this)
 */
 {
-  return new General(*this);
+  return std::unique_ptr<General>(doClone());
 }
 
 General &General::operator=(const General &A)
@@ -43,12 +52,6 @@ General &General::operator=(const General &A)
   return *this;
 }
 
-General::~General()
-/**
-  Destructor
-*/
-{}
-
 int General::setSurface(const std::string &Pstr)
 /**
   Processes a standard MCNPX general string (GQ/SQ types)
diff --git a/Framework/Geometry/src/Surfaces/Plane.cpp b/Framework/Geometry/src/Surfaces/Plane.cpp
index 8d00ff8f721214895c902804da9f18cfae669709..f7488c1e1e41fb0ca5da419df37f1cf6dd564157 100644
--- a/Framework/Geometry/src/Surfaces/Plane.cpp
+++ b/Framework/Geometry/src/Surfaces/Plane.cpp
@@ -56,7 +56,7 @@ Plane::Plane(const Plane &A)
 */
 {}
 
-Plane *Plane::clone() const
+Plane *Plane::doClone() const
 /**
   Makes a clone (implicit virtual copy constructor)
   @return new(this)
@@ -65,6 +65,15 @@ Plane *Plane::clone() const
   return new Plane(*this);
 }
 
+std::unique_ptr<Plane> Plane::clone() const
+/**
+ Makes a clone (implicit virtual copy constructor)
+ @return new(this)
+ */
+{
+  return std::unique_ptr<Plane>(doClone());
+}
+
 Plane &Plane::operator=(const Plane &A)
 /**
   Assignment operator
@@ -80,12 +89,6 @@ Plane &Plane::operator=(const Plane &A)
   return *this;
 }
 
-Plane::~Plane()
-/**
-  Destructor
-*/
-{}
-
 int Plane::setSurface(const std::string &Pstr)
 /**
    processes a standard MCNPX plane string:
diff --git a/Framework/Geometry/src/Surfaces/Quadratic.cpp b/Framework/Geometry/src/Surfaces/Quadratic.cpp
index 8ab63b23aecf4d8e1ff5c7ff4fb628a8cbb1fa91..50a1499a02919a98c535cdb1c90ef189962426d9 100644
--- a/Framework/Geometry/src/Surfaces/Quadratic.cpp
+++ b/Framework/Geometry/src/Surfaces/Quadratic.cpp
@@ -60,12 +60,6 @@ Quadratic &Quadratic::operator=(const Quadratic &A)
   return *this;
 }
 
-Quadratic::~Quadratic()
-/**
-  Destructor
-*/
-{}
-
 double Quadratic::eqnValue(const Kernel::V3D &Pt) const
 /**
   Helper function to calcuate the value
@@ -390,6 +384,10 @@ void Quadratic::write(std::ostream &OX) const
   return;
 }
 
+std::unique_ptr<Quadratic> Quadratic::clone() const {
+  return std::unique_ptr<Quadratic>(doClone());
+}
+
 } // NAMESPACE Geometry
 
 } // NAMESPACE Mantid
diff --git a/Framework/Geometry/src/Surfaces/Sphere.cpp b/Framework/Geometry/src/Surfaces/Sphere.cpp
index ac66914e7c32fb31136f0c284310acf10ee222dc..13656799f7640a3b96c875e5832ef83dbb461136 100644
--- a/Framework/Geometry/src/Surfaces/Sphere.cpp
+++ b/Framework/Geometry/src/Surfaces/Sphere.cpp
@@ -55,7 +55,7 @@ Default Copy constructor
 */
 {}
 
-Sphere *Sphere::clone() const
+Sphere *Sphere::doClone() const
 /**
 Makes a clone (implicit virtual copy constructor)
 @return new (*this)
@@ -64,6 +64,15 @@ Makes a clone (implicit virtual copy constructor)
   return new Sphere(*this);
 }
 
+std::unique_ptr<Sphere> Sphere::clone() const
+/**
+Makes a clone (implicit virtual copy constructor)
+@return new (*this)
+*/
+{
+  return std::unique_ptr<Sphere>(doClone());
+}
+
 Sphere &Sphere::operator=(const Sphere &A)
 /**
 Default Assignment operator
@@ -79,12 +88,6 @@ Default Assignment operator
   return *this;
 }
 
-Sphere::~Sphere()
-/**
-Destructor
-*/
-{}
-
 int Sphere::setSurface(const std::string &Pstr)
 /**
 Processes a standard MCNPX cone string
diff --git a/Framework/Geometry/src/Surfaces/SurfaceFactory.cpp b/Framework/Geometry/src/Surfaces/SurfaceFactory.cpp
index 91d0c86ba1e6ddd4f4a6896dfdd4abc91095a8a3..7917ec7666f0f33e4187c52083c4ddcc77372fbd 100644
--- a/Framework/Geometry/src/Surfaces/SurfaceFactory.cpp
+++ b/Framework/Geometry/src/Surfaces/SurfaceFactory.cpp
@@ -11,7 +11,7 @@
 #include <algorithm>
 
 #include "MantidKernel/Exception.h"
-
+#include "MantidKernel/make_unique.h"
 #include "MantidKernel/Matrix.h"
 #include "MantidKernel/V3D.h"
 #include "MantidKernel/Strings.h"
@@ -61,30 +61,23 @@ SurfaceFactory::SurfaceFactory(const SurfaceFactory &A)
 {
   MapType::const_iterator vc;
   for (vc = A.SGrid.begin(); vc != A.SGrid.end(); ++vc)
-    SGrid.insert(MapType::value_type(vc->first, vc->second->clone()));
+    SGrid.push_back(MapType::value_type(vc->first, vc->second->clone()));
 }
 
-SurfaceFactory::~SurfaceFactory()
-/**
-  Destructor removes memory for atom/cluster list
-*/
-{
-  MapType::iterator vc;
-  for (vc = SGrid.begin(); vc != SGrid.end(); ++vc)
-    delete vc->second;
-}
+SurfaceFactory::~SurfaceFactory() {}
 
 void SurfaceFactory::registerSurface()
 /**
   Register tallies to be used
 */
 {
-  SGrid["Plane"] = new Plane;
-  SGrid["Cylinder"] = new Cylinder;
-  SGrid["Cone"] = new Cone;
+  using Mantid::Kernel::make_unique;
+  SGrid.push_back(std::make_pair("Plane", make_unique<Plane>()));
+  SGrid.push_back(std::make_pair("Cylinder", make_unique<Cylinder>()));
+  SGrid.push_back(std::make_pair("Cone", make_unique<Cone>()));
   // SGrid["Torus"]=new Torus;
-  SGrid["General"] = new General;
-  SGrid["Sphere"] = new Sphere;
+  SGrid.push_back(std::make_pair("General", make_unique<General>()));
+  SGrid.push_back(std::make_pair("Sphere", make_unique<Sphere>()));
 
   ID['c'] = "Cylinder";
   ID['k'] = "Cone";
@@ -95,7 +88,22 @@ void SurfaceFactory::registerSurface()
   return;
 }
 
-Surface *SurfaceFactory::createSurface(const std::string &Key) const
+namespace {
+class KeyEquals {
+public:
+  KeyEquals(std::string key) : m_key(std::move(key)) {}
+  bool
+  operator()(const std::pair<std::string, std::unique_ptr<Surface>> &element) {
+    return m_key == element.first;
+  }
+
+private:
+  std::string m_key;
+};
+}
+
+std::unique_ptr<Surface>
+SurfaceFactory::createSurface(const std::string &Key) const
 /**
   Creates an instance of tally
   given a valid key.
@@ -106,16 +114,16 @@ Surface *SurfaceFactory::createSurface(const std::string &Key) const
 */
 {
   MapType::const_iterator vc;
-  vc = SGrid.find(Key);
+  vc = std::find_if(SGrid.begin(), SGrid.end(), KeyEquals(Key));
   if (vc == SGrid.end()) {
     throw Kernel::Exception::NotFoundError("SurfaceFactory::createSurface",
                                            Key);
   }
-  Surface *X = vc->second->clone();
-  return X;
+  return vc->second->clone();
 }
 
-Surface *SurfaceFactory::createSurfaceID(const std::string &Key) const
+std::unique_ptr<Surface>
+SurfaceFactory::createSurfaceID(const std::string &Key) const
 /**
   Creates an instance of tally
   given a valid key.
@@ -136,7 +144,8 @@ Surface *SurfaceFactory::createSurfaceID(const std::string &Key) const
   return createSurface(mc->second);
 }
 
-Surface *SurfaceFactory::processLine(const std::string &Line) const
+std::unique_ptr<Surface>
+SurfaceFactory::processLine(const std::string &Line) const
 /**
   Creates an instance of a surface
   given a valid line
@@ -150,7 +159,7 @@ Surface *SurfaceFactory::processLine(const std::string &Line) const
   if (!Mantid::Kernel::Strings::convert(Line, key))
     throw Kernel::Exception::NotFoundError("SurfaceFactory::processLine", Line);
 
-  Surface *X = createSurfaceID(key);
+  std::unique_ptr<Surface> X = createSurfaceID(key);
   if (X->setSurface(Line)) {
     std::cerr << "X:: " << X->setSurface(Line) << std::endl;
     throw Kernel::Exception::NotFoundError("SurfaceFactory::processLine", Line);
diff --git a/Framework/Geometry/src/Surfaces/Torus.cpp b/Framework/Geometry/src/Surfaces/Torus.cpp
index d1e57c3d3dfcc00039f18ed091dc4769f63d2a15..8b20fdf0a3412fa0d82915f795fd5ed053cdc0e1 100644
--- a/Framework/Geometry/src/Surfaces/Torus.cpp
+++ b/Framework/Geometry/src/Surfaces/Torus.cpp
@@ -67,7 +67,7 @@ Torus::Torus(const Torus &A)
 */
 {}
 
-Torus *Torus::clone() const
+Torus *Torus::doClone() const
 /**
   Makes a clone (implicit virtual copy constructor)
   @return new(*this)
@@ -76,6 +76,15 @@ Torus *Torus::clone() const
   return new Torus(*this);
 }
 
+std::unique_ptr<Torus> Torus::clone() const
+/**
+ Makes a clone (implicit virtual copy constructor)
+ @return new(*this)
+ */
+{
+  return std::unique_ptr<Torus>(doClone());
+}
+
 Torus &Torus::operator=(const Torus &A)
 /**
   Assignment operator
@@ -94,12 +103,6 @@ Torus &Torus::operator=(const Torus &A)
   return *this;
 }
 
-Torus::~Torus()
-/**
-  Destructor
-*/
-{}
-
 int Torus::operator==(const Torus &A) const
 /**
   Equality operator. Checks angle,centre and
diff --git a/Framework/Geometry/test/ConeTest.h b/Framework/Geometry/test/ConeTest.h
index 506b277b96cdde447e6ffc46c484f4cf838e52af..0993a331a5cc9d9ba8719fde9b6592216ed24ea3 100644
--- a/Framework/Geometry/test/ConeTest.h
+++ b/Framework/Geometry/test/ConeTest.h
@@ -32,34 +32,15 @@ public:
     TS_ASSERT_EQUALS(extractString(A), "-1  k/x 1 1 1 1\n");
   }
 
-  void testCopyConstructor() {
-    Cone A;
-    TS_ASSERT_EQUALS(A.setSurface("k/x 1.0 1.0 1.0 1.0\n"), 0);
-    Cone B(A);
-    TS_ASSERT_EQUALS(B.getNormal(), V3D(1.0, 0.0, 0.0));
-    TS_ASSERT_EQUALS(B.getCentre(), V3D(1.0, 1.0, 1.0));
-    TS_ASSERT_EQUALS(extractString(B), "-1  k/x 1 1 1 1\n");
-  }
-
   void testClone() {
     Cone A;
     TS_ASSERT_EQUALS(A.setSurface("k/x 1.0 1.0 1.0 1.0\n"), 0);
-    Cone *B;
-    B = A.clone();
-    TS_ASSERT_EQUALS(B->getNormal(), V3D(1.0, 0.0, 0.0));
-    TS_ASSERT_EQUALS(B->getCentre(), V3D(1.0, 1.0, 1.0));
+    auto B = A.clone();
     TS_ASSERT_EQUALS(extractString(*B), "-1  k/x 1 1 1 1\n");
-    delete B;
-  }
-
-  void testAssignment() {
-    Cone A, B;
-    TS_ASSERT_EQUALS(A.setSurface("k/x 1.0 1.0 1.0 1.0\n"), 0);
-    TS_ASSERT_DIFFERS(extractString(B), extractString(A));
-    B = A;
-    TS_ASSERT_EQUALS(B.getNormal(), V3D(1.0, 0.0, 0.0));
-    TS_ASSERT_EQUALS(B.getCentre(), V3D(1.0, 1.0, 1.0));
-    TS_ASSERT_EQUALS(extractString(B), "-1  k/x 1 1 1 1\n");
+    Cone *C = dynamic_cast<Cone *>(B.get());
+    TS_ASSERT_EQUALS(C->getNormal(), V3D(1.0, 0.0, 0.0));
+    TS_ASSERT_EQUALS(C->getCentre(), V3D(1.0, 1.0, 1.0));
+    TS_ASSERT_EQUALS(extractString(*C), "-1  k/x 1 1 1 1\n");
   }
 
   void testSide() {
diff --git a/Framework/Geometry/test/CrystalStructureTest.h b/Framework/Geometry/test/CrystalStructureTest.h
index 80fa1f63d0a5dfc9a391edbeb314c014b3fdda83..0675a65b79941716912b3905c9df6dc18bcb5665 100644
--- a/Framework/Geometry/test/CrystalStructureTest.h
+++ b/Framework/Geometry/test/CrystalStructureTest.h
@@ -28,7 +28,8 @@ public:
     m_scatterers = CompositeBraggScatterer::create();
     m_scatterers->addScatterer(
         BraggScattererFactory::Instance().createScatterer(
-            "IsotropicAtomBraggScatterer", "Element=Si;Position=[0,0,0]"));
+            "IsotropicAtomBraggScatterer",
+            "{\"Element\":\"Si\",\"Position\":\"0,0,0\"}"));
   }
 
   void testConstructionSpaceGroup() {
diff --git a/Framework/Geometry/test/CylinderTest.h b/Framework/Geometry/test/CylinderTest.h
index af4f4f9b26014cc2aab7698bf57fe790352698e5..b26daec2ba1ea86e7e7b58edcbcdf46b3793d010 100644
--- a/Framework/Geometry/test/CylinderTest.h
+++ b/Framework/Geometry/test/CylinderTest.h
@@ -35,29 +35,12 @@ public:
     TS_ASSERT_EQUALS(extractString(A), "-1  c/x 0.5 0.5 1\n");
   }
 
-  void testCopyConstructor() {
-    Cylinder A;
-    A.setSurface("c/x 0.5 0.5 1.0");
-    TS_ASSERT_EQUALS(extractString(A), "-1  c/x 0.5 0.5 1\n");
-    Cylinder B(A);
-    TS_ASSERT_EQUALS(extractString(B), extractString(A));
-  }
-
   void testClone() {
     Cylinder A;
     A.setSurface("c/x 0.5 0.5 1.0");
     TS_ASSERT_EQUALS(extractString(A), "-1  c/x 0.5 0.5 1\n");
-    Cylinder *B = A.clone();
+    auto B = A.clone();
     TS_ASSERT_EQUALS(extractString(*B), extractString(A));
-    delete B;
-  }
-
-  void testAssignment() {
-    Cylinder A, B;
-    A.setSurface("c/x 0.5 0.5 1.0");
-    TS_ASSERT_DIFFERS(extractString(B), extractString(A));
-    B = A;
-    TS_ASSERT_EQUALS(extractString(B), extractString(A));
   }
 
   /// is a point inside outside or on the side!
diff --git a/Framework/Geometry/test/GeneralTest.h b/Framework/Geometry/test/GeneralTest.h
index 3c01e80428aa8e846222b3f2e1c33a6fe09dba56..5b16ddca3529d8d82a6cc83b47053542e0e44221 100644
--- a/Framework/Geometry/test/GeneralTest.h
+++ b/Framework/Geometry/test/GeneralTest.h
@@ -34,9 +34,6 @@ public:
     A.setSurface("gq 1 1 1 0 0 0 0 0 0 -1");
     TS_ASSERT_EQUALS(extractString(A),
                      "-1 gq  1  1  1  0  0  0  0  0  0  -1 \n");
-    General B(A);
-    TS_ASSERT_EQUALS(extractString(B),
-                     "-1 gq  1  1  1  0  0  0  0  0  0  -1 \n");
   }
 
   void testClone() {
@@ -46,11 +43,9 @@ public:
     A.setSurface("gq 1 1 1 0 0 0 0 0 0 -1");
     TS_ASSERT_EQUALS(extractString(A),
                      "-1 gq  1  1  1  0  0  0  0  0  0  -1 \n");
-    General *B;
-    B = A.clone();
+    auto B = A.clone();
     TS_ASSERT_EQUALS(extractString(*B),
                      "-1 gq  1  1  1  0  0  0  0  0  0  -1 \n");
-    delete B;
   }
 
   void testEqualOperator() {
@@ -60,12 +55,6 @@ public:
     A.setSurface("gq 1 1 1 0 0 0 0 0 0 -1");
     TS_ASSERT_EQUALS(extractString(A),
                      "-1 gq  1  1  1  0  0  0  0  0  0  -1 \n");
-    General B;
-    TS_ASSERT_EQUALS(extractString(B),
-                     "-1 gq  0  0  0  0  0  0  0  0  0  0 \n");
-    B = A;
-    TS_ASSERT_EQUALS(extractString(B),
-                     "-1 gq  1  1  1  0  0  0  0  0  0  -1 \n");
   }
 
 private:
diff --git a/Framework/Geometry/test/ObjComponentTest.h b/Framework/Geometry/test/ObjComponentTest.h
index 116e7db8debcc1adc40748129f215fa8ed879c01..69bba743fc6f6df839b7dc522d9600d65585138f 100644
--- a/Framework/Geometry/test/ObjComponentTest.h
+++ b/Framework/Geometry/test/ObjComponentTest.h
@@ -12,6 +12,8 @@
 
 #include "MantidKernel/Timer.h"
 
+#include "boost/make_shared.hpp"
+
 using namespace Mantid::Kernel;
 using namespace Mantid::Geometry;
 
@@ -450,10 +452,10 @@ private:
     std::string C33 = "px -3.2";
 
     // First create some surfaces
-    std::map<int, Surface *> CylSurMap;
-    CylSurMap[31] = new Cylinder();
-    CylSurMap[32] = new Plane();
-    CylSurMap[33] = new Plane();
+    std::map<int, boost::shared_ptr<Surface>> CylSurMap;
+    CylSurMap[31] = boost::make_shared<Cylinder>();
+    CylSurMap[32] = boost::make_shared<Plane>();
+    CylSurMap[33] = boost::make_shared<Plane>();
 
     CylSurMap[31]->setSurface(C31);
     CylSurMap[32]->setSurface(C32);
@@ -479,10 +481,10 @@ private:
     std::string C33 = "px -3.0";
 
     // First create some surfaces
-    std::map<int, Surface *> CylSurMap;
-    CylSurMap[31] = new Cylinder();
-    CylSurMap[32] = new Plane();
-    CylSurMap[33] = new Plane();
+    std::map<int, boost::shared_ptr<Surface>> CylSurMap;
+    CylSurMap[31] = boost::make_shared<Cylinder>();
+    CylSurMap[32] = boost::make_shared<Plane>();
+    CylSurMap[33] = boost::make_shared<Plane>();
 
     CylSurMap[31]->setSurface(C31);
     CylSurMap[32]->setSurface(C32);
@@ -511,13 +513,13 @@ private:
     std::string C6 = planes[5];
 
     // Create surfaces
-    std::map<int, Surface *> CubeSurMap;
-    CubeSurMap[1] = new Plane();
-    CubeSurMap[2] = new Plane();
-    CubeSurMap[3] = new Plane();
-    CubeSurMap[4] = new Plane();
-    CubeSurMap[5] = new Plane();
-    CubeSurMap[6] = new Plane();
+    std::map<int, boost::shared_ptr<Surface>> CubeSurMap;
+    CubeSurMap[1] = boost::make_shared<Plane>();
+    CubeSurMap[2] = boost::make_shared<Plane>();
+    CubeSurMap[3] = boost::make_shared<Plane>();
+    CubeSurMap[4] = boost::make_shared<Plane>();
+    CubeSurMap[5] = boost::make_shared<Plane>();
+    CubeSurMap[6] = boost::make_shared<Plane>();
 
     CubeSurMap[1]->setSurface(C1);
     CubeSurMap[2]->setSurface(C2);
diff --git a/Framework/Geometry/test/ObjectTest.h b/Framework/Geometry/test/ObjectTest.h
index 2c80fd8a7580ad11658eff9a983c7ff8eb744602..dbbe51e152a2028da22940d91154f2834a337688 100644
--- a/Framework/Geometry/test/ObjectTest.h
+++ b/Framework/Geometry/test/ObjectTest.h
@@ -8,7 +8,8 @@
 #include <algorithm>
 #include <ctime>
 
-#include <boost/shared_ptr.hpp>
+#include "boost/shared_ptr.hpp"
+#include "boost/make_shared.hpp"
 
 #include "MantidGeometry/Objects/Object.h"
 #include "MantidGeometry/Surfaces/Cylinder.h"
@@ -291,8 +292,8 @@ public:
     std::string S41 = "s 1 1 1 4"; // Sphere at (1,1,1) radius 4
 
     // First create some surfaces
-    std::map<int, Surface *> SphSurMap;
-    SphSurMap[41] = new Sphere();
+    std::map<int, boost::shared_ptr<Surface>> SphSurMap;
+    SphSurMap[41] = boost::make_shared<Sphere>();
     SphSurMap[41]->setSurface(S41);
     SphSurMap[41]->setName(41);
 
@@ -887,7 +888,7 @@ public:
 
 private:
   /// Surface type
-  typedef std::map<int, Surface *> STYPE;
+  typedef std::map<int, boost::shared_ptr<Surface>> STYPE;
 
   /// set timeTest true to get time comparisons of soild angle methods
   const static bool timeTest = false;
@@ -900,10 +901,10 @@ private:
     std::string C33 = "px -3.2";
 
     // First create some surfaces
-    std::map<int, Surface *> CylSurMap;
-    CylSurMap[31] = new Cylinder();
-    CylSurMap[32] = new Plane();
-    CylSurMap[33] = new Plane();
+    std::map<int, boost::shared_ptr<Surface>> CylSurMap;
+    CylSurMap[31] = boost::make_shared<Cylinder>();
+    CylSurMap[32] = boost::make_shared<Plane>();
+    CylSurMap[33] = boost::make_shared<Plane>();
 
     CylSurMap[31]->setSurface(C31);
     CylSurMap[32]->setSurface(C32);
@@ -935,10 +936,10 @@ private:
     std::string C33 = "px -1.0";
 
     // First create some surfaces
-    std::map<int, Surface *> CylSurMap;
-    CylSurMap[31] = new Cylinder();
-    CylSurMap[32] = new Plane();
-    CylSurMap[33] = new Plane();
+    std::map<int, boost::shared_ptr<Surface>> CylSurMap;
+    CylSurMap[31] = boost::make_shared<Cylinder>();
+    CylSurMap[32] = boost::make_shared<Plane>();
+    CylSurMap[33] = boost::make_shared<Plane>();
 
     CylSurMap[31]->setSurface(C31);
     CylSurMap[32]->setSurface(C32);
@@ -962,8 +963,8 @@ private:
     std::string S41 = "so 4.1"; // Sphere at origin radius 4.1
 
     // First create some surfaces
-    std::map<int, Surface *> SphSurMap;
-    SphSurMap[41] = new Sphere();
+    std::map<int, boost::shared_ptr<Surface>> SphSurMap;
+    SphSurMap[41] = boost::make_shared<Sphere>();
     SphSurMap[41]->setSurface(S41);
     SphSurMap[41]->setName(41);
 
@@ -1027,15 +1028,15 @@ private:
     std::vector<SCompT>::const_iterator vc;
 
     // Note that the testObject now manages the "new Plane"
-    Geometry::Surface *A;
     for (vc = SurfLine.begin(); vc != SurfLine.end(); vc++) {
-      A = Geometry::SurfaceFactory::Instance()->processLine(vc->second);
+      auto A = Geometry::SurfaceFactory::Instance()->processLine(vc->second);
       if (!A) {
         std::cerr << "Failed to process line " << vc->second << std::endl;
         exit(1);
       }
       A->setName(vc->first);
-      SMap.insert(STYPE::value_type(vc->first, A));
+      SMap.insert(STYPE::value_type(vc->first,
+                                    boost::shared_ptr<Surface>(A.release())));
     }
 
     return;
@@ -1050,13 +1051,13 @@ private:
     std::string C6 = "pz 0.5";
 
     // Create surfaces
-    std::map<int, Surface *> CubeSurMap;
-    CubeSurMap[1] = new Plane();
-    CubeSurMap[2] = new Plane();
-    CubeSurMap[3] = new Plane();
-    CubeSurMap[4] = new Plane();
-    CubeSurMap[5] = new Plane();
-    CubeSurMap[6] = new Plane();
+    std::map<int, boost::shared_ptr<Surface>> CubeSurMap;
+    CubeSurMap[1] = boost::make_shared<Plane>();
+    CubeSurMap[2] = boost::make_shared<Plane>();
+    CubeSurMap[3] = boost::make_shared<Plane>();
+    CubeSurMap[4] = boost::make_shared<Plane>();
+    CubeSurMap[5] = boost::make_shared<Plane>();
+    CubeSurMap[6] = boost::make_shared<Plane>();
 
     CubeSurMap[1]->setSurface(C1);
     CubeSurMap[2]->setSurface(C2);
@@ -1091,13 +1092,13 @@ private:
     std::string C6 = planes[5];
 
     // Create surfaces
-    std::map<int, Surface *> CubeSurMap;
-    CubeSurMap[1] = new Plane();
-    CubeSurMap[2] = new Plane();
-    CubeSurMap[3] = new Plane();
-    CubeSurMap[4] = new Plane();
-    CubeSurMap[5] = new Plane();
-    CubeSurMap[6] = new Plane();
+    std::map<int, boost::shared_ptr<Surface>> CubeSurMap;
+    CubeSurMap[1] = boost::make_shared<Plane>();
+    CubeSurMap[2] = boost::make_shared<Plane>();
+    CubeSurMap[3] = boost::make_shared<Plane>();
+    CubeSurMap[4] = boost::make_shared<Plane>();
+    CubeSurMap[5] = boost::make_shared<Plane>();
+    CubeSurMap[6] = boost::make_shared<Plane>();
 
     CubeSurMap[1]->setSurface(C1);
     CubeSurMap[2]->setSurface(C2);
diff --git a/Framework/Geometry/test/ParObjComponentTest.h b/Framework/Geometry/test/ParObjComponentTest.h
index 015e00773097f4e4e862e724a46c3c5e8ad0c519..dc95d6921130ddca23f27b3187d48f2af3b1da82 100644
--- a/Framework/Geometry/test/ParObjComponentTest.h
+++ b/Framework/Geometry/test/ParObjComponentTest.h
@@ -11,6 +11,8 @@
 #include "MantidGeometry/Objects/Object.h"
 #include "MantidKernel/Exception.h"
 
+#include "boost/make_shared.hpp"
+
 using namespace Mantid::Kernel;
 using namespace Mantid::Geometry;
 
@@ -304,10 +306,10 @@ private:
     std::string C33 = "px -3.2";
 
     // First create some surfaces
-    std::map<int, Surface *> CylSurMap;
-    CylSurMap[31] = new Cylinder();
-    CylSurMap[32] = new Plane();
-    CylSurMap[33] = new Plane();
+    std::map<int, boost::shared_ptr<Surface>> CylSurMap;
+    CylSurMap[31] = boost::make_shared<Cylinder>();
+    CylSurMap[32] = boost::make_shared<Plane>();
+    CylSurMap[33] = boost::make_shared<Plane>();
 
     CylSurMap[31]->setSurface(C31);
     CylSurMap[32]->setSurface(C32);
@@ -320,7 +322,7 @@ private:
     // using surface ids: 31 (cylinder) 32 (plane (top) ) and 33 (plane (base))
     std::string ObjCapCylinder = "-31 -32 33";
 
-    boost::shared_ptr<Object> retVal = boost::shared_ptr<Object>(new Object);
+    auto retVal = boost::make_shared<Object>();
     retVal->setObject(21, ObjCapCylinder);
     retVal->populate(CylSurMap);
 
@@ -336,13 +338,13 @@ private:
     std::string C6 = planes[5];
 
     // Create surfaces
-    std::map<int, Surface *> CubeSurMap;
-    CubeSurMap[1] = new Plane();
-    CubeSurMap[2] = new Plane();
-    CubeSurMap[3] = new Plane();
-    CubeSurMap[4] = new Plane();
-    CubeSurMap[5] = new Plane();
-    CubeSurMap[6] = new Plane();
+    std::map<int, boost::shared_ptr<Surface>> CubeSurMap;
+    CubeSurMap[1] = boost::make_shared<Plane>();
+    CubeSurMap[2] = boost::make_shared<Plane>();
+    CubeSurMap[3] = boost::make_shared<Plane>();
+    CubeSurMap[4] = boost::make_shared<Plane>();
+    CubeSurMap[5] = boost::make_shared<Plane>();
+    CubeSurMap[6] = boost::make_shared<Plane>();
 
     CubeSurMap[1]->setSurface(C1);
     CubeSurMap[2]->setSurface(C2);
diff --git a/Framework/Geometry/test/PlaneTest.h b/Framework/Geometry/test/PlaneTest.h
index c68498c5820e763ccf0a78d89fb5450f685482e7..c85e563d9dbfb35397f160b6efeac0c083d07837 100644
--- a/Framework/Geometry/test/PlaneTest.h
+++ b/Framework/Geometry/test/PlaneTest.h
@@ -29,33 +29,15 @@ public:
     // TS_ASSERT_EQUALS(extractString(A),"-1 p 0.6666666667 0.6666666667
     // 0.3333333333 5\n");
   }
-  void testCopyConstructor() {
-    Plane A;
-    A.setPlane(V3D(3.0, 3.0, 3.0), V3D(2.0 / 9.0, 2.0 / 9.0, 1.0 / 9.0));
-    Plane B(A);
-    TS_ASSERT_EQUALS(A.getNormal(), V3D(2.0 / 3.0, 2.0 / 3.0, 1.0 / 3.0));
-    TS_ASSERT_EQUALS(A.getDistance(), 5.0);
-    // TS_ASSERT_EQUALS(extractString(A),"-1 p 0.6666666667 0.6666666667
-    // 0.3333333333 5\n");
-  }
 
   void testClone() {
     Plane A;
     A.setPlane(V3D(3.0, 3.0, 3.0), V3D(2.0 / 9.0, 2.0 / 9.0, 1.0 / 9.0));
-    Plane *B = A.clone();
+    auto B = A.clone();
     TS_ASSERT_EQUALS(A.getNormal(), V3D(2.0 / 3.0, 2.0 / 3.0, 1.0 / 3.0));
     TS_ASSERT_EQUALS(A.getDistance(), 5.0);
     // TS_ASSERT_EQUALS(extractString(*B),"-1 p 0.6666666667 0.6666666667
     // 0.3333333333 5\n");
-    delete B;
-  }
-
-  void testAssignment() {
-    Plane A, B;
-    A.setPlane(V3D(3.0, 3.0, 3.0), V3D(2.0 / 9.0, 2.0 / 9.0, 1.0 / 9.0));
-    TS_ASSERT_DIFFERS(extractString(B), extractString(A));
-    B = A;
-    TS_ASSERT_EQUALS(extractString(B), extractString(A));
   }
 
   void testSide() {
diff --git a/Framework/Geometry/test/RulesCompGrpTest.h b/Framework/Geometry/test/RulesCompGrpTest.h
index 3c4d0d6e7d93094d8e80cd0931802edcf68e57d1..3fce2166df88b8a77a88f571659c7b58544e4109 100644
--- a/Framework/Geometry/test/RulesCompGrpTest.h
+++ b/Framework/Geometry/test/RulesCompGrpTest.h
@@ -6,6 +6,9 @@
 #include "MantidKernel/Logger.h"
 #include "MantidKernel/System.h"
 #include <cfloat>
+
+#include "boost/make_shared.hpp"
+
 #include "MantidKernel/V3D.h"
 #include "MantidGeometry/Surfaces/Quadratic.h"
 #include "MantidGeometry/Objects/Object.h"
@@ -140,11 +143,11 @@ private:
     SurfPoint *sR1, *sR2;
     sR1 = new SurfPoint();
     sR2 = new SurfPoint();
-    Sphere *sP = new Sphere();
+    auto sP = boost::make_shared<Sphere>();
     sP->setSurface("s 2.0 0.0 0.0 2");
     sR1->setKey(sP); // Sphere
     sR1->setKeyN(-10);
-    Cylinder *cP = new Cylinder();
+    auto cP = boost::make_shared<Cylinder>();
     cP->setSurface("cy 1.0");
     sR2->setKey(cP); // cappedcylinder
     sR2->setKeyN(-11);
diff --git a/Framework/Geometry/test/RulesCompObjTest.h b/Framework/Geometry/test/RulesCompObjTest.h
index bcf72a48d2e76b05ba53f60ec8343a4c7624ca14..a02a6aac66245bffd810c5973cb072071cd5064d 100644
--- a/Framework/Geometry/test/RulesCompObjTest.h
+++ b/Framework/Geometry/test/RulesCompObjTest.h
@@ -15,6 +15,8 @@
 #include "MantidGeometry/Surfaces/Cylinder.h"
 #include "MantidGeometry/Surfaces/Cone.h"
 
+#include "boost/make_shared.hpp"
+
 using namespace Mantid;
 using namespace Geometry;
 using Mantid::Kernel::V3D;
@@ -190,10 +192,10 @@ private:
     std::string C33 = "px -3.2";
 
     // First create some surfaces
-    std::map<int, Surface *> CylSurMap;
-    CylSurMap[31] = new Cylinder();
-    CylSurMap[32] = new Plane();
-    CylSurMap[33] = new Plane();
+    std::map<int, boost::shared_ptr<Surface>> CylSurMap;
+    CylSurMap[31] = boost::make_shared<Cylinder>();
+    CylSurMap[32] = boost::make_shared<Plane>();
+    CylSurMap[33] = boost::make_shared<Plane>();
 
     CylSurMap[31]->setSurface(C31);
     CylSurMap[32]->setSurface(C32);
diff --git a/Framework/Geometry/test/RulesIntersectionTest.h b/Framework/Geometry/test/RulesIntersectionTest.h
index 492a502f5543099058feed07450fb665e7b811df..527a0eb3c42985210a364e885464ff9d4bd7cb48 100644
--- a/Framework/Geometry/test/RulesIntersectionTest.h
+++ b/Framework/Geometry/test/RulesIntersectionTest.h
@@ -15,6 +15,8 @@
 #include "MantidGeometry/Surfaces/Cylinder.h"
 #include "MantidGeometry/Surfaces/Cone.h"
 
+#include "boost/make_shared.hpp"
+
 using namespace Mantid;
 using namespace Geometry;
 using Mantid::Kernel::V3D;
@@ -42,8 +44,8 @@ public:
 
   void testTwoRuleConstructor() { // Creating a half sphere
     SurfPoint *S1, *S2;
-    Plane *P1 = new Plane;
-    Sphere *Sp1 = new Sphere;
+    auto P1 = boost::make_shared<Plane>();
+    auto Sp1 = boost::make_shared<Sphere>();
     P1->setSurface("px 5");             // yz plane with x=5
     Sp1->setSurface("s 5.0 0.0 0.0 5"); // a sphere with center (5,0,0) and
                                         // radius 5. this will touch origin
@@ -61,8 +63,9 @@ public:
 
   void testThreeRuleConstructor() {
     SurfPoint *S1, *S2;
-    Plane *P1 = new Plane;
-    Sphere *Sp1 = new Sphere;
+    auto P1 = boost::make_shared<Plane>();
+    auto Sp1 = boost::make_shared<Sphere>();
+
     P1->setSurface("px 5");             // yz plane with x=5
     Sp1->setSurface("s 5.0 0.0 0.0 5"); // a sphere with center (5,0,0) and
                                         // radius 5. this will touch origin
@@ -82,8 +85,8 @@ public:
 
   void testClone() {
     SurfPoint *S1, *S2;
-    Plane *P1 = new Plane;
-    Sphere *Sp1 = new Sphere;
+    auto P1 = boost::make_shared<Plane>();
+    auto Sp1 = boost::make_shared<Sphere>();
     P1->setSurface("px 5");             // yz plane with x=5
     Sp1->setSurface("s 5.0 0.0 0.0 5"); // a sphere with center (5,0,0) and
                                         // radius 5. this will touch origin
@@ -108,8 +111,8 @@ public:
 
   void testIntersectionConstructor() {
     SurfPoint *S1, *S2;
-    Plane *P1 = new Plane;
-    Sphere *Sp1 = new Sphere;
+    auto P1 = boost::make_shared<Plane>();
+    auto Sp1 = boost::make_shared<Sphere>();
     P1->setSurface("px 5");             // yz plane with x=5
     Sp1->setSurface("s 5.0 0.0 0.0 5"); // a sphere with center (5,0,0) and
                                         // radius 5. this will touch origin
@@ -132,8 +135,8 @@ public:
 
   void testAssignment() {
     SurfPoint *S1, *S2;
-    Plane *P1 = new Plane;
-    Sphere *Sp1 = new Sphere;
+    auto P1 = boost::make_shared<Plane>();
+    auto Sp1 = boost::make_shared<Sphere>();
     P1->setSurface("px 5");             // yz plane with x=5
     Sp1->setSurface("s 5.0 0.0 0.0 5"); // a sphere with center (5,0,0) and
                                         // radius 5. this will touch origin
@@ -157,8 +160,8 @@ public:
 
   void testFindLeaf() {
     SurfPoint *S1, *S2, S3;
-    Plane *P1 = new Plane;
-    Sphere *Sp1 = new Sphere;
+    auto P1 = boost::make_shared<Plane>();
+    auto Sp1 = boost::make_shared<Sphere>();
     P1->setSurface("px 5");             // yz plane with x=5
     Sp1->setSurface("s 5.0 0.0 0.0 5"); // a sphere with center (5,0,0) and
                                         // radius 5. this will touch origin
@@ -180,8 +183,8 @@ public:
 
   void testFindKey() {
     SurfPoint *S1, *S2, S3;
-    Plane *P1 = new Plane;
-    Sphere *Sp1 = new Sphere;
+    auto P1 = boost::make_shared<Plane>();
+    auto Sp1 = boost::make_shared<Sphere>();
     P1->setSurface("px 5");             // yz plane with x=5
     Sp1->setSurface("s 5.0 0.0 0.0 5"); // a sphere with center (5,0,0) and
                                         // radius 5. this will touch origin
@@ -203,8 +206,8 @@ public:
 
   void testIsComplementary() {
     SurfPoint *S1, *S2;
-    Plane *P1 = new Plane;
-    Sphere *Sp1 = new Sphere;
+    auto P1 = boost::make_shared<Plane>();
+    auto Sp1 = boost::make_shared<Sphere>();
     P1->setSurface("px 5");             // yz plane with x=5
     Sp1->setSurface("s 5.0 0.0 0.0 5"); // a sphere with center (5,0,0) and
                                         // radius 5. this will touch origin
@@ -230,8 +233,8 @@ public:
 
   void testIsValid() {
     SurfPoint *S1, *S2, S3;
-    Plane *P1 = new Plane;
-    Sphere *Sp1 = new Sphere;
+    auto P1 = boost::make_shared<Plane>();
+    auto Sp1 = boost::make_shared<Sphere>();
     P1->setSurface("px 5");             // yz plane with x=5
     Sp1->setSurface("s 5.0 0.0 0.0 5"); // a sphere with center (5,0,0) and
                                         // radius 5. this will touch origin
@@ -257,16 +260,16 @@ public:
 
   void testBoundingBox() {
     SurfPoint *S1, *S2, S3;
-    Plane *P1 = new Plane;
-    Sphere *Sp1 = new Sphere;
+    auto P1 = boost::make_shared<Plane>();
+    auto Sp1 = boost::make_shared<Sphere>();
     P1->setSurface("px 5");             // yz plane with x=5
     Sp1->setSurface("s 5.0 0.0 0.0 5"); // a sphere with center (5,0,0) and
                                         // radius 5. this will touch origin
     S1 = new SurfPoint();
     S2 = new SurfPoint();
-    S1->setKey(P1);
+    S1->setKey(std::move(P1));
     S1->setKeyN(10);
-    S2->setKey(Sp1);
+    S2->setKey(std::move(Sp1));
     S2->setKeyN(-11);
     Intersection A;
     A.setLeaves(S1, S2);
diff --git a/Framework/Geometry/test/RulesSurfPointTest.h b/Framework/Geometry/test/RulesSurfPointTest.h
index 4a6c678853b666df23bfc23c9238083ca5f20b96..044053c6f7acdfa6ea06cac368582eb4497c84cb 100644
--- a/Framework/Geometry/test/RulesSurfPointTest.h
+++ b/Framework/Geometry/test/RulesSurfPointTest.h
@@ -15,6 +15,8 @@
 #include "MantidGeometry/Surfaces/Cylinder.h"
 #include "MantidGeometry/Surfaces/Cone.h"
 
+#include "boost/make_shared.hpp"
+
 using namespace Mantid;
 using namespace Geometry;
 using Mantid::Kernel::V3D;
@@ -29,9 +31,9 @@ public:
   void testSetKey() {
     SurfPoint A;
     TS_ASSERT_EQUALS(A.display(), "0");
-    Plane *P1 = new Plane;
+    auto P1 = boost::make_shared<Plane>();
     A.setKey(P1);
-    TS_ASSERT_EQUALS(A.getKey(), P1);
+    TS_ASSERT_EQUALS(A.getKey(), P1.get());
   }
 
   void testSetKeyN() {
@@ -44,10 +46,10 @@ public:
 
   void testFullCreatedObject() {
     SurfPoint A;
-    Plane *P1 = new Plane;
+    auto P1 = boost::make_shared<Plane>();
     A.setKey(P1);
     A.setKeyN(10);
-    TS_ASSERT_EQUALS(A.getKey(), P1);
+    TS_ASSERT_EQUALS(A.getKey(), P1.get());
     TS_ASSERT_EQUALS(A.getKeyN(), 10);
     TS_ASSERT_EQUALS(A.display(), "10");
   }
@@ -56,7 +58,7 @@ public:
                         // so it should always return 0
     SurfPoint A;
     TS_ASSERT_EQUALS(A.simplify(), 0);
-    Plane *P1 = new Plane;
+    auto P1 = boost::make_shared<Plane>();
     A.setKey(P1);
     A.setKeyN(10);
     TS_ASSERT_EQUALS(A.simplify(), 0);
@@ -66,7 +68,7 @@ public:
     SurfPoint A;
     TS_ASSERT_EQUALS(A.simplify(), 0);
     TS_ASSERT_EQUALS(A.leaf(0), (Rule *)0);
-    Plane *P1 = new Plane;
+    auto P1 = boost::make_shared<Plane>();
     A.setKey(P1);
     A.setKeyN(10);
     TS_ASSERT_EQUALS(A.simplify(), 0);
@@ -77,17 +79,17 @@ public:
   testSetLeaves() { // This should not enabled as surfpoint cannot have leaves
     // TODO:disable setleaves function
     SurfPoint A;
-    Plane *P1 = new Plane;
+    auto P1 = boost::make_shared<Plane>();
     A.setKey(P1);
     A.setKeyN(10);
-    TS_ASSERT_EQUALS(A.getKey(), P1);
+    TS_ASSERT_EQUALS(A.getKey(), P1.get());
     TS_ASSERT_EQUALS(A.getKeyN(), 10);
     TS_ASSERT_EQUALS(A.display(), "10");
     SurfPoint B;
-    Sphere *S1 = new Sphere;
+    auto S1 = boost::make_shared<Sphere>();
     B.setKey(S1);
     B.setKeyN(11);
-    TS_ASSERT_EQUALS(B.getKey(), S1);
+    TS_ASSERT_EQUALS(B.getKey(), S1.get());
     TS_ASSERT_EQUALS(B.getKeyN(), 11);
     TS_ASSERT_EQUALS(B.display(), "11");
     A.setLeaves(&B, (Rule *)0);
@@ -99,17 +101,17 @@ public:
   void testSetLeaf() { // TODO: disable setleaf function as surfpoint cannot
                        // have leaves
     SurfPoint A;
-    Plane *P1 = new Plane;
+    auto P1 = boost::make_shared<Plane>();
     A.setKey(P1);
     A.setKeyN(10);
-    TS_ASSERT_EQUALS(A.getKey(), P1);
+    TS_ASSERT_EQUALS(A.getKey(), P1.get());
     TS_ASSERT_EQUALS(A.getKeyN(), 10);
     TS_ASSERT_EQUALS(A.display(), "10");
     SurfPoint B;
-    Sphere *S1 = new Sphere;
+    auto S1 = boost::make_shared<Sphere>();
     B.setKey(S1);
     B.setKeyN(11);
-    TS_ASSERT_EQUALS(B.getKey(), S1);
+    TS_ASSERT_EQUALS(B.getKey(), S1.get());
     TS_ASSERT_EQUALS(B.getKeyN(), 11);
     TS_ASSERT_EQUALS(B.display(), "11");
     A.setLeaf(&B, 0);
@@ -120,21 +122,21 @@ public:
 
   void testfindLeaf() { // TODO: disable to find leaf as this is final
     SurfPoint A;
-    Plane *P1 = new Plane;
+    auto P1 = boost::make_shared<Plane>();
     A.setKey(P1);
     A.setKeyN(10);
-    TS_ASSERT_EQUALS(A.getKey(), P1);
+    TS_ASSERT_EQUALS(A.getKey(), P1.get());
     TS_ASSERT_EQUALS(A.getKeyN(), 10);
     TS_ASSERT_EQUALS(A.display(), "10");
     SurfPoint B;
-    Sphere *S1 = new Sphere;
+    auto S1 = boost::make_shared<Sphere>();
     B.setKey(S1);
     B.setKeyN(11);
-    TS_ASSERT_EQUALS(B.getKey(), S1);
+    TS_ASSERT_EQUALS(B.getKey(), S1.get());
     TS_ASSERT_EQUALS(B.getKeyN(), 11);
     TS_ASSERT_EQUALS(B.display(), "11");
     TS_ASSERT_EQUALS(A.findLeaf(&B), -1);
-    B.setKey(P1->clone());
+    B.setKey(boost::make_shared<Plane>());
     B.setKeyN(10);
     TS_ASSERT_EQUALS(A.findLeaf(&B), -1);
     TS_ASSERT_EQUALS(A.findLeaf(&A), 0);
@@ -142,10 +144,10 @@ public:
 
   void testFindKey() {
     SurfPoint A;
-    Plane *P1 = new Plane;
+    auto P1 = boost::make_shared<Plane>();
     A.setKey(P1);
     A.setKeyN(10);
-    TS_ASSERT_EQUALS(A.getKey(), P1);
+    TS_ASSERT_EQUALS(A.getKey(), P1.get());
     TS_ASSERT_EQUALS(A.getKeyN(), 10);
     TS_ASSERT_EQUALS(A.display(), "10");
     TS_ASSERT_EQUALS(A.findKey(10), &A);
@@ -154,10 +156,10 @@ public:
 
   void testGetSign() {
     SurfPoint A;
-    Plane *P1 = new Plane;
+    auto P1 = boost::make_shared<Plane>();
     A.setKey(P1);
     A.setKeyN(10);
-    TS_ASSERT_EQUALS(A.getKey(), P1);
+    TS_ASSERT_EQUALS(A.getKey(), P1.get());
     TS_ASSERT_EQUALS(A.getKeyN(), 10);
     TS_ASSERT_EQUALS(A.display(), "10");
     TS_ASSERT_EQUALS(A.getSign(), 1);
@@ -168,10 +170,10 @@ public:
 
   void testSelfConstructor() {
     SurfPoint A;
-    Plane *P1 = new Plane;
+    auto P1 = boost::make_shared<Plane>();
     A.setKey(P1);
     A.setKeyN(10);
-    TS_ASSERT_EQUALS(A.getKey(), P1);
+    TS_ASSERT_EQUALS(A.getKey(), P1.get());
     TS_ASSERT_EQUALS(A.getKeyN(), 10);
     TS_ASSERT_EQUALS(A.display(), "10");
     TS_ASSERT_EQUALS(A.getSign(), 1);
@@ -184,10 +186,10 @@ public:
 
   void testClone() {
     SurfPoint A;
-    Plane *P1 = new Plane;
+    auto P1 = boost::make_shared<Plane>();
     A.setKey(P1);
     A.setKeyN(10);
-    TS_ASSERT_EQUALS(A.getKey(), P1);
+    TS_ASSERT_EQUALS(A.getKey(), P1.get());
     TS_ASSERT_EQUALS(A.getKeyN(), 10);
     TS_ASSERT_EQUALS(A.display(), "10");
     TS_ASSERT_EQUALS(A.getSign(), 1);
@@ -202,10 +204,10 @@ public:
 
   void testAssignment() {
     SurfPoint A;
-    Plane *P1 = new Plane;
+    auto P1 = boost::make_shared<Plane>();
     A.setKey(P1);
     A.setKeyN(10);
-    TS_ASSERT_EQUALS(A.getKey(), P1);
+    TS_ASSERT_EQUALS(A.getKey(), P1.get());
     TS_ASSERT_EQUALS(A.getKeyN(), 10);
     TS_ASSERT_EQUALS(A.display(), "10");
     TS_ASSERT_EQUALS(A.getSign(), 1);
@@ -219,11 +221,11 @@ public:
 
   void testIsValid() {
     SurfPoint A;
-    Plane *P1 = new Plane;
+    auto P1 = boost::make_shared<Plane>();
     P1->setSurface("px 5");
     A.setKey(P1);
     A.setKeyN(10);
-    TS_ASSERT_EQUALS(A.getKey(), P1);
+    TS_ASSERT_EQUALS(A.getKey(), P1.get());
     TS_ASSERT_EQUALS(A.getKeyN(), 10);
     TS_ASSERT_EQUALS(A.display(), "10");
     TS_ASSERT_EQUALS(A.getSign(), 1);
@@ -234,11 +236,11 @@ public:
 
   void testIsValidMap() {
     SurfPoint A;
-    Plane *P1 = new Plane;
+    auto P1 = boost::make_shared<Plane>();
     P1->setSurface("px 5");
     A.setKey(P1);
     A.setKeyN(10);
-    TS_ASSERT_EQUALS(A.getKey(), P1);
+    TS_ASSERT_EQUALS(A.getKey(), P1.get());
     TS_ASSERT_EQUALS(A.getKeyN(), 10);
     TS_ASSERT_EQUALS(A.display(), "10");
     TS_ASSERT_EQUALS(A.getSign(), 1);
diff --git a/Framework/Geometry/test/RulesTest.h b/Framework/Geometry/test/RulesTest.h
index e6cd9e5c312ebf4a8bb4fddc149b9fdf8d5488fc..bdd89ca34fbee314e62278957e2cd2cc66d431ce 100644
--- a/Framework/Geometry/test/RulesTest.h
+++ b/Framework/Geometry/test/RulesTest.h
@@ -15,6 +15,8 @@
 #include "MantidGeometry/Surfaces/Cylinder.h"
 #include "MantidGeometry/Surfaces/Cone.h"
 
+#include "boost/make_shared.hpp"
+
 using namespace Mantid;
 using namespace Geometry;
 
@@ -65,10 +67,12 @@ public:
 
   void testSubstituteSurf() {
     Rule *uTree = createAUnionTree();
-    TS_ASSERT_EQUALS(uTree->substituteSurf(11, 13, new Cone()), 1);
+    TS_ASSERT_EQUALS(uTree->substituteSurf(11, 13, boost::make_shared<Cone>()),
+                     1);
     TS_ASSERT_EQUALS(uTree->display(), "10 : 10 : 12 : 13");
-    TS_ASSERT_EQUALS(uTree->substituteSurf(10, 14, new Sphere()),
-                     2); // its suppose to return 2
+    TS_ASSERT_EQUALS(
+        uTree->substituteSurf(10, 14, boost::make_shared<Sphere>()),
+        2); // its suppose to return 2
     TS_ASSERT_EQUALS(uTree->display(), "14 : 14 : 12 : 13");
     delete uTree;
   }
@@ -80,13 +84,13 @@ private:
     // A Node
     SurfPoint *A, *B, *C;
     A = new SurfPoint();
-    A->setKey(new Plane());
+    A->setKey(boost::make_shared<Plane>());
     A->setKeyN(10);
     B = new SurfPoint();
-    B->setKey(new Sphere());
+    B->setKey(boost::make_shared<Sphere>());
     B->setKeyN(11);
     C = new SurfPoint();
-    C->setKey(new Cylinder());
+    C->setKey(boost::make_shared<Cylinder>());
     C->setKeyN(12);
 
     Union *Left;
@@ -104,13 +108,13 @@ private:
     // A Node
     SurfPoint *A, *B, *C;
     A = new SurfPoint();
-    A->setKey(new Plane());
+    A->setKey(boost::make_shared<Plane>());
     A->setKeyN(10);
     B = new SurfPoint();
-    B->setKey(new Sphere());
+    B->setKey(boost::make_shared<Sphere>());
     B->setKeyN(11);
     C = new SurfPoint();
-    C->setKey(new Cylinder());
+    C->setKey(boost::make_shared<Cylinder>());
     C->setKeyN(12);
     Intersection *Root;
     Root = new Intersection();
@@ -130,13 +134,13 @@ private:
   Rule *createAMixedTree() { // A B : C A
     SurfPoint *A, *B, *C;
     A = new SurfPoint();
-    A->setKey(new Plane());
+    A->setKey(boost::make_shared<Plane>());
     A->setKeyN(10);
     B = new SurfPoint();
-    B->setKey(new Sphere());
+    B->setKey(boost::make_shared<Sphere>());
     B->setKeyN(11);
     C = new SurfPoint();
-    C->setKey(new Cylinder());
+    C->setKey(boost::make_shared<Cylinder>());
     C->setKeyN(12);
     Union *Root;
     Root = new Union();
diff --git a/Framework/Geometry/test/RulesUnionTest.h b/Framework/Geometry/test/RulesUnionTest.h
index 8aac08d7ef2e70a0cd3c102571bca569f3e1be9b..efa8712ef0a333fc7fdf07d74451ab0421533c43 100644
--- a/Framework/Geometry/test/RulesUnionTest.h
+++ b/Framework/Geometry/test/RulesUnionTest.h
@@ -15,6 +15,8 @@
 #include "MantidGeometry/Surfaces/Cylinder.h"
 #include "MantidGeometry/Surfaces/Cone.h"
 
+#include "boost/make_shared.hpp"
+
 using namespace Mantid;
 using namespace Geometry;
 using Mantid::Kernel::V3D;
@@ -29,8 +31,8 @@ public:
 
   void testTwoRuleConstructor() {
     SurfPoint *S1, *S2;
-    Plane *P1 = new Plane;
-    Sphere *Sp1 = new Sphere;
+    auto P1 = boost::make_shared<Plane>();
+    auto Sp1 = boost::make_shared<Sphere>();
     P1->setSurface("px 5");             // yz plane with x=5
     Sp1->setSurface("s 5.0 0.0 0.0 5"); // a sphere with center (5,0,0) and
                                         // radius 5. this will touch origin
@@ -49,8 +51,8 @@ public:
   void testThreeRuleConstructor() {
     Union Parent;
     SurfPoint *S1, *S2;
-    Plane *P1 = new Plane;
-    Sphere *Sp1 = new Sphere;
+    auto P1 = boost::make_shared<Plane>();
+    auto Sp1 = boost::make_shared<Sphere>();
     P1->setSurface("px 5");             // yz plane with x=5
     Sp1->setSurface("s 5.0 0.0 0.0 5"); // a sphere with center (5,0,0) and
                                         // radius 5. this will touch origin
@@ -69,8 +71,8 @@ public:
 
   void testUnionConstructor() {
     SurfPoint *S1, *S2;
-    Plane *P1 = new Plane;
-    Sphere *Sp1 = new Sphere;
+    auto P1 = boost::make_shared<Plane>();
+    auto Sp1 = boost::make_shared<Sphere>();
     P1->setSurface("px 5");             // yz plane with x=5
     Sp1->setSurface("s 5.0 0.0 0.0 5"); // a sphere with center (5,0,0) and
                                         // radius 5. this will touch origin
@@ -92,8 +94,8 @@ public:
 
   void testClone() {
     SurfPoint *S1, *S2;
-    Plane *P1 = new Plane;
-    Sphere *Sp1 = new Sphere;
+    auto P1 = boost::make_shared<Plane>();
+    auto Sp1 = boost::make_shared<Sphere>();
     P1->setSurface("px 5");             // yz plane with x=5
     Sp1->setSurface("s 5.0 0.0 0.0 5"); // a sphere with center (5,0,0) and
                                         // radius 5. this will touch origin
@@ -117,8 +119,8 @@ public:
 
   void testAssignment() {
     SurfPoint *S1, *S2;
-    Plane *P1 = new Plane;
-    Sphere *Sp1 = new Sphere;
+    auto P1 = boost::make_shared<Plane>();
+    auto Sp1 = boost::make_shared<Sphere>();
     P1->setSurface("px 5");             // yz plane with x=5
     Sp1->setSurface("s 5.0 0.0 0.0 5"); // a sphere with center (5,0,0) and
                                         // radius 5. this will touch origin
@@ -141,8 +143,8 @@ public:
 
   void testSetLeaves() {
     SurfPoint *S1, *S2;
-    Plane *P1 = new Plane;
-    Sphere *Sp1 = new Sphere;
+    auto P1 = boost::make_shared<Plane>();
+    auto Sp1 = boost::make_shared<Sphere>();
     P1->setSurface("px 5");             // yz plane with x=5
     Sp1->setSurface("s 5.0 0.0 0.0 5"); // a sphere with center (5,0,0) and
                                         // radius 5. this will touch origin
@@ -161,8 +163,8 @@ public:
 
   void testSetLeaf() {
     SurfPoint *S1, *S2;
-    Plane *P1 = new Plane;
-    Sphere *Sp1 = new Sphere;
+    auto P1 = boost::make_shared<Plane>();
+    auto Sp1 = boost::make_shared<Sphere>();
     P1->setSurface("px 5");             // yz plane with x=5
     Sp1->setSurface("s 5.0 0.0 0.0 5"); // a sphere with center (5,0,0) and
                                         // radius 5. this will touch origin
@@ -184,8 +186,8 @@ public:
 
   void testFindLeaf() {
     SurfPoint *S1, *S2, S3;
-    Plane *P1 = new Plane;
-    Sphere *Sp1 = new Sphere;
+    auto P1 = boost::make_shared<Plane>();
+    auto Sp1 = boost::make_shared<Sphere>();
     P1->setSurface("px 5");             // yz plane with x=5
     Sp1->setSurface("s 5.0 0.0 0.0 5"); // a sphere with center (5,0,0) and
                                         // radius 5. this will touch origin
@@ -207,8 +209,8 @@ public:
 
   void testFindKey() {
     SurfPoint *S1, *S2;
-    Plane *P1 = new Plane;
-    Sphere *Sp1 = new Sphere;
+    auto P1 = boost::make_shared<Plane>();
+    auto Sp1 = boost::make_shared<Sphere>();
     P1->setSurface("px 5");             // yz plane with x=5
     Sp1->setSurface("s 5.0 0.0 0.0 5"); // a sphere with center (5,0,0) and
                                         // radius 5. this will touch origin
@@ -231,8 +233,8 @@ public:
   void testIsComplementary() { // Problem: it only detects whether first leaf or
                                // second leaf but not both
     SurfPoint *S1, *S2;
-    Plane *P1 = new Plane;
-    Sphere *Sp1 = new Sphere;
+    auto P1 = boost::make_shared<Plane>();
+    auto Sp1 = boost::make_shared<Sphere>();
     P1->setSurface("px 5");             // yz plane with x=5
     Sp1->setSurface("s 5.0 0.0 0.0 5"); // a sphere with center (5,0,0) and
                                         // radius 5. this will touch origin
@@ -257,8 +259,8 @@ public:
 
   void testIsValid() {
     SurfPoint *S1, *S2;
-    Plane *P1 = new Plane;
-    Sphere *Sp1 = new Sphere;
+    auto P1 = boost::make_shared<Plane>();
+    auto Sp1 = boost::make_shared<Sphere>();
     P1->setSurface("px 5");             // yz plane with x=5
     Sp1->setSurface("s 5.0 0.0 0.0 5"); // a sphere with center (5,0,0) and
                                         // radius 5. this will touch origin
@@ -282,8 +284,8 @@ public:
 
   void testIsValidMap() {
     SurfPoint *S1, *S2;
-    Plane *P1 = new Plane;
-    Sphere *Sp1 = new Sphere;
+    auto P1 = boost::make_shared<Plane>();
+    auto Sp1 = boost::make_shared<Sphere>();
     P1->setSurface("px 5");             // yz plane with x=5
     Sp1->setSurface("s 5.0 0.0 0.0 5"); // a sphere with center (5,0,0) and
                                         // radius 5. this will touch origin
diff --git a/Framework/Geometry/test/SphereTest.h b/Framework/Geometry/test/SphereTest.h
index 04feff15db16abb4ea45af9c8f7d7c244e195e33..32cdf2f58312200b7a162feb5f890f8e21ad78f1 100644
--- a/Framework/Geometry/test/SphereTest.h
+++ b/Framework/Geometry/test/SphereTest.h
@@ -36,29 +36,12 @@ public:
     TS_ASSERT_EQUALS(extractString(A), "-1 s [1.1,-2.1,1.1] 2\n");
   }
 
-  void testCopyConstructor() {
-    Sphere A;
-    A.setSurface("s 1.1 -2.1 1.1 2");
-    TS_ASSERT_EQUALS(extractString(A), "-1 s [1.1,-2.1,1.1] 2\n");
-    Sphere B(A);
-    TS_ASSERT_EQUALS(extractString(B), "-1 s [1.1,-2.1,1.1] 2\n");
-  }
-
   void testClone() {
     Sphere A;
     A.setSurface("s 1.1 -2.1 1.1 2");
     TS_ASSERT_EQUALS(extractString(A), "-1 s [1.1,-2.1,1.1] 2\n");
-    Sphere *B = A.clone();
+    auto B = A.clone();
     TS_ASSERT_EQUALS(extractString(*B), "-1 s [1.1,-2.1,1.1] 2\n");
-    delete B;
-  }
-
-  void testAssignment() {
-    Sphere A, B;
-    A.setSurface("s 1.1 -2.1 1.1 2");
-    TS_ASSERT_DIFFERS(extractString(B), extractString(A));
-    B = A;
-    TS_ASSERT_EQUALS(extractString(B), extractString(A));
   }
 
   /// is a point inside outside or on the side!
diff --git a/Framework/Geometry/test/StructureFactorCalculatorSummationTest.h b/Framework/Geometry/test/StructureFactorCalculatorSummationTest.h
index a1ce3c9670a57b3edd0cd2dd6302d8c27c3a33bf..80b53703646a26e7945a84974b2d04036b9f3918 100644
--- a/Framework/Geometry/test/StructureFactorCalculatorSummationTest.h
+++ b/Framework/Geometry/test/StructureFactorCalculatorSummationTest.h
@@ -62,7 +62,8 @@ private:
   CrystalStructure getCrystalStructure() {
     CompositeBraggScatterer_sptr scatterers = CompositeBraggScatterer::create();
     scatterers->addScatterer(BraggScattererFactory::Instance().createScatterer(
-        "IsotropicAtomBraggScatterer", "Element=Si;Position=[0,0,0];U=0.05"));
+        "IsotropicAtomBraggScatterer",
+        "{\"Element\":\"Si\",\"Position\":\"0,0,0\",\"U\":\"0.05\"}"));
 
     CrystalStructure si(
         UnitCell(5.43, 5.43, 5.43),
diff --git a/Framework/Geometry/test/SurfaceFactoryTest.h b/Framework/Geometry/test/SurfaceFactoryTest.h
index 1e982cb4e2a733eed28020465b6754fab8b2d1b5..86273c57af7cb7b580e9c27660ff89aa38e223e3 100644
--- a/Framework/Geometry/test/SurfaceFactoryTest.h
+++ b/Framework/Geometry/test/SurfaceFactoryTest.h
@@ -27,60 +27,48 @@ public:
   void testCreateSurface() {
     SurfaceFactory *A;
     A = SurfaceFactory::Instance();
-    Plane *P = dynamic_cast<Plane *>(A->createSurface("Plane"));
+    auto P = A->createSurface("Plane");
     TS_ASSERT_EQUALS(extractString(*P), "-1 px 0\n");
-    Sphere *B = dynamic_cast<Sphere *>(A->createSurface("Sphere"));
+    auto B = A->createSurface("Sphere");
     TS_ASSERT_EQUALS(extractString(*B), "-1 so 0\n");
-    Cylinder *C = dynamic_cast<Cylinder *>(A->createSurface("Cylinder"));
+    auto C = A->createSurface("Cylinder");
     TS_ASSERT_EQUALS(extractString(*C), "-1 cx 0\n");
-    Cone *K = dynamic_cast<Cone *>(A->createSurface("Cone"));
+    auto K = A->createSurface("Cone");
     TS_ASSERT_EQUALS(extractString(*K), "-1  kx 0 0\n");
-    delete P;
-    delete B;
-    delete C;
-    delete K;
   }
 
   void testCreateSurfaceID() {
     SurfaceFactory *A;
     A = SurfaceFactory::Instance();
-    Plane *P = dynamic_cast<Plane *>(A->createSurfaceID("p"));
+    auto P = A->createSurfaceID("p");
     TS_ASSERT_EQUALS(extractString(*P), "-1 px 0\n");
-    Sphere *B = dynamic_cast<Sphere *>(A->createSurfaceID("s"));
+    auto B = A->createSurfaceID("s");
     TS_ASSERT_EQUALS(extractString(*B), "-1 so 0\n");
-    Cylinder *C = dynamic_cast<Cylinder *>(A->createSurfaceID("c"));
+    auto C = A->createSurfaceID("c");
     TS_ASSERT_EQUALS(extractString(*C), "-1 cx 0\n");
-    Cone *K = dynamic_cast<Cone *>(A->createSurfaceID("k"));
+    auto K = A->createSurfaceID("k");
     TS_ASSERT_EQUALS(extractString(*K), "-1  kx 0 0\n");
-    delete P;
-    delete B;
-    delete C;
-    delete K;
   }
 
   void testProcessLine() {
     SurfaceFactory *A;
     A = SurfaceFactory::Instance();
-    Surface *P = A->processLine("pz 5");
+    auto P = A->processLine("pz 5");
     Plane tP;
     tP.setSurface("pz 5");
     TS_ASSERT_EQUALS(extractString(*P), extractString(tP));
-    Surface *S = A->processLine("s 1.1 -2.1 1.1 2");
+    auto S = A->processLine("s 1.1 -2.1 1.1 2");
     Sphere tS;
     tS.setSurface("s 1.1 -2.1 1.1 2");
     TS_ASSERT_EQUALS(extractString(*S), extractString(tS));
-    Surface *C = A->processLine("c/x 0.5 0.5 1.0");
+    auto C = A->processLine("c/x 0.5 0.5 1.0");
     Cylinder tC;
     tC.setSurface("c/x 0.5 0.5 1.0");
     TS_ASSERT_EQUALS(extractString(*C), extractString(tC));
-    Surface *K = A->processLine("k/x 1.0 1.0 1.0 1.0");
+    auto K = A->processLine("k/x 1.0 1.0 1.0 1.0");
     Cone tK;
     tK.setSurface("k/x 1.0 1.0 1.0 1.0");
     TS_ASSERT_EQUALS(extractString(*K), extractString(tK));
-    delete P;
-    delete S;
-    delete C;
-    delete K;
   }
 
 private:
diff --git a/Framework/Kernel/CMakeLists.txt b/Framework/Kernel/CMakeLists.txt
index 441191f38238d3ce0bb21bc37692ea3fcc741ea1..d886fb7c26edaf04a30a9e2a44a1a0290ca70e88 100644
--- a/Framework/Kernel/CMakeLists.txt
+++ b/Framework/Kernel/CMakeLists.txt
@@ -433,7 +433,7 @@ set_property ( TARGET Kernel PROPERTY FOLDER "MantidFramework" )
 if ( GCC_COMPILER_VERSION AND GCC_COMPILER_VERSION VERSION_LESS "4.5" )
  target_link_libraries ( Kernel LINK_PRIVATE stdc++ )
 endif()
-target_link_libraries ( Kernel LINK_PRIVATE ${TCMALLOC_LIBRARIES_LINKTIME} ${NEXUS_LIBRARIES} ${GSL_LIBRARIES} ${MANTIDLIBS} ${NETWORK_LIBRARIES} )
+target_link_libraries ( Kernel LINK_PRIVATE ${TCMALLOC_LIBRARIES_LINKTIME} ${NEXUS_LIBRARIES} ${GSL_LIBRARIES} ${MANTIDLIBS} ${NETWORK_LIBRARIES} ${JSONCPP_LIBRARIES} )
 
 if (WITH_ASAN)
   target_link_libraries ( Kernel LINK_PRIVATE -lasan )
diff --git a/Framework/Kernel/inc/MantidKernel/IPropertyManager.h b/Framework/Kernel/inc/MantidKernel/IPropertyManager.h
index e7998090ccf796c9a42f88dae209af0fc61522f3..f1912e7ced359928034c33dc2495d12e3cefeea9 100644
--- a/Framework/Kernel/inc/MantidKernel/IPropertyManager.h
+++ b/Framework/Kernel/inc/MantidKernel/IPropertyManager.h
@@ -6,7 +6,11 @@
 //----------------------------------------------------------------------
 #include "MantidKernel/PropertyWithValue.h"
 #include <vector>
-#include <map>
+#include <set>
+
+namespace Json {
+class Value;
+}
 
 namespace Mantid {
 
@@ -67,10 +71,36 @@ public:
                               const bool delproperty = true) = 0;
 
   /** Sets all the declared properties from a string.
-      @param propertiesArray :: A list of name = value pairs separated by a
+    @param propertiesString :: A list of name = value pairs separated by a
      semicolon
+    @param ignoreProperties :: A set of names of any properties NOT to set
+    from the propertiesArray
+  */
+  virtual void setPropertiesWithSimpleString(
+      const std::string &propertiesString,
+      const std::set<std::string> &
+          ignoreProperties = std::set<std::string>()) = 0;
+
+  /** Sets all the declared properties from a string.
+      @param propertiesJson :: A string of name = value pairs formatted
+        as a json name value pair collection
+      @param ignoreProperties :: A set of names of any properties NOT to set
+      from the propertiesArray
    */
-  virtual void setProperties(const std::string &propertiesArray) = 0;
+  virtual void
+  setProperties(const std::string &propertiesJson,
+                const std::set<std::string> &
+                    ignoreProperties = std::set<std::string>()) = 0;
+
+  /** Sets all the declared properties from a json object
+     @param jsonValue :: A json name value pair collection
+     @param ignoreProperties :: A set of names of any properties NOT to set
+     from the propertiesArray
+  */
+  virtual void
+  setProperties(const ::Json::Value &jsonValue,
+                const std::set<std::string> &
+                    ignoreProperties = std::set<std::string>()) = 0;
 
   /** Sets property value from a string
       @param name :: Property name
@@ -141,8 +171,10 @@ public:
   void updatePropertyValues(const IPropertyManager &other);
 
   /// Return the property manager serialized as a string.
-  virtual std::string asString(bool withDefaultValues = false,
-                               char separator = ',') const = 0;
+  virtual std::string asString(bool withDefaultValues = false) const = 0;
+
+  /// Return the property manager serialized as a json object.
+  virtual ::Json::Value asJson(bool withDefaultValues = false) const = 0;
 
   /** Give settings to a property to determine when it gets enabled/hidden.
    * Passes ownership of the given IPropertySettings object to the named
diff --git a/Framework/Kernel/inc/MantidKernel/PropertyManager.h b/Framework/Kernel/inc/MantidKernel/PropertyManager.h
index 30b9efd91e57bb1e6cffe67433c9feac6bab11f1..8b9811629bb2fcb0537b8063a99201164d7c76bb 100644
--- a/Framework/Kernel/inc/MantidKernel/PropertyManager.h
+++ b/Framework/Kernel/inc/MantidKernel/PropertyManager.h
@@ -74,7 +74,21 @@ public:
   void declareProperty(Property *p, const std::string &doc = "");
 
   // Sets all the declared properties from
-  void setProperties(const std::string &propertiesArray);
+  void setProperties(
+      const std::string &propertiesJson,
+      const std::set<std::string> &ignoreProperties = std::set<std::string>());
+  void setProperties(const std::string &propertiesJson,
+                     IPropertyManager *targetPropertyManager,
+                     const std::set<std::string> &ignoreProperties);
+  void setProperties(
+      const ::Json::Value &jsonValue,
+      const std::set<std::string> &ignoreProperties = std::set<std::string>());
+  void setProperties(
+      const ::Json::Value &jsonValue, IPropertyManager *targetPropertyManager,
+      const std::set<std::string> &ignoreProperties = std::set<std::string>());
+  void setPropertiesWithSimpleString(
+      const std::string &propertiesString,
+      const std::set<std::string> &ignoreProperties = std::set<std::string>());
   void setPropertyValue(const std::string &name, const std::string &value);
   void setPropertyOrdinal(const int &index, const std::string &value);
 
@@ -92,8 +106,9 @@ public:
   /// Get the value of a property
   TypedValue getProperty(const std::string &name) const;
   /// Return the property manager serialized as a string.
-  virtual std::string asString(bool withDefaultValues = false,
-                               char separator = ',') const;
+  virtual std::string asString(bool withDefaultValues = false) const;
+  /// Return the property manager serialized as a json object.
+  virtual ::Json::Value asJson(bool withDefaultValues = false) const;
 
 protected:
   using IPropertyManager::declareProperty;
diff --git a/Framework/Kernel/inc/MantidKernel/PropertyManagerOwner.h b/Framework/Kernel/inc/MantidKernel/PropertyManagerOwner.h
index ada32918cb12d35a2b41a9359cce28e8c18ca112..df1a9d3efd682acdfe8eb4381ed8255112ee968c 100644
--- a/Framework/Kernel/inc/MantidKernel/PropertyManagerOwner.h
+++ b/Framework/Kernel/inc/MantidKernel/PropertyManagerOwner.h
@@ -60,7 +60,20 @@ public:
   using IPropertyManager::declareProperty;
 
   // Sets all the declared properties from
-  void setProperties(const std::string &propertiesArray);
+  void setProperties(
+      const std::string &propertiesJson,
+      const std::set<std::string> &ignoreProperties = std::set<std::string>());
+
+  // Sets all the declared properties from a json object
+  void setProperties(
+      const ::Json::Value &jsonValue,
+      const std::set<std::string> &ignoreProperties = std::set<std::string>());
+
+  // sets all the declared properties using a simple string format
+  void setPropertiesWithSimpleString(
+      const std::string &propertiesString,
+      const std::set<std::string> &ignoreProperties = std::set<std::string>());
+
   void setPropertyValue(const std::string &name, const std::string &value);
   void setPropertyOrdinal(const int &index, const std::string &value);
 
@@ -78,9 +91,12 @@ public:
 
   /// Get the value of a property
   virtual TypedValue getProperty(const std::string &name) const;
+
   /// Return the property manager serialized as a string.
-  virtual std::string asString(bool withDefaultValues = false,
-                               char separator = ',') const;
+  virtual std::string asString(bool withDefaultValues = false) const;
+
+  /// Return the property manager serialized as a json object.
+  virtual ::Json::Value asJson(bool withDefaultValues = false) const;
 
   bool isDefault(const std::string &name) const;
 
diff --git a/Framework/Kernel/src/PropertyManager.cpp b/Framework/Kernel/src/PropertyManager.cpp
index ae4b0e22af3e56af7414141645680fa72ee8df08..cdf6d916005cc33c5ea30b0e57dff4e622dabb0b 100644
--- a/Framework/Kernel/src/PropertyManager.cpp
+++ b/Framework/Kernel/src/PropertyManager.cpp
@@ -4,7 +4,7 @@
 #include "MantidKernel/PropertyManager.h"
 #include "MantidKernel/FilteredTimeSeriesProperty.h"
 
-#include <boost/algorithm/string/trim.hpp>
+#include <json/json.h>
 
 namespace Mantid {
 namespace Kernel {
@@ -210,19 +210,107 @@ void PropertyManager::declareProperty(Property *p, const std::string &doc) {
 /** Set the ordered list of properties by one string of values, separated by
  *semicolons.
  *
- * The string should be of format "PropertyName=value;Property2=value2; etc..."
+ * The string should be a json formatted collection of name value pairs
  *
- *  @param propertiesArray :: The list of property values
+ *  @param propertiesJson :: The string of property values
+ *  @param ignoreProperties :: A set of names of any properties NOT to set
+ *      from the propertiesArray
  *  @throw invalid_argument if error in parameters
  */
-// Care will certainly be required in the calling of this function or it could
-// all go horribly wrong!
-void PropertyManager::setProperties(const std::string &propertiesArray) {
+void PropertyManager::setProperties(
+    const std::string &propertiesJson,
+    const std::set<std::string> &ignoreProperties) {
+  setProperties(propertiesJson, this, ignoreProperties);
+}
+//-----------------------------------------------------------------------------------------------
+/** Set the ordered list of properties by one string of values, separated by
+ *semicolons.
+ *
+ * The string should be a json formatted collection of name value pairs
+ *
+ *  @param propertiesJson :: The string of property values
+ *  @param ignoreProperties :: A set of names of any properties NOT to set
+ *      from the propertiesArray
+ *  @param targetPropertyManager :: the propertymanager to make the changes to,
+ *      most of the time this will be *this
+ *  @throw invalid_argument if error in parameters
+ */
+void PropertyManager::setProperties(
+    const std::string &propertiesJson, IPropertyManager *targetPropertyManager,
+    const std::set<std::string> &ignoreProperties) {
+  ::Json::Reader reader;
+  ::Json::Value jsonValue;
+
+  if (reader.parse(propertiesJson, jsonValue)) {
+    setProperties(jsonValue, targetPropertyManager, ignoreProperties);
+  } else {
+    throw std::invalid_argument("propertiesArray was not valid json");
+  }
+}
+//-----------------------------------------------------------------------------------------------
+/** Set the ordered list of properties by a json value collection
+ *
+ *  @param jsonValue :: The jsonValue of property values
+ *  @param ignoreProperties :: A set of names of any properties NOT to set
+ *      from the propertiesArray
+ */
+void PropertyManager::setProperties(
+    const ::Json::Value &jsonValue,
+    const std::set<std::string> &ignoreProperties) {
+  setProperties(jsonValue, this, ignoreProperties);
+}
+
+//-----------------------------------------------------------------------------------------------
+/** Set the ordered list of properties by a json value collection
+ *
+ *  @param jsonValue :: The jsonValue of property values
+ *  @param ignoreProperties :: A set of names of any properties NOT to set
+ *      from the propertiesArray
+ *  @param targetPropertyManager :: the propertymanager to make the changes to,
+ *      most of the time this will be *this
+ */
+void PropertyManager::setProperties(
+    const ::Json::Value &jsonValue, IPropertyManager *targetPropertyManager,
+    const std::set<std::string> &ignoreProperties) {
+  if (jsonValue.type() == ::Json::ValueType::objectValue) {
+
+    // Some algorithms require Filename to be set first do that here
+    const std::string propFilename = "Filename";
+    ::Json::Value filenameValue = jsonValue[propFilename];
+    if (!filenameValue.isNull()) {
+      const std::string value = jsonValue[propFilename].asString();
+      // Set it
+      targetPropertyManager->setPropertyValue(propFilename, value);
+    }
+
+    for (::Json::ArrayIndex i = 0; i < jsonValue.size(); i++) {
+      const std::string propName = jsonValue.getMemberNames()[i];
+      if ((propFilename != propName) &&
+          (ignoreProperties.find(propName) == ignoreProperties.end())) {
+        ::Json::Value propValue = jsonValue[propName];
+        const std::string value = propValue.asString();
+        // Set it
+        targetPropertyManager->setPropertyValue(propName, value);
+      }
+    }
+  }
+}
+
+/** Sets all the declared properties from a string.
+  @param propertiesString :: A list of name = value pairs separated by a
+    semicolon
+  @param ignoreProperties :: A set of names of any properties NOT to set
+  from the propertiesArray
+*/
+void PropertyManager::setPropertiesWithSimpleString(
+    const std::string &propertiesString,
+    const std::set<std::string> &ignoreProperties) {
+  ::Json::Value propertyJson;
   // Split up comma-separated properties
   typedef boost::tokenizer<boost::char_separator<char>> tokenizer;
 
   boost::char_separator<char> sep(";");
-  tokenizer propPairs(propertiesArray, sep);
+  tokenizer propPairs(propertiesString, sep);
   int index = 0;
   // Iterate over the properties
   for (tokenizer::iterator it = propPairs.begin(); it != propPairs.end();
@@ -231,13 +319,7 @@ void PropertyManager::setProperties(const std::string &propertiesArray) {
     std::string pair = *it;
 
     size_t n = pair.find('=');
-    if (n == std::string::npos) {
-      // No equals sign
-      // This is for a property with no value. Not clear that we will want such
-      // a thing.
-      // Interpret the string as the index^th property in the list,
-      setPropertyOrdinal(index, pair);
-    } else {
+    if (n != std::string::npos) {
       // Normal "PropertyName=value" string.
       std::string propName = "";
       std::string value = "";
@@ -252,10 +334,11 @@ void PropertyManager::setProperties(const std::string &propertiesArray) {
         value = "";
       }
       // Set it
-      setPropertyValue(propName, value);
+      propertyJson[propName] = value;
     }
     index++;
   }
+  setProperties(propertyJson, ignoreProperties);
 }
 
 //-----------------------------------------------------------------------------------------------
@@ -362,25 +445,34 @@ std::string PropertyManager::getPropertyValue(const std::string &name) const {
  * The format is propName=value,propName=value,propName=value
  * @param withDefaultValues :: If true then the value of default parameters will
  *be included
- * @param separator :: character to separate property/value pairs. Default
- *comma.
  * @returns A serialized version of the manager
  */
-std::string PropertyManager::asString(bool withDefaultValues,
-                                      char separator) const {
-  std::ostringstream writer;
+std::string PropertyManager::asString(bool withDefaultValues) const {
+  ::Json::FastWriter writer;
+  const string output = writer.write(asJson(withDefaultValues));
+
+  return output;
+}
+
+//-----------------------------------------------------------------------------------------------
+/** Return the property manager serialized as a json object.
+ * * @param withDefaultValues :: If true then the value of default parameters
+ will
+ *be included
+
+ * @returns A serialized version of the manager
+ */
+::Json::Value PropertyManager::asJson(bool withDefaultValues) const {
+  ::Json::Value jsonMap;
   const size_t count = propertyCount();
-  size_t numAdded = 0;
   for (size_t i = 0; i < count; ++i) {
-    Property *p = getPointerToPropertyOrdinal((int)i);
+    Property *p = getPointerToPropertyOrdinal(static_cast<int>(i));
     if (withDefaultValues || !(p->isDefault())) {
-      if (numAdded > 0)
-        writer << separator;
-      writer << p->name() << "=" << p->value();
-      numAdded++;
+      jsonMap[p->name()] = p->value();
     }
   }
-  return writer.str();
+
+  return jsonMap;
 }
 
 //-----------------------------------------------------------------------------------------------
diff --git a/Framework/Kernel/src/PropertyManagerOwner.cpp b/Framework/Kernel/src/PropertyManagerOwner.cpp
index aab6b85318985da7bc619e12668fa3c1d032bcfa..08ad8bd11c33515b1a3be70c3554ef1a019cda52 100644
--- a/Framework/Kernel/src/PropertyManagerOwner.cpp
+++ b/Framework/Kernel/src/PropertyManagerOwner.cpp
@@ -4,6 +4,8 @@
 #include "MantidKernel/PropertyManagerOwner.h"
 #include "MantidKernel/PropertyManager.h"
 
+#include <json/json.h>
+
 namespace Mantid {
 namespace Kernel {
 namespace {
@@ -39,14 +41,44 @@ void PropertyManagerOwner::declareProperty(Property *p,
   m_properties->declareProperty(p, doc);
 }
 
-/** Set the ordered list of properties by one string of values.
-*  @param propertiesArray :: The list of property values
-*  @throw invalid_argument if error in parameters
+/** Set the ordered list of properties by one string of values, separated by
+ *semicolons.
+ *
+ * The string should be a json formatted collection of name value pairs
+ *
+ *  @param propertiesJson :: The string of property values
+ *  @param ignoreProperties :: A set of names of any properties NOT to set
+ *      from the propertiesArray
+ *  @throw invalid_argument if error in parameters
+ */
+void PropertyManagerOwner::setProperties(
+    const std::string &propertiesJson,
+    const std::set<std::string> &ignoreProperties) {
+  m_properties->setProperties(propertiesJson, this, ignoreProperties);
+}
+
+/** Sets all the declared properties from a json object
+  @param jsonValue :: A json name value pair collection
+  @param ignoreProperties :: A set of names of any properties NOT to set
+  from the propertiesArray
+  */
+void PropertyManagerOwner::setProperties(
+    const ::Json::Value &jsonValue,
+    const std::set<std::string> &ignoreProperties) {
+  m_properties->setProperties(jsonValue, this, ignoreProperties);
+}
+
+/** Sets all the declared properties from a string.
+  @param propertiesString :: A list of name = value pairs separated by a
+    semicolon
+  @param ignoreProperties :: A set of names of any properties NOT to set
+  from the propertiesArray
 */
-// Care will certainly be required in the calling of this function or it could
-// all go horribly wrong!
-void PropertyManagerOwner::setProperties(const std::string &propertiesArray) {
-  m_properties->setProperties(propertiesArray);
+void PropertyManagerOwner::setPropertiesWithSimpleString(
+    const std::string &propertiesString,
+    const std::set<std::string> &ignoreProperties) {
+  m_properties->setPropertiesWithSimpleString(propertiesString,
+                                              ignoreProperties);
 }
 
 /** Set the value of a property by string
@@ -171,12 +203,19 @@ bool PropertyManagerOwner::isDefault(const std::string &name) const {
 * The format is propName=value,propName=value,propName=value
 * @param withDefaultValues :: If true then the value of default parameters will
 * be included
-* @param separator :: character for the separator
 * @returns A stringized version of the manager
 */
-std::string PropertyManagerOwner::asString(bool withDefaultValues,
-                                           char separator) const {
-  return m_properties->asString(withDefaultValues, separator);
+std::string PropertyManagerOwner::asString(bool withDefaultValues) const {
+  return m_properties->asString(withDefaultValues);
+}
+/**
+* Return the property manager serialized as a json object.
+* @param withDefaultValues :: If true then the value of default parameters will
+* be included
+* @returns A jsonValue of the manager
+*/
+::Json::Value PropertyManagerOwner::asJson(bool withDefaultValues) const {
+  return m_properties->asJson(withDefaultValues);
 }
 
 /**
diff --git a/Framework/Kernel/test/CMakeLists.txt b/Framework/Kernel/test/CMakeLists.txt
index 636f917d3ebaeef6b12d23ad20c1041b3f780ed2..926cb05c923a9f65fe684cd87903958b435effdf 100644
--- a/Framework/Kernel/test/CMakeLists.txt
+++ b/Framework/Kernel/test/CMakeLists.txt
@@ -14,7 +14,8 @@ if ( CXXTEST_FOUND )
             ${Boost_LIBRARIES}
             ${POCO_LIBRARIES}
             ${GMOCK_LIBRARIES}
-            ${GTEST_LIBRARIES} )
+            ${GTEST_LIBRARIES}
+            ${JSONCPP_LIBRARIES} )
   add_dependencies ( FrameworkTests KernelTest )
   # Test data
   add_dependencies ( KernelTest StandardTestData )
diff --git a/Framework/Kernel/test/PropertyManagerTest.h b/Framework/Kernel/test/PropertyManagerTest.h
index bc3bd51970e358aca96c5de66105459480fdee62..6f8fc0efe49e8dffa42fbfe2058f3cd5ce33a113 100644
--- a/Framework/Kernel/test/PropertyManagerTest.h
+++ b/Framework/Kernel/test/PropertyManagerTest.h
@@ -3,6 +3,7 @@
 
 #include <cxxtest/TestSuite.h>
 
+#include "MantidKernel/ArrayProperty.h"
 #include "MantidKernel/PropertyManager.h"
 #include "MantidKernel/BoundedValidator.h"
 #include "MantidKernel/MandatoryValidator.h"
@@ -10,6 +11,7 @@
 #include "MantidKernel/FilteredTimeSeriesProperty.h"
 
 #include <boost/scoped_ptr.hpp>
+#include <json/json.h>
 
 using namespace Mantid::Kernel;
 
@@ -192,21 +194,45 @@ public:
     PropertyManagerHelper mgr;
     mgr.declareProperty("APROP", 1);
     mgr.declareProperty("anotherProp", 1.0);
-    TS_ASSERT_THROWS_NOTHING(mgr.setProperties("APROP=15;anotherProp=1.3"));
-    TS_ASSERT(!mgr.getPropertyValue("APROP").compare("15"));
-    TS_ASSERT(!mgr.getPropertyValue("anotherProp").compare("1.3"));
+
+    std::string jsonString = "{\"APROP\":\"15\",\"anotherProp\":\"1.3\"}\n";
+    TS_ASSERT_THROWS_NOTHING(mgr.setProperties(jsonString));
+    TS_ASSERT_EQUALS(mgr.getPropertyValue("APROP"), "15");
+    TS_ASSERT_EQUALS(mgr.getPropertyValue("anotherProp"), "1.3");
   }
 
   void testSetProperties_complicatedValueString() {
     PropertyManagerHelper mgr;
     mgr.declareProperty("APROP", "1");
     mgr.declareProperty("anotherProp", "1");
-    TS_ASSERT_THROWS_NOTHING(
-        mgr.setProperties("APROP=equation=12+3;anotherProp=1.3,2.5"));
+    std::string jsonString =
+        "{\"APROP\":\"equation=12+3\",\"anotherProp\":\"1.3,2.5\"}\n";
+    TS_ASSERT_THROWS_NOTHING(mgr.setProperties(jsonString));
     TS_ASSERT_EQUALS(mgr.getPropertyValue("APROP"), "equation=12+3");
     TS_ASSERT_EQUALS(mgr.getPropertyValue("anotherProp"), "1.3,2.5");
   }
 
+  void testSetProperties_complicatedValueString2() {
+    PropertyManagerHelper mgr;
+    mgr.declareProperty("APROP", "1");
+    mgr.declareProperty("anotherProp", "1");
+
+    std::string jsonString =
+        "{\"APROP\":\"equation = 12 + 3\",\"anotherProp\":\"-1.3, +2.5\"}\n";
+    TS_ASSERT_THROWS_NOTHING(mgr.setProperties(jsonString));
+    TS_ASSERT_EQUALS(mgr.getPropertyValue("APROP"), "equation = 12 + 3");
+    TS_ASSERT_EQUALS(mgr.getPropertyValue("anotherProp"), "-1.3, +2.5");
+  }
+
+  void testSetProperties_arrayValueString() {
+    PropertyManagerHelper mgr;
+    mgr.declareProperty(new ArrayProperty<double>("ArrayProp"));
+
+    std::string jsonString = "{\"ArrayProp\":\"10,12,23\"}";
+    TS_ASSERT_THROWS_NOTHING(mgr.setProperties(jsonString));
+    TS_ASSERT_EQUALS(mgr.getPropertyValue("ArrayProp"), "10,12,23");
+  }
+
   void testSetPropertyValue() {
     manager->setPropertyValue("APROP", "10");
     TS_ASSERT(!manager->getPropertyValue("aProp").compare("10"));
@@ -356,15 +382,61 @@ public:
     PropertyManagerHelper mgr;
     TS_ASSERT_THROWS_NOTHING(mgr.declareProperty("Prop1", 10));
     TS_ASSERT_THROWS_NOTHING(mgr.declareProperty("Prop2", 15));
-    TSM_ASSERT_EQUALS("Empty string when all are default", mgr.asString(), "");
+
+    ::Json::Reader reader;
+    ::Json::Value value;
+
+    /// TSM_ASSERT_EQUALS("Empty string when all are default", mgr.asString(),
+    /// "");
+    TSM_ASSERT("value was not valid JSON", reader.parse(mgr.asString(), value));
+
+    TSM_ASSERT_EQUALS("value was not empty", value.size(), 0);
+
     TSM_ASSERT_EQUALS("Show the default", mgr.asString(true),
-                      "Prop1=10,Prop2=15");
-    TSM_ASSERT_EQUALS("Different separator", mgr.asString(true, ';'),
-                      "Prop1=10;Prop2=15");
+                      "{\"Prop1\":\"10\",\"Prop2\":\"15\"}\n");
+
+    TSM_ASSERT("value was not valid JSON",
+               reader.parse(mgr.asString(true), value));
+    TS_ASSERT_EQUALS(boost::lexical_cast<int>(value["Prop1"].asString()), 10);
+    TS_ASSERT_EQUALS(boost::lexical_cast<int>(value["Prop2"].asString()), 15);
     mgr.setProperty("Prop1", 123);
     mgr.setProperty("Prop2", 456);
-    TSM_ASSERT_EQUALS("Change the values", mgr.asString(false, ';'),
-                      "Prop1=123;Prop2=456");
+    TSM_ASSERT_EQUALS("Change the values", mgr.asString(false),
+                      "{\"Prop1\":\"123\",\"Prop2\":\"456\"}\n");
+
+    TSM_ASSERT("value was not valid JSON",
+               reader.parse(mgr.asString(false), value));
+    TS_ASSERT_EQUALS(boost::lexical_cast<int>(value["Prop1"].asString()), 123);
+    TS_ASSERT_EQUALS(boost::lexical_cast<int>(value["Prop2"].asString()), 456);
+  }
+
+  void test_asStringWithArrayProperty() {
+    PropertyManagerHelper mgr;
+    TS_ASSERT_THROWS_NOTHING(
+        mgr.declareProperty(new ArrayProperty<double>("ArrayProp")));
+
+    ::Json::Reader reader;
+    ::Json::Value value;
+
+    /// TSM_ASSERT_EQUALS("Empty string when all are default", mgr.asString(),
+    /// "");
+    TSM_ASSERT("value was not valid JSON", reader.parse(mgr.asString(), value));
+
+    TSM_ASSERT_EQUALS("value was not empty", value.size(), 0);
+
+    TSM_ASSERT_EQUALS("Show the default", mgr.asString(true),
+                      "{\"ArrayProp\":\"\"}\n");
+
+    TSM_ASSERT("value was not valid JSON",
+               reader.parse(mgr.asString(true), value));
+
+    mgr.setProperty("ArrayProp", "10,12,23");
+
+    TSM_ASSERT_EQUALS("Change the values", mgr.asString(false),
+                      "{\"ArrayProp\":\"10,12,23\"}\n");
+
+    TSM_ASSERT("value was not valid JSON",
+               reader.parse(mgr.asString(false), value));
   }
 
   //-----------------------------------------------------------------------------------------------------------
diff --git a/Framework/LiveData/src/LiveDataAlgorithm.cpp b/Framework/LiveData/src/LiveDataAlgorithm.cpp
index 78681604e634561f526cce65e7aaed6268dc98f5..5a3390e0770d772d468476abed15da338b80dd4a 100644
--- a/Framework/LiveData/src/LiveDataAlgorithm.cpp
+++ b/Framework/LiveData/src/LiveDataAlgorithm.cpp
@@ -246,38 +246,13 @@ IAlgorithm_sptr LiveDataAlgorithm::makeAlgorithm(bool postProcessing) {
     // Create the UNMANAGED algorithm
     IAlgorithm_sptr alg = this->createChildAlgorithm(algoName);
 
+    // Skip some of the properties when setting
+    std::set<std::string> ignoreProps;
+    ignoreProps.insert("InputWorkspace");
+    ignoreProps.insert("OutputWorkspace");
+
     // ...and pass it the properties
-    boost::char_separator<char> sep(";");
-    typedef boost::tokenizer<boost::char_separator<char>> tokenizer;
-    tokenizer propPairs(props, sep);
-    // Iterate over the properties
-    for (tokenizer::iterator it = propPairs.begin(); it != propPairs.end();
-         ++it) {
-      // Pair of the type "
-      std::string pair = *it;
-
-      size_t n = pair.find('=');
-      if (n == std::string::npos) {
-        // Do nothing
-      } else {
-        // Normal "PropertyName=value" string.
-        std::string propName = "";
-        std::string value = "";
-
-        // Extract the value string
-        if (n < pair.size() - 1) {
-          propName = pair.substr(0, n);
-          value = pair.substr(n + 1, pair.size() - n - 1);
-        } else {
-          // String is "PropertyName="
-          propName = pair.substr(0, n);
-          value = "";
-        }
-        // Skip some of the properties when setting
-        if ((propName != "InputWorkspace") && (propName != "OutputWorkspace"))
-          alg->setPropertyValue(propName, value);
-      }
-    }
+    alg->setPropertiesWithSimpleString(props, ignoreProps);
 
     // Warn if someone put both values.
     if (!script.empty())
diff --git a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/BinMD.h b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/BinMD.h
index ed2e93e86f6df44b944712e16bc52da10a357635..5f5f689d448f7464043aed2feab6132c232dc0bb 100644
--- a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/BinMD.h
+++ b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/BinMD.h
@@ -46,7 +46,7 @@ public:
   /// Algorithm's version for identification
   virtual int version() const { return 1; }
   /// Algorithm's category for identification
-  virtual const std::string category() const { return "MDAlgorithms"; }
+  virtual const std::string category() const { return "MDAlgorithms\\Slicing"; }
 
 private:
   /// Initialise the properties
diff --git a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/CentroidPeaksMD.h b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/CentroidPeaksMD.h
index 1ef651492930db3e3ea33af552dedab1cc47df86..8c944647ffcd4ce1d8bcfa49fb0f7f887e873c87 100644
--- a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/CentroidPeaksMD.h
+++ b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/CentroidPeaksMD.h
@@ -32,7 +32,7 @@ public:
   /// Algorithm's version for identification
   virtual int version() const { return 1; };
   /// Algorithm's category for identification
-  virtual const std::string category() const { return "MDAlgorithms"; }
+  virtual const std::string category() const { return "MDAlgorithms\\Peaks"; }
 
 private:
   /// Initialise the properties
diff --git a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/CentroidPeaksMD2.h b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/CentroidPeaksMD2.h
index dd873e6ff1a15a3b5550784624fb5f9915a2dd24..4606989eebba2193d6e8f58fae9b457ba0ce0419 100644
--- a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/CentroidPeaksMD2.h
+++ b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/CentroidPeaksMD2.h
@@ -32,7 +32,7 @@ public:
   /// Algorithm's version for identification
   virtual int version() const { return 2; };
   /// Algorithm's category for identification
-  virtual const std::string category() const { return "MDAlgorithms"; }
+  virtual const std::string category() const { return "MDAlgorithms\\Peaks"; }
 
 private:
   /// Initialise the properties
diff --git a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/CloneMDWorkspace.h b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/CloneMDWorkspace.h
index 07a7a5718ecc390e85ab12b113918793180e9130..66abd2ea535da7ce54d8eb031df24266e54520d7 100644
--- a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/CloneMDWorkspace.h
+++ b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/CloneMDWorkspace.h
@@ -51,7 +51,9 @@ public:
   /// Algorithm's version for identification
   virtual int version() const { return 1; };
   /// Algorithm's category for identification
-  virtual const std::string category() const { return "MDAlgorithms"; }
+  virtual const std::string category() const {
+    return "MDAlgorithms\\Utility\\Workspaces;MDAlgorithms\\Creation";
+  }
 
 private:
   /// Initialise the properties
diff --git a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/CompactMD.h b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/CompactMD.h
index c206f73b5409e0178a836f0d32a3a30d67014c16..7d4e012d680d141bc711d8ff7e6999f59a2c08f2 100644
--- a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/CompactMD.h
+++ b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/CompactMD.h
@@ -50,7 +50,9 @@ public:
     return "Crops an MDHistoWorkspace based on the first non-zero signals "
            "giving a more focussed area of interest.";
   }
-  const std::string category() const { return "MDAlgorithms"; }
+  const std::string category() const {
+    return "MDAlgorithms\\Utility\\Workspaces";
+  }
   /// Algorithm's version for identification
   int version() const { return 1; }
   /// Finding the extents of the first non-zero signals.
diff --git a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/ConvertCWPDMDToSpectra.h b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/ConvertCWPDMDToSpectra.h
index 5dd6f15313415e93cf605093baa1bce5e52f764e..6430e8e7c947247a942c5b9c26334c2e214f4050 100644
--- a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/ConvertCWPDMDToSpectra.h
+++ b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/ConvertCWPDMDToSpectra.h
@@ -121,7 +121,7 @@ public:
 
   /// Algorithm's category for identification
   virtual const std::string category() const {
-    return "Diffraction;MDAlgorithms";
+    return "Diffraction\\ConstantWavelength;Diffraction\\Focussing";
   }
 
 private:
diff --git a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/ConvertCWSDExpToMomentum.h b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/ConvertCWSDExpToMomentum.h
index e4b799f2f49c6336b4ed4165e64c870d5e219a6d..b0d6b716db12c503e974a07b3dd7372b8628d6bd 100644
--- a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/ConvertCWSDExpToMomentum.h
+++ b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/ConvertCWSDExpToMomentum.h
@@ -52,7 +52,7 @@ public:
 
   /// Algorithm's category for identification
   virtual const std::string category() const {
-    return "Diffraction;DataHandling\\Text";
+    return "Diffraction\\ConstantWavelength;DataHandling\\Text";
   }
 
 private:
diff --git a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/ConvertCWSDMDtoHKL.h b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/ConvertCWSDMDtoHKL.h
index 6879be0456ee797b4df6442510d5ad6894024197..48c69d268c0d4cb0c8f3fe6d6666aa67f6bf8cae 100644
--- a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/ConvertCWSDMDtoHKL.h
+++ b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/ConvertCWSDMDtoHKL.h
@@ -55,7 +55,7 @@ public:
 
   /// Algorithm's category for identification
   virtual const std::string category() const {
-    return "Diffraction;MDAlgorithms";
+    return "Diffraction\\ConstantWavelength";
   }
 
 private:
diff --git a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/ConvertMDHistoToMatrixWorkspace.h b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/ConvertMDHistoToMatrixWorkspace.h
index 216d3ceba2b0fabad44a20fdf91b25565ba260eb..0cb01568ece3360521787aefd8aef39a800656f0 100644
--- a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/ConvertMDHistoToMatrixWorkspace.h
+++ b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/ConvertMDHistoToMatrixWorkspace.h
@@ -67,7 +67,9 @@ public:
   /// Algorithm's version
   virtual int version() const { return (1); }
   /// Algorithm's category for identification
-  virtual const std::string category() const { return "Utility\\Workspaces"; }
+  virtual const std::string category() const {
+    return "Utility\\Workspaces;MDAlgorithms\\Transforms";
+  }
 
 private:
   /// Initialisation code
diff --git a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/ConvertSpiceDataToRealSpace.h b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/ConvertSpiceDataToRealSpace.h
index 833c7e3bb54dc7bf07d99edf5be6a77378c97c2f..39f4794955e691a5c75df3cc3d94e072ba80a3c1 100644
--- a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/ConvertSpiceDataToRealSpace.h
+++ b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/ConvertSpiceDataToRealSpace.h
@@ -54,7 +54,7 @@ public:
 
   /// Algorithm's category for identification
   virtual const std::string category() const {
-    return "Diffraction;DataHandling\\Text";
+    return "Diffraction\\ConstantWavelength;DataHandling\\Text";
   }
 
   /// Returns a confidence value that this algorithm can load a file
diff --git a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/ConvertToDiffractionMDWorkspace.h b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/ConvertToDiffractionMDWorkspace.h
index 52788ff64c84f8382c9e9d851ae317814b1583e7..2c2775f5a844ef32ac722d66e082a5b93e987c5e 100644
--- a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/ConvertToDiffractionMDWorkspace.h
+++ b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/ConvertToDiffractionMDWorkspace.h
@@ -37,7 +37,9 @@ public:
   /// Algorithm's version for identification
   virtual int version() const { return 1; }
   /// Algorithm's category for identification
-  virtual const std::string category() const { return "MDAlgorithms"; }
+  virtual const std::string category() const {
+    return "MDAlgorithms\\Creation";
+  }
 
 private:
   void init();
diff --git a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/ConvertToDiffractionMDWorkspace2.h b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/ConvertToDiffractionMDWorkspace2.h
index 48a2e95d9e3e8536e76fbbde9e9a4457356f0bf5..b083d953bab6845f43ada834aac4dc6f83cd0d92 100644
--- a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/ConvertToDiffractionMDWorkspace2.h
+++ b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/ConvertToDiffractionMDWorkspace2.h
@@ -37,7 +37,9 @@ public:
   /// Algorithm's version for identification
   virtual int version() const { return 2; }
   /// Algorithm's category for identification
-  virtual const std::string category() const { return "MDAlgorithms"; }
+  virtual const std::string category() const {
+    return "MDAlgorithms\\Creation";
+  }
 
 private:
   void init();
diff --git a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/CreateMDWorkspace.h b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/CreateMDWorkspace.h
index 3dcd52e01b27fac63a3d43230a47e6285e54c4aa..9630aeb7949d0001bd481a1a5bf21ce6d88c8698 100644
--- a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/CreateMDWorkspace.h
+++ b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/CreateMDWorkspace.h
@@ -36,7 +36,9 @@ public:
   /// Algorithm's version for identification
   virtual int version() const { return 1; }
   /// Algorithm's category for identification
-  virtual const std::string category() const { return "MDAlgorithms"; }
+  virtual const std::string category() const {
+    return "MDAlgorithms\\Creation";
+  }
   virtual std::map<std::string, std::string> validateInputs();
 
 private:
diff --git a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/CutMD.h b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/CutMD.h
index 6dd0dce66df7f2d8d4c215726040b6640b9d56af..60ac039be31272f3951c3cd6b59ef41e419b2936 100644
--- a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/CutMD.h
+++ b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/CutMD.h
@@ -44,7 +44,7 @@ public:
     return "Slices multidimensional workspaces using input projection "
            "information and binning limits.";
   }
-  virtual const std::string category() const { return "MDAlgorithms"; }
+  virtual const std::string category() const { return "MDAlgorithms\\Slicing"; }
 
   virtual void init();
   virtual void exec();
diff --git a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/FakeMDEventData.h b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/FakeMDEventData.h
index 0150766cbb4d33a5b237a6002f03df85cd7f4f2a..76e4dd1bf8c483ca903b7ae107be9999f6b4d578 100644
--- a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/FakeMDEventData.h
+++ b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/FakeMDEventData.h
@@ -45,7 +45,9 @@ public:
   /// Algorithm's verion for identification
   virtual int version() const { return 1; }
   /// Algorithm's category for identification
-  virtual const std::string category() const { return "MDAlgorithms"; }
+  virtual const std::string category() const {
+    return "MDAlgorithms\\Creation";
+  }
 
 private:
   /// Initialise the properties
diff --git a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/FindPeaksMD.h b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/FindPeaksMD.h
index fbfdfd958bb86bda2cc11bc1dcbc3b2a393ea92d..625fc0f2818ce3968f5bcf2a8c67b8e932ef68d3 100644
--- a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/FindPeaksMD.h
+++ b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/FindPeaksMD.h
@@ -37,7 +37,7 @@ public:
   virtual int version() const { return 1; };
   /// Algorithm's category for identification
   virtual const std::string category() const {
-    return "Optimization\\PeakFinding;MDAlgorithms";
+    return "Optimization\\PeakFinding;MDAlgorithms\\Peaks";
   }
 
 private:
diff --git a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/GetSpiceDataRawCountsFromMD.h b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/GetSpiceDataRawCountsFromMD.h
index a922463147d8dad1ef4beff20c9075fed556af2a..f574cf824ad62504780768ddde1e291fd20b1d3d 100644
--- a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/GetSpiceDataRawCountsFromMD.h
+++ b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/GetSpiceDataRawCountsFromMD.h
@@ -58,7 +58,7 @@ public:
 
   /// Algorithm's category for identification
   virtual const std::string category() const {
-    return "Diffraction;DataHandling";
+    return "Diffraction\\ConstantWavelength";
   }
 
 private:
diff --git a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/IntegratePeaksMD.h b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/IntegratePeaksMD.h
index 507922aa79e954703f5e3f435a7aefe472831453..bf6cc39564284fe9e499743c787fd5360e059859 100644
--- a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/IntegratePeaksMD.h
+++ b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/IntegratePeaksMD.h
@@ -32,7 +32,7 @@ public:
   /// Algorithm's version for identification
   virtual int version() const { return 1; };
   /// Algorithm's category for identification
-  virtual const std::string category() const { return "MDAlgorithms"; }
+  virtual const std::string category() const { return "MDAlgorithms\\Peaks"; }
 
 private:
   /// Initialise the properties
diff --git a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/IntegratePeaksMD2.h b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/IntegratePeaksMD2.h
index b334b46b5b5374674276c120a0f95d29d69285a4..b6f76f649f143f01aa015ec9d33120158089bcac 100644
--- a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/IntegratePeaksMD2.h
+++ b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/IntegratePeaksMD2.h
@@ -32,7 +32,7 @@ public:
   /// Algorithm's version for identification
   virtual int version() const { return 2; };
   /// Algorithm's category for identification
-  virtual const std::string category() const { return "MDAlgorithms"; }
+  virtual const std::string category() const { return "MDAlgorithms\\Peaks"; }
 
 private:
   /// Initialise the properties
diff --git a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/LoadMD.h b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/LoadMD.h
index d6dd8e0dc78659792f710951bed32aaf7402d3e0..2d696925f79d13e41f66ce9450bac5dae76264fb 100644
--- a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/LoadMD.h
+++ b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/LoadMD.h
@@ -1,6 +1,7 @@
 #ifndef MANTID_MDALGORITHMS_LOADMD_H_
 #define MANTID_MDALGORITHMS_LOADMD_H_
 
+#include "MantidAPI/DataProcessorAlgorithm.h"
 #include "MantidAPI/IFileLoader.h"
 #include "MantidAPI/IMDEventWorkspace_fwd.h"
 #include "MantidKernel/System.h"
@@ -52,7 +53,9 @@ public:
   /// Algorithm's version for identification
   virtual int version() const { return 1; };
   /// Algorithm's category for identification
-  virtual const std::string category() const { return "MDAlgorithms"; }
+  virtual const std::string category() const {
+    return "MDAlgorithms\\DataHandling";
+  }
 
   /// Returns a confidence value that this algorithm can load a file
   int confidence(Kernel::NexusDescriptor &descriptor) const;
@@ -90,6 +93,12 @@ private:
   /// Load a given affine matrix
   API::CoordTransform *loadAffineMatrix(std::string entry_name);
 
+  /// Sets MDFrames for workspaces from legacy files
+  void setMDFrameOnWorkspaceFromLegacyFile(API::IMDWorkspace_sptr ws);
+
+  /// Checks if a worspace is a certain type of legacy file
+  void checkForRequiredLegacyFixup(API::IMDWorkspace_sptr ws);
+
   /// Open file handle
   // clang-format off
   boost::scoped_ptr< ::NeXus::File> m_file;
@@ -118,6 +127,9 @@ private:
   /// Named entry
   static const std::string VISUAL_NORMALIZATION_KEY;
   static const std::string VISUAL_NORMALIZATION_KEY_HISTO;
+
+  /// MDFrame correction flag
+  bool m_requiresMDFrameCorrection;
 };
 
 } // namespace DataObjects
diff --git a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/LoadSQW.h b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/LoadSQW.h
index 50ac21f27cf7b1cb6e3372ad15012b0937e52498..f7c50571aebc4ae626e81926c3c849651389828f 100644
--- a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/LoadSQW.h
+++ b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/LoadSQW.h
@@ -97,7 +97,7 @@ public:
   virtual int version() const { return 1; };
   /// Algorithm's category for identification
   virtual const std::string category() const {
-    return "DataHandling;MDAlgorithms";
+    return "DataHandling\\SQW;MDAlgorithms\\DataHandling";
   }
 
   /// Returns a confidence value that this algorithm can load a file
diff --git a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/MergeMDFiles.h b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/MergeMDFiles.h
index 9eec45e81adf0945eae1bb9b5d71c3be5ef63793..8503db7f48275d284fc20264fcb72f53f09a1da1 100644
--- a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/MergeMDFiles.h
+++ b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/MergeMDFiles.h
@@ -54,7 +54,9 @@ public:
   /// Algorithm's version for identification
   virtual int version() const { return 1; };
   /// Algorithm's category for identification
-  virtual const std::string category() const { return "MDAlgorithms"; }
+  virtual const std::string category() const {
+    return "MDAlgorithms\\Creation";
+  }
 
 private:
   /// Initialise the properties
diff --git a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/OneStepMDEW.h b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/OneStepMDEW.h
index 4916397e4ac91d387fc4197f7f804e192b052f84..6d693f31a1a8b58c8f497f23bb2189d3a7b80770 100644
--- a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/OneStepMDEW.h
+++ b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/OneStepMDEW.h
@@ -29,7 +29,9 @@ public:
   /// Algorithm's version for identification
   virtual int version() const { return 1; };
   /// Algorithm's category for identification
-  virtual const std::string category() const { return "MDAlgorithms"; }
+  virtual const std::string category() const {
+    return "MDAlgorithms\\Creation";
+  }
 
 private:
   /// Initialise the properties
diff --git a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/PreprocessDetectorsToMD.h b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/PreprocessDetectorsToMD.h
index f139433836d5c9fe001ec8fae65aff65db29325b..5ce5f2d7eaa4c50cd76ef2faa42853dc677ccb0b 100644
--- a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/PreprocessDetectorsToMD.h
+++ b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/PreprocessDetectorsToMD.h
@@ -57,7 +57,7 @@ public:
   /// Algorithm's version for identification
   virtual int version() const { return 1; };
   /// Algorithm's category for identification
-  virtual const std::string category() const { return "MDAlgorithms"; }
+  virtual const std::string category() const { return "MDAlgorithms\\Utility"; }
 
 private:
   void init();
diff --git a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/QueryMDWorkspace.h b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/QueryMDWorkspace.h
index 72a250732d4b63fec260fefe6498fa1db63c95d0..e2c17d9968e721617452c34b12b985b410eb05c0 100644
--- a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/QueryMDWorkspace.h
+++ b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/QueryMDWorkspace.h
@@ -49,7 +49,9 @@ public:
   /// Algorithm's version for identification
   virtual int version() const { return 1; }
   /// Algorithm's category for identification
-  virtual const std::string category() const { return "MDAlgorithms"; }
+  virtual const std::string category() const {
+    return "MDAlgorithms\\Utility\\Workspace";
+  }
 
 private:
   /// Initialise the properties
diff --git a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/SaveMD.h b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/SaveMD.h
index dbc944730f4ec1c17e825ff2f70c93ae4e5bc38d..43629ef6733f1d44455e45936a00e25c3847d9ca 100644
--- a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/SaveMD.h
+++ b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/SaveMD.h
@@ -50,7 +50,9 @@ public:
   /// Algorithm's version for identification
   virtual int version() const { return 1; };
   /// Algorithm's category for identification
-  virtual const std::string category() const { return "MDAlgorithms"; }
+  virtual const std::string category() const {
+    return "MDAlgorithms\\DataHandling";
+  }
 
 private:
   /// Initialise the properties
diff --git a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/SaveMD2.h b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/SaveMD2.h
index 0fd80df7ae7df51a4f1dc9cc302525a587f2cf00..7772ec122d3732817ee87c9a2096ee9186f9fa1b 100644
--- a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/SaveMD2.h
+++ b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/SaveMD2.h
@@ -47,7 +47,9 @@ public:
   /// Algorithm's version for identification
   virtual int version() const { return 2; };
   /// Algorithm's category for identification
-  virtual const std::string category() const { return "MDAlgorithms"; }
+  virtual const std::string category() const {
+    return "MDAlgorithms\\DataHandling";
+  }
 
 private:
   /// Initialise the properties
diff --git a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/SliceMD.h b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/SliceMD.h
index d7683aa70935f7d813ce636a82424668fc8adc4b..2d61d9980acbd18fcf6d4d45b1fb3f5934d36efb 100644
--- a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/SliceMD.h
+++ b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/SliceMD.h
@@ -61,7 +61,7 @@ public:
   /// Algorithm's version for identification
   virtual int version() const { return 1; };
   /// Algorithm's category for identification
-  virtual const std::string category() const { return "MDAlgorithms"; }
+  virtual const std::string category() const { return "MDAlgorithms\\Slicing"; }
 
 private:
   /// Initialise the properties
diff --git a/Framework/MDAlgorithms/src/CalculateCoverageDGS.cpp b/Framework/MDAlgorithms/src/CalculateCoverageDGS.cpp
index d9e2a957b1f7411b3848390a8cbe22415ea1609b..314e164716b3e9d5fe7bb3da0486358ab3b8567f 100644
--- a/Framework/MDAlgorithms/src/CalculateCoverageDGS.cpp
+++ b/Framework/MDAlgorithms/src/CalculateCoverageDGS.cpp
@@ -56,7 +56,7 @@ int CalculateCoverageDGS::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string CalculateCoverageDGS::category() const {
-  return "Inelastic;MDAlgorithms";
+  return "Inelastic\\Planning;MDAlgorithms\\Planning";
 }
 
 /// Algorithm's summary for use in the GUI and help. @see Algorithm::summary
diff --git a/Framework/MDAlgorithms/src/CompareMDWorkspaces.cpp b/Framework/MDAlgorithms/src/CompareMDWorkspaces.cpp
index 885057c6e2cd683dc266badf2e8146e45822dfa9..acd3bc4ae877e458aace3c3fbaa8d12ba7901b0f 100644
--- a/Framework/MDAlgorithms/src/CompareMDWorkspaces.cpp
+++ b/Framework/MDAlgorithms/src/CompareMDWorkspaces.cpp
@@ -52,7 +52,7 @@ int CompareMDWorkspaces::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string CompareMDWorkspaces::category() const {
-  return "MDAlgorithms";
+  return "MDAlgorithms\\Utility\\Workspaces";
 }
 
 //----------------------------------------------------------------------------------------------
diff --git a/Framework/MDAlgorithms/src/ConvertToDetectorFaceMD.cpp b/Framework/MDAlgorithms/src/ConvertToDetectorFaceMD.cpp
index 7855923d98510626d9f51c444f684ec89c607906..3ffdd16bbc28c2db18b8f58446503298ec17ff77 100644
--- a/Framework/MDAlgorithms/src/ConvertToDetectorFaceMD.cpp
+++ b/Framework/MDAlgorithms/src/ConvertToDetectorFaceMD.cpp
@@ -45,7 +45,7 @@ int ConvertToDetectorFaceMD::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string ConvertToDetectorFaceMD::category() const {
-  return "MDAlgorithms";
+  return "MDAlgorithms\\Creation";
 }
 
 //----------------------------------------------------------------------------------------------
diff --git a/Framework/MDAlgorithms/src/ConvertToMDMinMaxGlobal.cpp b/Framework/MDAlgorithms/src/ConvertToMDMinMaxGlobal.cpp
index c344b7c1b0bdd0b7bfb65af1b7cc759baea6c074..b664e1346cfec9abe667a210103b79111bf0ddae 100644
--- a/Framework/MDAlgorithms/src/ConvertToMDMinMaxGlobal.cpp
+++ b/Framework/MDAlgorithms/src/ConvertToMDMinMaxGlobal.cpp
@@ -45,7 +45,7 @@ int ConvertToMDMinMaxGlobal::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string ConvertToMDMinMaxGlobal::category() const {
-  return "MDAlgorithms";
+  return "MDAlgorithms\\Creation";
 }
 
 //----------------------------------------------------------------------------------------------
diff --git a/Framework/MDAlgorithms/src/ConvertToMDParent.cpp b/Framework/MDAlgorithms/src/ConvertToMDParent.cpp
index 2c19786b0a51263b0022ff4bc0b347ebabbed181..26fa03786e3805d1615d83f0e9bfcff890040b19 100644
--- a/Framework/MDAlgorithms/src/ConvertToMDParent.cpp
+++ b/Framework/MDAlgorithms/src/ConvertToMDParent.cpp
@@ -20,7 +20,9 @@ namespace Mantid {
 namespace MDAlgorithms {
 
 /// Algorithm's category for identification. @see Algorithm::category
-const std::string ConvertToMDParent::category() const { return "MDAlgorithms"; }
+const std::string ConvertToMDParent::category() const {
+  return "MDAlgorithms\\Creation";
+}
 
 //----------------------------------------------------------------------------------------------
 /** Initialize the algorithm's properties.
diff --git a/Framework/MDAlgorithms/src/CreateMDHistoWorkspace.cpp b/Framework/MDAlgorithms/src/CreateMDHistoWorkspace.cpp
index 7d4a8d113dfa0bd75e286ce6aeedebf19212a740..f086af039aef6c611d3a6e9aa89066d073b28140 100644
--- a/Framework/MDAlgorithms/src/CreateMDHistoWorkspace.cpp
+++ b/Framework/MDAlgorithms/src/CreateMDHistoWorkspace.cpp
@@ -42,7 +42,7 @@ int CreateMDHistoWorkspace::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string CreateMDHistoWorkspace::category() const {
-  return "MDAlgorithms";
+  return "MDAlgorithms\\Creation";
 }
 
 //----------------------------------------------------------------------------------------------
diff --git a/Framework/MDAlgorithms/src/EvaluateMDFunction.cpp b/Framework/MDAlgorithms/src/EvaluateMDFunction.cpp
index 467947c1d4426333f19786cfc8acddc40382636b..22266e25e0ea179c5ce4483aa0827dbabe009a2b 100644
--- a/Framework/MDAlgorithms/src/EvaluateMDFunction.cpp
+++ b/Framework/MDAlgorithms/src/EvaluateMDFunction.cpp
@@ -32,7 +32,7 @@ int EvaluateMDFunction::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string EvaluateMDFunction::category() const {
-  return "MDAlgorithms";
+  return "MDAlgorithms\\Creation";
 }
 
 /// Algorithm's summary for use in the GUI and help. @see Algorithm::summary
diff --git a/Framework/MDAlgorithms/src/ImportMDEventWorkspace.cpp b/Framework/MDAlgorithms/src/ImportMDEventWorkspace.cpp
index be346034e853bc84f9d5f876de9920c646de6713..7c0bd18db53bbf0dce03dde8fd69866cab553fac 100644
--- a/Framework/MDAlgorithms/src/ImportMDEventWorkspace.cpp
+++ b/Framework/MDAlgorithms/src/ImportMDEventWorkspace.cpp
@@ -93,7 +93,7 @@ int ImportMDEventWorkspace::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string ImportMDEventWorkspace::category() const {
-  return "MDAlgorithms";
+  return "MDAlgorithms\\DataHandling";
 }
 
 //----------------------------------------------------------------------------------------------
diff --git a/Framework/MDAlgorithms/src/ImportMDHistoWorkspace.cpp b/Framework/MDAlgorithms/src/ImportMDHistoWorkspace.cpp
index 86c15fc3b05b07f906ef23c84d4676e85ce1f41a..acc17b1befc756ab028defd5f402deb66851dc0f 100644
--- a/Framework/MDAlgorithms/src/ImportMDHistoWorkspace.cpp
+++ b/Framework/MDAlgorithms/src/ImportMDHistoWorkspace.cpp
@@ -38,7 +38,7 @@ int ImportMDHistoWorkspace::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string ImportMDHistoWorkspace::category() const {
-  return "MDAlgorithms";
+  return "MDAlgorithms\\DataHandling";
 }
 
 //----------------------------------------------------------------------------------------------
diff --git a/Framework/MDAlgorithms/src/IntegrateEllipsoids.cpp b/Framework/MDAlgorithms/src/IntegrateEllipsoids.cpp
index ca721437fce6cc96906887af9a14d2ff4436022c..13d8f8313c4f7e03e5c725674da63a3a0312dbdd 100644
--- a/Framework/MDAlgorithms/src/IntegrateEllipsoids.cpp
+++ b/Framework/MDAlgorithms/src/IntegrateEllipsoids.cpp
@@ -215,7 +215,9 @@ const std::string IntegrateEllipsoids::name() const {
 int IntegrateEllipsoids::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
-const std::string IntegrateEllipsoids::category() const { return "Crystal"; }
+const std::string IntegrateEllipsoids::category() const {
+  return "Crystal\\Integration";
+}
 
 //---------------------------------------------------------------------
 
diff --git a/Framework/MDAlgorithms/src/IntegrateFlux.cpp b/Framework/MDAlgorithms/src/IntegrateFlux.cpp
index 74c40ac2a60165979c145c3c218ecfd38bea09c9..056c90c3be403f57e9b7daef9022864cc43675f4 100644
--- a/Framework/MDAlgorithms/src/IntegrateFlux.cpp
+++ b/Framework/MDAlgorithms/src/IntegrateFlux.cpp
@@ -35,7 +35,9 @@ const std::string IntegrateFlux::name() const { return "IntegrateFlux"; }
 int IntegrateFlux::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
-const std::string IntegrateFlux::category() const { return "MDAlgorithms"; }
+const std::string IntegrateFlux::category() const {
+  return "MDAlgorithms\\Normalisation";
+}
 
 /// Algorithm's summary for use in the GUI and help. @see Algorithm::summary
 const std::string IntegrateFlux::summary() const {
diff --git a/Framework/MDAlgorithms/src/IntegrateMDHistoWorkspace.cpp b/Framework/MDAlgorithms/src/IntegrateMDHistoWorkspace.cpp
index ee80f5f9e527c13dde9b8612a768c4c3cde20b58..fa498c084ac26c7b253daabc8a75da3d0abfefc9 100644
--- a/Framework/MDAlgorithms/src/IntegrateMDHistoWorkspace.cpp
+++ b/Framework/MDAlgorithms/src/IntegrateMDHistoWorkspace.cpp
@@ -261,7 +261,7 @@ int IntegrateMDHistoWorkspace::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string IntegrateMDHistoWorkspace::category() const {
-  return "MDAlgorithms";
+  return "MDAlgorithms\\Slicing";
 }
 
 /// Algorithm's summary for use in the GUI and help. @see Algorithm::summary
diff --git a/Framework/MDAlgorithms/src/LoadILLAscii.cpp b/Framework/MDAlgorithms/src/LoadILLAscii.cpp
index 86aaa741729dfb73a32c08a17dbdd53ef4908b40..13ba3b30b3a65da40ca99db6b8e88d4b9cef4b0b 100644
--- a/Framework/MDAlgorithms/src/LoadILLAscii.cpp
+++ b/Framework/MDAlgorithms/src/LoadILLAscii.cpp
@@ -88,7 +88,7 @@ int LoadILLAscii::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string LoadILLAscii::category() const {
-  return "MDAlgorithms\\Text";
+  return "MDAlgorithms\\DataHandling";
 }
 
 //----------------------------------------------------------------------------------------------
diff --git a/Framework/MDAlgorithms/src/LoadMD.cpp b/Framework/MDAlgorithms/src/LoadMD.cpp
index c2f6e181f3aaed8ec4bb34c2ac8804a2d5ae1671..47e35bf338cd6e21467e61e9b4a19785126f8761 100644
--- a/Framework/MDAlgorithms/src/LoadMD.cpp
+++ b/Framework/MDAlgorithms/src/LoadMD.cpp
@@ -16,6 +16,7 @@
 #include "MantidKernel/PropertyWithValue.h"
 #include "MantidKernel/System.h"
 #include "MantidMDAlgorithms/LoadMD.h"
+#include "MantidMDAlgorithms/SetMDFrame.h"
 #include "MantidDataObjects/MDEventFactory.h"
 #include "MantidDataObjects/MDBoxFlatTree.h"
 #include "MantidDataObjects/MDHistoWorkspace.h"
@@ -48,7 +49,7 @@ LoadMD::LoadMD()
     : m_numDims(0), // uninitialized incorrect value
       m_coordSystem(None),
       m_BoxStructureAndMethadata(true), // this is faster but rarely needed.
-      m_saveMDVersion(false) {}
+      m_saveMDVersion(false), m_requiresMDFrameCorrection(false) {}
 
 //----------------------------------------------------------------------------------------------
 /** Destructor
@@ -223,6 +224,11 @@ void LoadMD::exec() {
     // Wrapper to cast to MDEventWorkspace then call the function
     CALL_MDEVENT_FUNCTION(this->doLoad, ws);
 
+    // Check if a MDFrame adjustment is required
+    checkForRequiredLegacyFixup(ws);
+    if (m_requiresMDFrameCorrection) {
+      setMDFrameOnWorkspaceFromLegacyFile(ws);
+    }
     // Save to output
     setProperty("OutputWorkspace",
                 boost::dynamic_pointer_cast<IMDWorkspace>(ws));
@@ -305,6 +311,12 @@ void LoadMD::loadHisto() {
 
   m_file->close();
 
+  // Check if a MDFrame adjustment is required
+  checkForRequiredLegacyFixup(ws);
+  if (m_requiresMDFrameCorrection) {
+    setMDFrameOnWorkspaceFromLegacyFile(ws);
+  }
+
   // Save to output
   setProperty("OutputWorkspace", boost::dynamic_pointer_cast<IMDWorkspace>(ws));
 }
@@ -323,6 +335,9 @@ void LoadMD::loadDimensions() {
     // Use the dimension factory to read the XML
     m_dims.push_back(createDimension(dimXML));
   }
+  // Since this is an old algorithm we will
+  // have to provide an MDFrame correction
+  m_requiresMDFrameCorrection = true;
 }
 
 //----------------------------------------------------------------------------------------------
@@ -355,6 +370,7 @@ void LoadMD::loadDimensions2() {
       m_file->getAttr("frame", frame);
     } catch (std::exception &) {
       frame = Mantid::Geometry::UnknownFrame::UnknownFrameName;
+      m_requiresMDFrameCorrection = true;
     }
     Geometry::MDFrame_const_uptr mdFrame =
         Geometry::makeMDFrameFactoryChain()->create(
@@ -602,6 +618,108 @@ CoordTransform *LoadMD::loadAffineMatrix(std::string entry_name) {
   return transform;
 }
 
+/**
+ * Set MDFrames for workspaces from legacy files
+ * @param ws:: poitner to the workspace which needs to be corrected
+ */
+void LoadMD::setMDFrameOnWorkspaceFromLegacyFile(API::IMDWorkspace_sptr ws) {
+
+  g_log.information()
+      << "LoadMD: Encountered a legacy file which has a mismatch between "
+         "its MDFrames and its Special Coordinate System. "
+         "Attempting to convert MDFrames." << std::endl;
+  auto numberOfDimensions = ws->getNumDims();
+
+  // Select an MDFrame based on the special coordinates.
+  // Note that for None, we select a General Coordinate System,
+  // unless the name is "Unknown frame"
+  std::string selectedFrame;
+
+  switch (m_coordSystem) {
+  case Mantid::Kernel::QLab:
+    selectedFrame = Mantid::Geometry::QLab::QLabName;
+    break;
+  case Mantid::Kernel::QSample:
+    selectedFrame = Mantid::Geometry::QSample::QSampleName;
+    break;
+  case Mantid::Kernel::HKL:
+    selectedFrame = Mantid::Geometry::HKL::HKLName;
+    break;
+  default:
+    selectedFrame = Mantid::Geometry::GeneralFrame::GeneralFrameName;
+  }
+
+  // Get the old frames just in case something goes wrong. In this case we
+  // reset the frames.
+
+  std::vector<std::string> oldFrames(
+      numberOfDimensions, Mantid::Geometry::GeneralFrame::GeneralFrameName);
+  for (size_t index = 0; index < numberOfDimensions; ++index) {
+    oldFrames[index] = ws->getDimension(index)->getMDFrame().name();
+  }
+
+  // We want to set only up to the first three dimensions to the selected Frame;
+  // Everything else will be set to a General Frame
+  std::vector<std::string> framesToSet(
+      numberOfDimensions, Mantid::Geometry::GeneralFrame::GeneralFrameName);
+  auto fillUpTo = numberOfDimensions > 3 ? 3 : numberOfDimensions;
+  std::fill_n(framesToSet.begin(), fillUpTo, selectedFrame);
+
+  try {
+    // Set the MDFrames for each axes
+    Algorithm_sptr setMDFrameAlg = this->createChildAlgorithm("SetMDFrame");
+    int axesCounter = 0;
+    for (auto frame = framesToSet.begin(); frame != framesToSet.end();
+         ++frame) {
+      setMDFrameAlg->setProperty("InputWorkspace", ws);
+      setMDFrameAlg->setProperty("MDFrame", *frame);
+      setMDFrameAlg->setProperty("Axes", std::vector<int>(1, axesCounter));
+      ++axesCounter;
+      setMDFrameAlg->executeAsChildAlg();
+    }
+  } catch (...) {
+    g_log.warning() << "LoadMD: An issue occured while trying to correct "
+                       "MDFrames. Trying to revert to original." << std::endl;
+    // Revert to the old frames.
+    Algorithm_sptr setMDFrameAlg = this->createChildAlgorithm("SetMDFrame");
+    int axesCounter = 0;
+    for (auto frame = oldFrames.begin(); frame != oldFrames.end(); ++frame) {
+      setMDFrameAlg->setProperty("InputWorkspace", ws);
+      setMDFrameAlg->setProperty("MDFrame", *frame);
+      setMDFrameAlg->setProperty("Axes", std::vector<int>(1, axesCounter));
+      ++axesCounter;
+      setMDFrameAlg->executeAsChildAlg();
+    }
+  }
+}
+
+/**
+ * Check for required legacy fix up for certain file types. Namely the case
+ * where
+ * all MDFrames were stored as MDFrames
+ */
+void LoadMD::checkForRequiredLegacyFixup(API::IMDWorkspace_sptr ws) {
+  // Check if the special coordinate is not none
+  auto isQBasedSpecialCoordinateSystem = true;
+  if (m_coordSystem == Mantid::Kernel::SpecialCoordinateSystem::None) {
+    isQBasedSpecialCoordinateSystem = false;
+  }
+
+  // Check if all MDFrames are of type Unknown frame
+  auto containsOnlyUnkownFrames = true;
+  for (size_t index = 0; index < ws->getNumDims(); ++index) {
+    if (ws->getDimension(index)->getMDFrame().name() !=
+        Mantid::Geometry::UnknownFrame::UnknownFrameName) {
+      containsOnlyUnkownFrames = false;
+      break;
+    }
+  }
+
+  // Check if a fix up is required
+  if (isQBasedSpecialCoordinateSystem && containsOnlyUnkownFrames) {
+    m_requiresMDFrameCorrection = true;
+  }
+}
 const std::string LoadMD::VISUAL_NORMALIZATION_KEY = "visual_normalization";
 const std::string LoadMD::VISUAL_NORMALIZATION_KEY_HISTO =
     "visual_normalization_histo";
diff --git a/Framework/MDAlgorithms/src/MDNormDirectSC.cpp b/Framework/MDAlgorithms/src/MDNormDirectSC.cpp
index 20336f562b787a80af15e6326eef4524a1a21aca..efc710413ea131fd80af16c803aac3de848021df 100644
--- a/Framework/MDAlgorithms/src/MDNormDirectSC.cpp
+++ b/Framework/MDAlgorithms/src/MDNormDirectSC.cpp
@@ -45,7 +45,9 @@ MDNormDirectSC::MDNormDirectSC()
 int MDNormDirectSC::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
-const std::string MDNormDirectSC::category() const { return "MDAlgorithms"; }
+const std::string MDNormDirectSC::category() const {
+  return "MDAlgorithms\\Normalisation";
+}
 
 /// Algorithm's summary for use in the GUI and help. @see Algorithm::summary
 const std::string MDNormDirectSC::summary() const {
diff --git a/Framework/MDAlgorithms/src/MDNormSCD.cpp b/Framework/MDAlgorithms/src/MDNormSCD.cpp
index b5141d1c6261d84c96796d48326a0fe63c580c57..665807725fa4ce720c79046990b032f45b559e0e 100644
--- a/Framework/MDAlgorithms/src/MDNormSCD.cpp
+++ b/Framework/MDAlgorithms/src/MDNormSCD.cpp
@@ -45,7 +45,9 @@ MDNormSCD::MDNormSCD()
 int MDNormSCD::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
-const std::string MDNormSCD::category() const { return "MDAlgorithms"; }
+const std::string MDNormSCD::category() const {
+  return "MDAlgorithms\\Normalisation";
+}
 
 /// Algorithm's summary for use in the GUI and help. @see Algorithm::summary
 const std::string MDNormSCD::summary() const {
diff --git a/Framework/MDAlgorithms/src/MaskMD.cpp b/Framework/MDAlgorithms/src/MaskMD.cpp
index 875fe154397a909fd7fe849a8bb249d1355f37b2..019e3e10b7bad3144fcdd0b22d683fe73408b129 100644
--- a/Framework/MDAlgorithms/src/MaskMD.cpp
+++ b/Framework/MDAlgorithms/src/MaskMD.cpp
@@ -47,7 +47,9 @@ const std::string MaskMD::name() const { return "MaskMD"; }
 int MaskMD::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
-const std::string MaskMD::category() const { return "MDAlgorithms"; }
+const std::string MaskMD::category() const {
+  return "MDAlgorithms\\Transforms";
+}
 
 //----------------------------------------------------------------------------------------------
 
diff --git a/Framework/MDAlgorithms/src/MergeMD.cpp b/Framework/MDAlgorithms/src/MergeMD.cpp
index edd7d43cc1ca3434c1766f4cf62272e5ebb505a5..02eece157d4a05a07022c8eca5349f65235d2616 100644
--- a/Framework/MDAlgorithms/src/MergeMD.cpp
+++ b/Framework/MDAlgorithms/src/MergeMD.cpp
@@ -37,7 +37,7 @@ const std::string MergeMD::name() const { return "MergeMD"; }
 int MergeMD::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
-const std::string MergeMD::category() const { return "MDAlgorithms"; }
+const std::string MergeMD::category() const { return "MDAlgorithms\\Creation"; }
 
 //----------------------------------------------------------------------------------------------
 
diff --git a/Framework/MDAlgorithms/src/Quantification/FitResolutionConvolvedModel.cpp b/Framework/MDAlgorithms/src/Quantification/FitResolutionConvolvedModel.cpp
index 57d515f35d6dcf1e43fce528c31521d193503a1a..75cec1ac4cc6bf01da2d4bbd593d220a191e7c99 100644
--- a/Framework/MDAlgorithms/src/Quantification/FitResolutionConvolvedModel.cpp
+++ b/Framework/MDAlgorithms/src/Quantification/FitResolutionConvolvedModel.cpp
@@ -48,7 +48,7 @@ int FitResolutionConvolvedModel::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string FitResolutionConvolvedModel::category() const {
-  return "Quantification";
+  return "Inelastic\\Quantification";
 }
 
 //----------------------------------------------------------------------------------------------
diff --git a/Framework/MDAlgorithms/src/ReplicateMD.cpp b/Framework/MDAlgorithms/src/ReplicateMD.cpp
index f60b7c005638cc174503903508972036d78f8528..340f280f2be73d7d0c4505096f3067d8e57d3802 100644
--- a/Framework/MDAlgorithms/src/ReplicateMD.cpp
+++ b/Framework/MDAlgorithms/src/ReplicateMD.cpp
@@ -148,7 +148,9 @@ const std::string ReplicateMD::name() const { return "ReplicateMD"; }
 int ReplicateMD::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
-const std::string ReplicateMD::category() const { return "MDAlgorithms"; }
+const std::string ReplicateMD::category() const {
+  return "MDAlgorithms\\Creation";
+}
 
 /// Algorithm's summary for use in the GUI and help. @see Algorithm::summary
 const std::string ReplicateMD::summary() const {
diff --git a/Framework/MDAlgorithms/src/SaveZODS.cpp b/Framework/MDAlgorithms/src/SaveZODS.cpp
index 2abfa146132a8a38392c544e0e9d31ec69ca1de5..2570bfae893af1275d85de94cb2faa5897a438eb 100644
--- a/Framework/MDAlgorithms/src/SaveZODS.cpp
+++ b/Framework/MDAlgorithms/src/SaveZODS.cpp
@@ -34,7 +34,9 @@ const std::string SaveZODS::name() const { return "SaveZODS"; }
 int SaveZODS::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
-const std::string SaveZODS::category() const { return "MDAlgorithms"; }
+const std::string SaveZODS::category() const {
+  return "MDAlgorithms\\DataHandling";
+}
 
 //----------------------------------------------------------------------------------------------
 
diff --git a/Framework/MDAlgorithms/src/SmoothMD.cpp b/Framework/MDAlgorithms/src/SmoothMD.cpp
index bbeb4a205a28c709de9c5ba03121a4d2ff08599e..72243e086fd5a54ed67000d57740ccc6d2bf5ce2 100644
--- a/Framework/MDAlgorithms/src/SmoothMD.cpp
+++ b/Framework/MDAlgorithms/src/SmoothMD.cpp
@@ -93,7 +93,9 @@ const std::string SmoothMD::name() const { return "SmoothMD"; }
 int SmoothMD::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
-const std::string SmoothMD::category() const { return "MDAlgorithms"; }
+const std::string SmoothMD::category() const {
+  return "MDAlgorithms\\Transforms";
+}
 
 /// Algorithm's summary for use in the GUI and help. @see Algorithm::summary
 const std::string SmoothMD::summary() const {
diff --git a/Framework/MDAlgorithms/src/ThresholdMD.cpp b/Framework/MDAlgorithms/src/ThresholdMD.cpp
index 41e7566d90898e73f985dca9a6019bdcbf9eaa09..36021ab3732c52002fad4a740f2ba8232891dc4d 100644
--- a/Framework/MDAlgorithms/src/ThresholdMD.cpp
+++ b/Framework/MDAlgorithms/src/ThresholdMD.cpp
@@ -40,7 +40,9 @@ const std::string ThresholdMD::name() const { return "ThresholdMD"; }
 int ThresholdMD::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
-const std::string ThresholdMD::category() const { return "MDAlgorithms"; }
+const std::string ThresholdMD::category() const {
+  return "MDAlgorithms\\Transforms";
+}
 
 //----------------------------------------------------------------------------------------------
 
diff --git a/Framework/MDAlgorithms/src/TransformMD.cpp b/Framework/MDAlgorithms/src/TransformMD.cpp
index 72480fa92253c6b91351ba1093bbb65702c6cc66..cb4f2fed3ff3ca4ade2b2639d73b3b212f29d05d 100644
--- a/Framework/MDAlgorithms/src/TransformMD.cpp
+++ b/Framework/MDAlgorithms/src/TransformMD.cpp
@@ -35,7 +35,9 @@ const std::string TransformMD::name() const { return "TransformMD"; }
 int TransformMD::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
-const std::string TransformMD::category() const { return "MDAlgorithms"; }
+const std::string TransformMD::category() const {
+  return "MDAlgorithms\\Transforms";
+}
 
 //----------------------------------------------------------------------------------------------
 
diff --git a/Framework/MDAlgorithms/src/TransposeMD.cpp b/Framework/MDAlgorithms/src/TransposeMD.cpp
index 2db31c1df1dcae39a0b3585e09418ecccd0c897e..0a2f355fdd10dbdf517d93e1d9fe24227b500bed 100644
--- a/Framework/MDAlgorithms/src/TransposeMD.cpp
+++ b/Framework/MDAlgorithms/src/TransposeMD.cpp
@@ -47,7 +47,9 @@ const std::string TransposeMD::name() const { return "TransposeMD"; }
 int TransposeMD::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
-const std::string TransposeMD::category() const { return "MDAlgorithms"; }
+const std::string TransposeMD::category() const {
+  return "MDAlgorithms\\Transforms";
+}
 
 /// Algorithm's summary for use in the GUI and help. @see Algorithm::summary
 const std::string TransposeMD::summary() const {
diff --git a/Framework/MDAlgorithms/test/ConvertToDetectorFaceMDTest.h b/Framework/MDAlgorithms/test/ConvertToDetectorFaceMDTest.h
index 9b23889c4e0c851099a9a6f8cc50f9b7b83455dd..c1ac0083f23859481dea962a9b23d0044ff2bee1 100644
--- a/Framework/MDAlgorithms/test/ConvertToDetectorFaceMDTest.h
+++ b/Framework/MDAlgorithms/test/ConvertToDetectorFaceMDTest.h
@@ -118,11 +118,6 @@ public:
     TS_ASSERT_EQUALS("ConvertToDetectorFaceMD", alg.name())
   }
 
-  void test_categories() {
-    ConvertToDetectorFaceMD alg;
-    TS_ASSERT_EQUALS("MDAlgorithms", alg.category());
-  }
-
   //----------------------------------------------------------------------------
   void test_oneBank() {
     MDEventWorkspace3::sptr ws = doTest<MDEventWorkspace3>(TOF, "1");
diff --git a/Framework/MDAlgorithms/test/CreateMDHistoWorkspaceTest.h b/Framework/MDAlgorithms/test/CreateMDHistoWorkspaceTest.h
index c575738d9c2124b188f9e15dd93ddb1e982928a8..f08d607958349741cedbfb131289c930734e4449 100644
--- a/Framework/MDAlgorithms/test/CreateMDHistoWorkspaceTest.h
+++ b/Framework/MDAlgorithms/test/CreateMDHistoWorkspaceTest.h
@@ -43,11 +43,6 @@ public:
   }
   static void destroySuite(CreateMDHistoWorkspaceTest *suite) { delete suite; }
 
-  void test_catagory() {
-    CreateMDHistoWorkspace alg;
-    TS_ASSERT_EQUALS("MDAlgorithms", alg.category());
-  }
-
   void test_name() {
     CreateMDHistoWorkspace alg;
     TS_ASSERT_EQUALS("CreateMDHistoWorkspace", alg.name());
diff --git a/Framework/MDAlgorithms/test/ImportMDEventWorkspaceTest.h b/Framework/MDAlgorithms/test/ImportMDEventWorkspaceTest.h
index 7618576c348d9bb2a4e08a43c103c5ff7faf3252..30161e3a611dd9840679459f48dd99b1756f34be 100644
--- a/Framework/MDAlgorithms/test/ImportMDEventWorkspaceTest.h
+++ b/Framework/MDAlgorithms/test/ImportMDEventWorkspaceTest.h
@@ -121,11 +121,6 @@ public:
   }
   static void destroySuite(ImportMDEventWorkspaceTest *suite) { delete suite; }
 
-  void test_catagory() {
-    ImportMDEventWorkspace alg;
-    TS_ASSERT_EQUALS("MDAlgorithms", alg.category());
-  }
-
   void test_name() {
     ImportMDEventWorkspace alg;
     TS_ASSERT_EQUALS("ImportMDEventWorkspace", alg.name());
diff --git a/Framework/MDAlgorithms/test/ImportMDHistoWorkspaceTest.h b/Framework/MDAlgorithms/test/ImportMDHistoWorkspaceTest.h
index 30fea781d645df0e462cab68ad7a27f251167f56..5833afb0bc59e02f24715ff38bd7e9054ade375b 100644
--- a/Framework/MDAlgorithms/test/ImportMDHistoWorkspaceTest.h
+++ b/Framework/MDAlgorithms/test/ImportMDHistoWorkspaceTest.h
@@ -85,11 +85,6 @@ public:
   }
   static void destroySuite(ImportMDHistoWorkspaceTest *suite) { delete suite; }
 
-  void test_catagory() {
-    ImportMDHistoWorkspace alg;
-    TS_ASSERT_EQUALS("MDAlgorithms", alg.category());
-  }
-
   void test_name() {
     ImportMDHistoWorkspace alg;
     TS_ASSERT_EQUALS("ImportMDHistoWorkspace", alg.name());
diff --git a/Framework/MDAlgorithms/test/LoadMDTest.h b/Framework/MDAlgorithms/test/LoadMDTest.h
index 744d40d6a2e7c53471ab45ef5454969929d730d2..26b6fffffc171efdc52901ea007fd8dd5d136ebe 100644
--- a/Framework/MDAlgorithms/test/LoadMDTest.h
+++ b/Framework/MDAlgorithms/test/LoadMDTest.h
@@ -12,6 +12,8 @@
 #include "MantidDataObjects/MDEventWorkspace.h"
 #include "MantidDataObjects/BoxControllerNeXusIO.h"
 #include "MantidGeometry/MDGeometry/QSample.h"
+#include "MantidGeometry/MDGeometry/GeneralFrame.h"
+#include "MantidGeometry/MDGeometry/HKL.h"
 #include "MantidMDAlgorithms/LoadMD.h"
 
 #include <cxxtest/TestSuite.h>
@@ -823,6 +825,149 @@ public:
         "SaveMDEventNormalizationFlagTest_ws");
     AnalysisDataService::Instance().remove("reloaded_MDEventNormalization");
   }
+
+  void test_loading_legacy_QSample_file_with_MDEvent_is_being_corrected() {
+    // Arrange
+    std::string filename("MDEvent_wo_MDFrames_w_QSample_flag.nxs");
+    std::string outWSName("LoadMD_legacy_test_file");
+
+    // Act
+    LoadMD alg;
+    TS_ASSERT_THROWS_NOTHING(alg.initialize())
+    TS_ASSERT(alg.isInitialized())
+    TS_ASSERT_THROWS_NOTHING(alg.setPropertyValue("Filename", filename));
+    TS_ASSERT_THROWS_NOTHING(alg.setProperty("FileBackEnd", false));
+    TS_ASSERT_THROWS_NOTHING(
+        alg.setPropertyValue("OutputWorkspace", outWSName));
+    TS_ASSERT_THROWS_NOTHING(alg.setProperty("MetadataOnly", false));
+    TS_ASSERT_THROWS_NOTHING(alg.execute(););
+    TS_ASSERT(alg.isExecuted());
+
+    // Retrieve the workspace from data service.
+    IMDEventWorkspace_sptr iws;
+    TS_ASSERT_THROWS_NOTHING(
+        iws = AnalysisDataService::Instance().retrieveWS<IMDEventWorkspace>(
+            outWSName));
+    TS_ASSERT(iws);
+
+    if (!iws) {
+      return;
+    }
+
+    // Assert
+    // We expect the first three dimensions to be QSample and the fourth to be a
+    // GeneralFrame
+    for (int index = 0; index < 3; ++index) {
+      TSM_ASSERT_EQUALS(
+          "The first three dimension should contain a QSample Frame",
+          iws->getDimension(index)->getMDFrame().name(),
+          Mantid::Geometry::QSample::QSampleName);
+    }
+
+    TSM_ASSERT_EQUALS("The fourth dimension should contain a General Frame",
+                      iws->getDimension(3)->getMDFrame().name(),
+                      Mantid::Geometry::GeneralFrame::GeneralFrameName);
+    // Clean up
+    if (iws) {
+      AnalysisDataService::Instance().remove(outWSName);
+    }
+  }
+
+  void test_loading_legacy_HKL_file_with_MDHisto_is_being_corrected() {
+    // Arrange
+    std::string filename("MDHisto_wo_MDFrames_w_HKL_flag.nxs");
+    std::string outWSName("LoadMD_legacy_test_file");
+
+    // Act
+    LoadMD alg;
+    TS_ASSERT_THROWS_NOTHING(alg.initialize())
+    TS_ASSERT(alg.isInitialized())
+    TS_ASSERT_THROWS_NOTHING(alg.setPropertyValue("Filename", filename));
+    TS_ASSERT_THROWS_NOTHING(alg.setProperty("FileBackEnd", false));
+    TS_ASSERT_THROWS_NOTHING(
+        alg.setPropertyValue("OutputWorkspace", outWSName));
+    TS_ASSERT_THROWS_NOTHING(alg.setProperty("MetadataOnly", false));
+    TS_ASSERT_THROWS_NOTHING(alg.execute(););
+    TS_ASSERT(alg.isExecuted());
+
+    // Retrieve the workspace from data service.
+    IMDHistoWorkspace_sptr iws;
+    TS_ASSERT_THROWS_NOTHING(
+        iws = AnalysisDataService::Instance().retrieveWS<IMDHistoWorkspace>(
+            outWSName));
+    TS_ASSERT(iws);
+
+    if (!iws) {
+      return;
+    }
+
+    // Assert
+    // We expect the first three dimensions to be QSample and the fourth to be a
+    // GeneralFrame
+    for (int index = 0; index < 3; ++index) {
+      TSM_ASSERT_EQUALS("The first three dimension should contain an HKL Frame",
+                        iws->getDimension(index)->getMDFrame().name(),
+                        Mantid::Geometry::HKL::HKLName);
+    }
+
+    TSM_ASSERT_EQUALS("The fourth dimension should contain a General Frame",
+                      iws->getDimension(3)->getMDFrame().name(),
+                      Mantid::Geometry::GeneralFrame::GeneralFrameName);
+    // Clean up
+    if (iws) {
+      AnalysisDataService::Instance().remove(outWSName);
+    }
+  }
+
+  void
+  test_loading_legacy_HKL_file_with_MDHisto_with_incorrect_HKLUnits_doesnt_make_changes() {
+    // Arrange
+    std::string filename(
+        "MDHisto_wo_MDFrames_w_HKL_flag_w_invalid_HKLUnits.nxs");
+    std::string outWSName("LoadMD_legacy_test_file");
+
+    // Act
+    LoadMD alg;
+    alg.setRethrows(true);
+    TS_ASSERT_THROWS_NOTHING(alg.initialize())
+    TS_ASSERT(alg.isInitialized())
+    TS_ASSERT_THROWS_NOTHING(alg.setPropertyValue("Filename", filename));
+    TS_ASSERT_THROWS_NOTHING(alg.setProperty("FileBackEnd", false));
+    TS_ASSERT_THROWS_NOTHING(
+        alg.setPropertyValue("OutputWorkspace", outWSName));
+    TS_ASSERT_THROWS_NOTHING(alg.setProperty("MetadataOnly", false));
+    TS_ASSERT_THROWS_NOTHING(alg.execute(););
+    TS_ASSERT(alg.isExecuted());
+
+    // Retrieve the workspace from data service.
+    IMDHistoWorkspace_sptr iws;
+    TS_ASSERT_THROWS_NOTHING(
+        iws = AnalysisDataService::Instance().retrieveWS<IMDHistoWorkspace>(
+            outWSName));
+    TS_ASSERT(iws);
+
+    if (!iws) {
+      return;
+    }
+
+    // Assert
+    // We expect the first three dimensions to be QSample and the fourth to be a
+    // GeneralFrame
+    for (int index = 0; index < 3; ++index) {
+      TSM_ASSERT_EQUALS(
+          "The first three dimension should contain an Unkown frame",
+          iws->getDimension(index)->getMDFrame().name(),
+          Mantid::Geometry::UnknownFrame::UnknownFrameName);
+    }
+
+    TSM_ASSERT_EQUALS("The fourth dimension should contain an Unkown frame",
+                      iws->getDimension(3)->getMDFrame().name(),
+                      Mantid::Geometry::UnknownFrame::UnknownFrameName);
+    // Clean up
+    if (iws) {
+      AnalysisDataService::Instance().remove(outWSName);
+    }
+  }
 };
 
 #endif /* MANTID_MDEVENTS_LOADMDEWTEST_H_ */
diff --git a/Framework/PythonInterface/mantid/api/src/PythonAlgorithm/AlgorithmAdapter.cpp b/Framework/PythonInterface/mantid/api/src/PythonAlgorithm/AlgorithmAdapter.cpp
index 9199beee8885f9a9ebfa3e3103a6f82f84e63692..593ecb9fd069b62f130afb69ccecac577d55146c 100644
--- a/Framework/PythonInterface/mantid/api/src/PythonAlgorithm/AlgorithmAdapter.cpp
+++ b/Framework/PythonInterface/mantid/api/src/PythonAlgorithm/AlgorithmAdapter.cpp
@@ -86,8 +86,22 @@ bool AlgorithmAdapter<BaseAlgorithm>::checkGroupsDefault() {
  */
 template <typename BaseAlgorithm>
 const std::string AlgorithmAdapter<BaseAlgorithm>::category() const {
-  return CallMethod0<std::string>::dispatchWithDefaultReturn(
-      getSelf(), "category", defaultCategory());
+  const std::string algDefaultCategory = defaultCategory();
+  const std::string algCategory =
+      CallMethod0<std::string>::dispatchWithDefaultReturn(getSelf(), "category",
+                                                          algDefaultCategory);
+  if (algCategory == algDefaultCategory) {
+    // output a warning
+    const std::string &name = getSelf()->ob_type->tp_name;
+    int version = CallMethod0<int>::dispatchWithDefaultReturn(
+        getSelf(), "version", defaultVersion());
+    this->getLogger().warning()
+        << "Python Algorithm " << name << " v" << version
+        << " does not have a category defined. See "
+           "http://www.mantidproject.org/Basic_PythonAlgorithm_Structure"
+        << std::endl;
+  }
+  return algCategory;
 }
 
 /**
diff --git a/Framework/PythonInterface/mantid/kernel/src/Exports/Quat.cpp b/Framework/PythonInterface/mantid/kernel/src/Exports/Quat.cpp
index abcba6155a2a13b3dc1a9a711887e3754578a120..8b5bf0a8154efa8840f3f46128692fe3e3c0e28e 100644
--- a/Framework/PythonInterface/mantid/kernel/src/Exports/Quat.cpp
+++ b/Framework/PythonInterface/mantid/kernel/src/Exports/Quat.cpp
@@ -56,6 +56,9 @@ void export_Quat() {
            "Returns the 'length' of the quaternion")
       .def("len2", &Quat::len2, arg("self"),
            "Returns the square of the 'length' of the quaternion")
+      .def("getEulerAngles", &Quat::getEulerAngles,
+           (arg("self"), arg("convention") = "YZX"),
+           "Default convention is \'YZX\'.")
       .def("__add__", &Quat::operator+, (arg("left"), arg("right")))
       .def("__iadd__", &Quat::operator+=, boost::python::return_self<>(),
            (arg("self"), arg("other")))
diff --git a/Framework/PythonInterface/plugins/algorithms/ApplyNegMuCorrection.py b/Framework/PythonInterface/plugins/algorithms/ApplyNegMuCorrection.py
index eee7a42a9a76c7ad0a73461c8704bb6ffb6d809f..2976eec3a211b32945e3105bd75e199cdebd351b 100644
--- a/Framework/PythonInterface/plugins/algorithms/ApplyNegMuCorrection.py
+++ b/Framework/PythonInterface/plugins/algorithms/ApplyNegMuCorrection.py
@@ -70,7 +70,7 @@ class ApplyNegMuCorrection(PythonAlgorithm):
         self.declareProperty(name="OffsetISISLowE",defaultValue=0.0,doc="OffSet ISIS Low E")
 
     def category(self):
-        return "CorrectionFunctions;Muon"
+        return "CorrectionFunctions\\SpecialCorrections;Muon"
 
     def PyExec(self):
 
diff --git a/Framework/PythonInterface/plugins/algorithms/BASISReduction.py b/Framework/PythonInterface/plugins/algorithms/BASISReduction.py
index c592c4f40b8b9803b844676f035d3e0f93c29f90..0d2da2adc3b5674a248af100fffadc5fc730c064 100644
--- a/Framework/PythonInterface/plugins/algorithms/BASISReduction.py
+++ b/Framework/PythonInterface/plugins/algorithms/BASISReduction.py
@@ -36,7 +36,7 @@ class BASISReduction(PythonAlgorithm):
     _samSqwWs = None
 
     def category(self):
-        return "Inelastic;PythonAlgorithms"
+        return "Inelastic\\Reduction"
 
     def name(self):
         return "BASISReduction"
diff --git a/Framework/PythonInterface/plugins/algorithms/BASISReduction311.py b/Framework/PythonInterface/plugins/algorithms/BASISReduction311.py
index 47462dcfb5e91124a88bcab3e0b184e8e0dc6934..420cbbfc54777e1e532f1f2ac2d77f5d5859e5b3 100644
--- a/Framework/PythonInterface/plugins/algorithms/BASISReduction311.py
+++ b/Framework/PythonInterface/plugins/algorithms/BASISReduction311.py
@@ -38,7 +38,7 @@ class BASISReduction311(PythonAlgorithm):
     _samSqwWs = None
 
     def category(self):
-        return "Inelastic;PythonAlgorithms"
+        return "Inelastic\\Reduction"
 
     def name(self):
         return "BASISReduction311"
diff --git a/Framework/PythonInterface/plugins/algorithms/CalibrateRectangularDetectors.py b/Framework/PythonInterface/plugins/algorithms/CalibrateRectangularDetectors.py
index 2872de3f6c16004a79ca250f78a1ab24a557cea1..ecd3b61b0b7e35287ce0183b39d609f6221808c1 100644
--- a/Framework/PythonInterface/plugins/algorithms/CalibrateRectangularDetectors.py
+++ b/Framework/PythonInterface/plugins/algorithms/CalibrateRectangularDetectors.py
@@ -39,7 +39,7 @@ class CalibrateRectangularDetectors(PythonAlgorithm):
     _binning = None
 
     def category(self):
-        return "Diffraction;PythonAlgorithms"
+        return "Diffraction\\Calibration"
 
     def name(self):
         return "CalibrateRectangularDetectors"
diff --git a/Framework/PythonInterface/plugins/algorithms/CheckForSampleLogs.py b/Framework/PythonInterface/plugins/algorithms/CheckForSampleLogs.py
index ad5329b501db2139a3db854eea1f40f49cc6ff6c..8e5882ac1f74a7289ff250c29da64f4df23af06a 100644
--- a/Framework/PythonInterface/plugins/algorithms/CheckForSampleLogs.py
+++ b/Framework/PythonInterface/plugins/algorithms/CheckForSampleLogs.py
@@ -8,7 +8,7 @@ class CheckForSampleLogs(PythonAlgorithm):
     def category(self):
         """ Return category
         """
-        return "PythonAlgorithms;Utility\\Workspaces"
+        return "Utility\\Workspaces"
 
     def name(self):
         """ Return name
diff --git a/Framework/PythonInterface/plugins/algorithms/CollectHB3AExperimentInfo.py b/Framework/PythonInterface/plugins/algorithms/CollectHB3AExperimentInfo.py
index 3a63c7bb3ea9e21bcc69916c955933a965bdc214..39deb7e480f820add40bd42de0036200dd1cdeb7 100644
--- a/Framework/PythonInterface/plugins/algorithms/CollectHB3AExperimentInfo.py
+++ b/Framework/PythonInterface/plugins/algorithms/CollectHB3AExperimentInfo.py
@@ -38,7 +38,7 @@ class CollectHB3AExperimentInfo(PythonAlgorithm):
     def category(self):
         """ Category
         """
-        return "Diffraction"
+        return "Diffraction\\ConstantWavelength"
 
     def name(self):
         """ Algorithm name
diff --git a/Framework/PythonInterface/plugins/algorithms/CompareSampleLogs.py b/Framework/PythonInterface/plugins/algorithms/CompareSampleLogs.py
index 6a1aeb82e7fd2ae991abb41d68e1c14661f544c0..687a37dfb80bb0264912af9acd9ef6884d148256 100644
--- a/Framework/PythonInterface/plugins/algorithms/CompareSampleLogs.py
+++ b/Framework/PythonInterface/plugins/algorithms/CompareSampleLogs.py
@@ -18,7 +18,7 @@ class CompareSampleLogs(PythonAlgorithm):
         """
         Returns category
         """
-        return "PythonAlgorithms;Utility\\Workspaces"
+        return "Utility\\Workspaces"
 
     def name(self):
         """
diff --git a/Framework/PythonInterface/plugins/algorithms/ComputeCalibrationCoefVan.py b/Framework/PythonInterface/plugins/algorithms/ComputeCalibrationCoefVan.py
index a6964b3768e7acd5a4056f52cbfb721c8c95ef06..3da6117aa1d4660bc3bd0ab8e4a1700bc31906ab 100644
--- a/Framework/PythonInterface/plugins/algorithms/ComputeCalibrationCoefVan.py
+++ b/Framework/PythonInterface/plugins/algorithms/ComputeCalibrationCoefVan.py
@@ -22,7 +22,7 @@ class ComputeCalibrationCoefVan(PythonAlgorithm):
     def category(self):
         """ Return category
         """
-        return "PythonAlgorithms;CorrectionFunctions\\EfficiencyCorrections"
+        return "CorrectionFunctions\\EfficiencyCorrections"
 
     def name(self):
         """ Return summary
diff --git a/Framework/PythonInterface/plugins/algorithms/ConjoinFiles.py b/Framework/PythonInterface/plugins/algorithms/ConjoinFiles.py
index ae040da82bb07d8fbd45084cc9fc35f659b52dde..8e70ccbe2340d2af2d0a43fa66bbc4e26e845edb 100644
--- a/Framework/PythonInterface/plugins/algorithms/ConjoinFiles.py
+++ b/Framework/PythonInterface/plugins/algorithms/ConjoinFiles.py
@@ -6,7 +6,7 @@ import os
 
 class ConjoinFiles(PythonAlgorithm):
     def category(self):
-        return "DataHandling;PythonAlgorithms"
+        return "DataHandling\\Text"
 
     def name(self):
         return "ConjoinFiles"
diff --git a/Framework/PythonInterface/plugins/algorithms/ConjoinSpectra.py b/Framework/PythonInterface/plugins/algorithms/ConjoinSpectra.py
index a712e98e9d0308a26ac12def15e1d14926ab535c..39ca7cf432940911db711de50d44c6c43f36f0b6 100644
--- a/Framework/PythonInterface/plugins/algorithms/ConjoinSpectra.py
+++ b/Framework/PythonInterface/plugins/algorithms/ConjoinSpectra.py
@@ -12,7 +12,7 @@ class ConjoinSpectra(PythonAlgorithm):
     """
 
     def category(self):
-        return "Transforms\\Merging;PythonAlgorithms"
+        return "Transforms\\Merging"
 
     def name(self):
         return "ConjoinSpectra"
diff --git a/Framework/PythonInterface/plugins/algorithms/ConvertSnsRoiFileToMask.py b/Framework/PythonInterface/plugins/algorithms/ConvertSnsRoiFileToMask.py
index 3cbe75a19b62a584fdd4fd1180674ce3d7471dc2..b7a80b5aa694829d0926b74e0c1c0c54ee1de8f2 100644
--- a/Framework/PythonInterface/plugins/algorithms/ConvertSnsRoiFileToMask.py
+++ b/Framework/PythonInterface/plugins/algorithms/ConvertSnsRoiFileToMask.py
@@ -26,7 +26,7 @@ class ConvertSnsRoiFileToMask(api.PythonAlgorithm):
         """
         Set the category for the algorithm.
         """
-        return "Inelastic;PythonAlgorithms"
+        return "Inelastic\\Utility"
 
     def name(self):
         """
diff --git a/Framework/PythonInterface/plugins/algorithms/CorrectLogTimes.py b/Framework/PythonInterface/plugins/algorithms/CorrectLogTimes.py
index 995767c7c90c5888546e3456b580e0b67d9317eb..681d46cccf50527ceaead01b26db8b7d9836f1e9 100644
--- a/Framework/PythonInterface/plugins/algorithms/CorrectLogTimes.py
+++ b/Framework/PythonInterface/plugins/algorithms/CorrectLogTimes.py
@@ -12,7 +12,7 @@ class CorrectLogTimes(mantid.api.PythonAlgorithm):
     def category(self):
         """ Mantid required
         """
-        return "PythonAlgorithms;DataHandling\\Logs"
+        return "DataHandling\\Logs"
 
     def name(self):
         """ Mantid required
diff --git a/Framework/PythonInterface/plugins/algorithms/CreateEmptyTableWorkspace.py b/Framework/PythonInterface/plugins/algorithms/CreateEmptyTableWorkspace.py
index d53125761090ca3e00c6fb78b50d4cdf3b8b0546..74ff4657fce7d6ad14dfe6467d2d123b5b68518a 100644
--- a/Framework/PythonInterface/plugins/algorithms/CreateEmptyTableWorkspace.py
+++ b/Framework/PythonInterface/plugins/algorithms/CreateEmptyTableWorkspace.py
@@ -9,6 +9,9 @@ class CreateEmptyTableWorkspace(PythonAlgorithm):
         return "Creates an empty TableWorkspace which can be populated with various "\
                "types of information."
 
+    def category(self):
+        return 'Utility\\Workspaces'
+
     def PyInit(self):
         # Declare properties
         self.declareProperty(ITableWorkspaceProperty("OutputWorkspace", "", Direction.Output),
diff --git a/Framework/PythonInterface/plugins/algorithms/CreateLeBailFitInput.py b/Framework/PythonInterface/plugins/algorithms/CreateLeBailFitInput.py
index 5d258662882963e0897dc803ad74d220cebe8d10..4217afb35420a6e7cb4042475d891d3475e572f8 100644
--- a/Framework/PythonInterface/plugins/algorithms/CreateLeBailFitInput.py
+++ b/Framework/PythonInterface/plugins/algorithms/CreateLeBailFitInput.py
@@ -15,7 +15,7 @@ class CreateLeBailFitInput(PythonAlgorithm):
     def category(self):
         """
         """
-        return "Diffraction;Utility"
+        return "Diffraction\\Fitting;Utility\\Workspaces"
 
     def name(self):
         """
diff --git a/Framework/PythonInterface/plugins/algorithms/CylinderPaalmanPingsCorrection.py b/Framework/PythonInterface/plugins/algorithms/CylinderPaalmanPingsCorrection.py
index 5470e2a9f315bd13bd86ea881799b284fb131491..756d73e7baf7240f7090fa5255f51d4a00e2201b 100644
--- a/Framework/PythonInterface/plugins/algorithms/CylinderPaalmanPingsCorrection.py
+++ b/Framework/PythonInterface/plugins/algorithms/CylinderPaalmanPingsCorrection.py
@@ -39,7 +39,7 @@ class CylinderPaalmanPingsCorrection(PythonAlgorithm):
 #------------------------------------------------------------------------------
 
     def category(self):
-        return "Workflow\\MIDAS;PythonAlgorithms;CorrectionFunctions\\AbsorptionCorrections"
+        return "Workflow\\MIDAS;CorrectionFunctions\\AbsorptionCorrections"
 
     def summary(self):
         return "Calculates absorption corrections for a cylindrical or annular sample using Paalman & Pings format."
diff --git a/Framework/PythonInterface/plugins/algorithms/CylinderPaalmanPingsCorrection2.py b/Framework/PythonInterface/plugins/algorithms/CylinderPaalmanPingsCorrection2.py
index b28f720376f59c09a94b514e152d9e95e20cafc6..775cc7de95f247f599ff7ab28132c2b6bd04e24c 100644
--- a/Framework/PythonInterface/plugins/algorithms/CylinderPaalmanPingsCorrection2.py
+++ b/Framework/PythonInterface/plugins/algorithms/CylinderPaalmanPingsCorrection2.py
@@ -44,7 +44,7 @@ class CylinderPaalmanPingsCorrection(PythonAlgorithm):
         return 2
 
     def category(self):
-        return "Workflow\\MIDAS;PythonAlgorithms;CorrectionFunctions\\AbsorptionCorrections"
+        return "Workflow\\MIDAS;CorrectionFunctions\\AbsorptionCorrections"
 
     def summary(self):
         return "Calculates absorption corrections for a cylindrical or annular sample using Paalman & Pings format."
diff --git a/Framework/PythonInterface/plugins/algorithms/DNSDetEffCorrVana.py b/Framework/PythonInterface/plugins/algorithms/DNSDetEffCorrVana.py
index 3f28f5d2017b8f248ae2252a373b1050ce02a273..d573794acdf5cf986ebe870b1f39225dabc0e8fb 100644
--- a/Framework/PythonInterface/plugins/algorithms/DNSDetEffCorrVana.py
+++ b/Framework/PythonInterface/plugins/algorithms/DNSDetEffCorrVana.py
@@ -30,7 +30,7 @@ class DNSDetEffCorrVana(PythonAlgorithm):
         """
         Returns category
         """
-        return 'PythonAlgorithms\\MLZ\\DNS;CorrectionFunctions\\EfficiencyCorrections'
+        return 'Workflow\\MLZ\\DNS;CorrectionFunctions\\SpecialCorrections'
 
     def name(self):
         """
diff --git a/Framework/PythonInterface/plugins/algorithms/DNSFlippingRatioCorr.py b/Framework/PythonInterface/plugins/algorithms/DNSFlippingRatioCorr.py
index f7043e8c505b33d44d50c48a812072ca4ee47fdd..ec8343fe80adda5cd597e48f6bb64a087cccf877 100644
--- a/Framework/PythonInterface/plugins/algorithms/DNSFlippingRatioCorr.py
+++ b/Framework/PythonInterface/plugins/algorithms/DNSFlippingRatioCorr.py
@@ -30,7 +30,7 @@ class DNSFlippingRatioCorr(PythonAlgorithm):
         """
         Returns category
         """
-        return 'PythonAlgorithms\\MLZ\\DNS;CorrectionFunctions'
+        return 'Workflow\\MLZ\\DNS;;CorrectionFunctions\\SpecialCorrections'
 
     def name(self):
         """
@@ -39,7 +39,7 @@ class DNSFlippingRatioCorr(PythonAlgorithm):
         return "DNSFlippingRatioCorr"
 
     def summary(self):
-        return "Peforms flipping ratio correction on a given dataset using the NiCr data."
+        return "Performs flipping ratio correction on a given dataset using the NiCr data."
 
     def PyInit(self):
         self.declareProperty(MatrixWorkspaceProperty("SFDataWorkspace", "", direction=Direction.Input),
diff --git a/Framework/PythonInterface/plugins/algorithms/DNSMergeRuns.py b/Framework/PythonInterface/plugins/algorithms/DNSMergeRuns.py
index 1901450c19b521d7bc494431370054b023a1f21f..c2a532290d136b04e776c99295c817fa2abb4ce3 100644
--- a/Framework/PythonInterface/plugins/algorithms/DNSMergeRuns.py
+++ b/Framework/PythonInterface/plugins/algorithms/DNSMergeRuns.py
@@ -27,7 +27,7 @@ class DNSMergeRuns(PythonAlgorithm):
         """
         Returns category
         """
-        return 'PythonAlgorithms\\MLZ\\DNS'
+        return 'Workflow\\MLZ\\DNS'
 
     def name(self):
         """
diff --git a/Framework/PythonInterface/plugins/algorithms/DPDFreduction.py b/Framework/PythonInterface/plugins/algorithms/DPDFreduction.py
index 2b934bf849a7d4d823a5198b50754d5c6b5532bd..c6d940d8648d5a07bf81191a2e2cf8e8ed2dbc28 100644
--- a/Framework/PythonInterface/plugins/algorithms/DPDFreduction.py
+++ b/Framework/PythonInterface/plugins/algorithms/DPDFreduction.py
@@ -26,7 +26,7 @@ class DPDFreduction(PythonAlgorithm):
     _ebins = None
 
     def category(self):
-        return "Inelastic;PythonAlgorithms;Utility\\Development"
+        return "Inelastic\\Reduction;Utility\\Development"
 
     def name(self):
         return 'DPDFreduction'
diff --git a/Framework/PythonInterface/plugins/algorithms/DSFinterp.py b/Framework/PythonInterface/plugins/algorithms/DSFinterp.py
index 3e4f516f1213c880ba3745e66203ca1c4aaab38f..e7b80d10c4c82fcf5148a921cf3ded7496a6d342 100644
--- a/Framework/PythonInterface/plugins/algorithms/DSFinterp.py
+++ b/Framework/PythonInterface/plugins/algorithms/DSFinterp.py
@@ -9,7 +9,7 @@ class DSFinterp(PythonAlgorithm):
     channelgroup = None
 
     def category(self):
-        return "Transforms\\Smoothing;Utility;PythonAlgorithms"
+        return "Transforms\\Smoothing"
 
     def name(self):
         return 'DSFinterp'
diff --git a/Framework/PythonInterface/plugins/algorithms/DakotaChiSquared.py b/Framework/PythonInterface/plugins/algorithms/DakotaChiSquared.py
index d60e6d1bda6aaf54d8fb527f1548eb6711885911..6d0a9e192301d36205c56ee78ac237b7ea9fc22e 100644
--- a/Framework/PythonInterface/plugins/algorithms/DakotaChiSquared.py
+++ b/Framework/PythonInterface/plugins/algorithms/DakotaChiSquared.py
@@ -11,7 +11,7 @@ class DakotaChiSquared(PythonAlgorithm):
     def category(self):
         """ Return category
         """
-        return "PythonAlgorithms;Utility\\Workspaces"
+        return "Utility\\Workspaces"
 
     def name(self):
         """ Return name
diff --git a/Framework/PythonInterface/plugins/algorithms/EnggCalibrate.py b/Framework/PythonInterface/plugins/algorithms/EnggCalibrate.py
index 3962dbd4e9da615f4828bad363b0b5238a734f76..6e5b71d3b9877266ca62314c0d46f274b434863b 100644
--- a/Framework/PythonInterface/plugins/algorithms/EnggCalibrate.py
+++ b/Framework/PythonInterface/plugins/algorithms/EnggCalibrate.py
@@ -6,7 +6,7 @@ class EnggCalibrate(PythonAlgorithm):
     INDICES_PROP_NAME = 'SpectrumNumbers'
 
     def category(self):
-        return "Diffraction\\Engineering;PythonAlgorithms"
+        return "Diffraction\\Engineering"
 
     def name(self):
         return "EnggCalibrate"
diff --git a/Framework/PythonInterface/plugins/algorithms/EnggCalibrateFull.py b/Framework/PythonInterface/plugins/algorithms/EnggCalibrateFull.py
index 12e30625cbcd963964305250b91fed9fdcf9d66d..bba3d4efd90ec5a317457336fad6f01b0e0d546e 100644
--- a/Framework/PythonInterface/plugins/algorithms/EnggCalibrateFull.py
+++ b/Framework/PythonInterface/plugins/algorithms/EnggCalibrateFull.py
@@ -8,7 +8,7 @@ class EnggCalibrateFull(PythonAlgorithm):
     INDICES_PROP_NAME = 'SpectrumNumbers'
 
     def category(self):
-        return "Diffraction\\Engineering;PythonAlgorithms"
+        return "Diffraction\\Engineering"
 
     def name(self):
         return "EnggCalibrateFull"
diff --git a/Framework/PythonInterface/plugins/algorithms/EnggFitPeaks.py b/Framework/PythonInterface/plugins/algorithms/EnggFitPeaks.py
index e7a5d7ec3968329856c2418a28cc8b4ec16ae48b..e116947e76ed9fe3595423e47b36d78d49557e5d 100644
--- a/Framework/PythonInterface/plugins/algorithms/EnggFitPeaks.py
+++ b/Framework/PythonInterface/plugins/algorithms/EnggFitPeaks.py
@@ -9,7 +9,7 @@ class EnggFitPeaks(PythonAlgorithm):
     PEAK_TYPE = 'BackToBackExponential'
 
     def category(self):
-        return "Diffraction\\Engineering;PythonAlgorithms"
+        return "Diffraction\\Engineering"
 
     def name(self):
         return "EnggFitPeaks"
diff --git a/Framework/PythonInterface/plugins/algorithms/EnggFocus.py b/Framework/PythonInterface/plugins/algorithms/EnggFocus.py
index 6e2ad54bec16809c02d05540a0031c7f6d2088c7..05871684e8802e040d8ebd463697b4bee5fab49d 100644
--- a/Framework/PythonInterface/plugins/algorithms/EnggFocus.py
+++ b/Framework/PythonInterface/plugins/algorithms/EnggFocus.py
@@ -8,7 +8,7 @@ class EnggFocus(PythonAlgorithm):
     INDICES_PROP_NAME = 'SpectrumNumbers'
 
     def category(self):
-        return "Diffraction\\Engineering;PythonAlgorithms"
+        return "Diffraction\\Engineering"
 
     def name(self):
         return "EnggFocus"
diff --git a/Framework/PythonInterface/plugins/algorithms/EnggVanadiumCorrections.py b/Framework/PythonInterface/plugins/algorithms/EnggVanadiumCorrections.py
index dfb257c4f625b1972a04fd8fb26d891324b72bc6..d14b9f694fc92ee9e427252280c48cdecf3a8ec7 100644
--- a/Framework/PythonInterface/plugins/algorithms/EnggVanadiumCorrections.py
+++ b/Framework/PythonInterface/plugins/algorithms/EnggVanadiumCorrections.py
@@ -13,7 +13,7 @@ class EnggVanadiumCorrections(PythonAlgorithm):
 
 
     def category(self):
-        return ("Diffraction\\Engineering;PythonAlgorithms;CorrectionFunctions\\BackgroundCorrections;"
+        return ("Diffraction\\Engineering;CorrectionFunctions\\BackgroundCorrections;"
                 "CorrectionFunctions\\EfficiencyCorrections;CorrectionFunctions\\NormalisationCorrections")
 
     def name(self):
diff --git a/Framework/PythonInterface/plugins/algorithms/ExaminePowderDiffProfile.py b/Framework/PythonInterface/plugins/algorithms/ExaminePowderDiffProfile.py
index 80822b19e7302661c925f6a2d3aafd9d74f2d896..f2ec6119be5459d3a46d905547d0622d9fba429b 100644
--- a/Framework/PythonInterface/plugins/algorithms/ExaminePowderDiffProfile.py
+++ b/Framework/PythonInterface/plugins/algorithms/ExaminePowderDiffProfile.py
@@ -31,7 +31,7 @@ class ExaminePowderDiffProfile(PythonAlgorithm):
     def category(self):
         """
         """
-        return "Diffraction;Utility"
+        return "Diffraction\\Utility"
 
     def name(self):
         """
diff --git a/Framework/PythonInterface/plugins/algorithms/Examples/ExampleSaveAscii.py b/Framework/PythonInterface/plugins/algorithms/Examples/ExampleSaveAscii.py
index 9a568153cb8d6e12190ca75e8e1ec03e6d099e9e..5bbdda057267c970a0d83f460aef2cb83aad7492 100644
--- a/Framework/PythonInterface/plugins/algorithms/Examples/ExampleSaveAscii.py
+++ b/Framework/PythonInterface/plugins/algorithms/Examples/ExampleSaveAscii.py
@@ -11,6 +11,10 @@ from mantid.api import *
 
 class ExampleSaveAscii(PythonAlgorithm):
 
+    def category(self):
+        # defines the category the algorithm will be put in the algorithm browser
+        return 'Examples'
+
     def PyInit(self):
 
         # Declare properties
diff --git a/Framework/PythonInterface/plugins/algorithms/Examples/Squares.py b/Framework/PythonInterface/plugins/algorithms/Examples/Squares.py
index 9a9a781b2759b120ef7f3856660e3592f156058c..f9f2650949e9a93a05409a20fa822806387bc8d1 100644
--- a/Framework/PythonInterface/plugins/algorithms/Examples/Squares.py
+++ b/Framework/PythonInterface/plugins/algorithms/Examples/Squares.py
@@ -9,6 +9,10 @@ from mantid.kernel import *
 #
 class Squares(PythonAlgorithm):
 
+    def category(self):
+        # defines the category the algorithm will be put in the algorithm browser
+        return 'Examples'
+
     def PyInit(self):
         # Integer property. IntBoundedValidator restricts values to be greater than 0
         self.declareProperty("MaxRange", -1, validator = IntBoundedValidator(lower=0), doc = "A value for the end of the range(inclusive)")
diff --git a/Framework/PythonInterface/plugins/algorithms/ExportExperimentLog.py b/Framework/PythonInterface/plugins/algorithms/ExportExperimentLog.py
index cbb3e55a2bfb7af752cb6b689c1201fcce7b97f2..5487a67c2994cdd525e426001a70a62c0ba86eb3 100644
--- a/Framework/PythonInterface/plugins/algorithms/ExportExperimentLog.py
+++ b/Framework/PythonInterface/plugins/algorithms/ExportExperimentLog.py
@@ -31,6 +31,11 @@ class ExportExperimentLog(PythonAlgorithm):
     def summmary(self):
         return "Exports experimental log."
 
+    def category(self):
+        """ Defines the category the algorithm will be put in the algorithm browser
+        """
+        return 'DataHandling\\Logs'
+
     def PyInit(self):
         """ Declaration of properties
         """
diff --git a/Framework/PythonInterface/plugins/algorithms/ExportGeometry.py b/Framework/PythonInterface/plugins/algorithms/ExportGeometry.py
new file mode 100644
index 0000000000000000000000000000000000000000..cfa427e2f785145fe488d72757653a662b2c5a30
--- /dev/null
+++ b/Framework/PythonInterface/plugins/algorithms/ExportGeometry.py
@@ -0,0 +1,118 @@
+#pylint: disable=no-init
+from mantid.api import PythonAlgorithm, AlgorithmFactory, WorkspaceProperty, \
+    InstrumentValidator, FileProperty, FileAction
+from mantid.kernel import Direction, StringArrayProperty
+
+SOURCE_XML = """  <!--SOURCE-->
+  <component type="moderator">
+    <location z="%(z)f"/>
+  </component>
+  <type is="Source" name="moderator"/>
+
+"""
+
+SAMPLE_XML = """  <!--SAMPLE-->
+  <component type="sample-position">
+    <location x="%(x)f" y="%(y)f" z="%(z)f"/>
+  </component>
+  <type is="SamplePos" name="sample-position"/>
+
+"""
+
+COMPONENT_XML = """      <location x="%(x)f" y="%(y)f" z="%(z)f" name="%(name)s">
+        <rot axis-x="0" axis-y="1" axis-z="0" val="%(Y1)f">
+          <rot axis-x="0" axis-y="0" axis-z="1" val="%(Z)f">
+            <rot axis-x="0" axis-y="1" axis-z="0" val="%(Y2)f"/>
+          </rot>
+        </rot>
+      </location>
+
+"""
+
+
+class ExportGeometry(PythonAlgorithm):
+    def category(self):
+        return "Utility"
+
+    def name(self):
+        return "ExportGeometry"
+
+    def summary(self):
+        return "Extract geometry into a variety of file formats"
+
+    def PyInit(self):
+        self.declareProperty(WorkspaceProperty("InputWorkspace", "",
+                                               validator=InstrumentValidator(),
+                                               direction=Direction.Input),
+                             doc="Workspace containing the instrument to be exported")
+        self.declareProperty(StringArrayProperty("Components",
+                                                 direction=Direction.Input),
+                             doc="Comma separated list of instrument components to export")
+        self.declareProperty(FileProperty(name="Filename",
+                                          defaultValue="",
+                                          action=FileAction.Save,
+                                          extensions=[".xml"]),
+                             doc="Save file")
+
+    def validateInputs(self):
+        issues = {}
+
+        # get the input workspace
+        wksp = self.getProperty("InputWorkspace").value
+
+        # confirm that all of the requested components exist
+        components = self.getProperty("Components").value
+        if len(components) <= 0:
+            issues['Components'] = "Must supply components"
+        else:
+            components = [component for component in components
+                          if wksp.getInstrument().getComponentByName(component) is None]
+            if len(components) > 0:
+                issues['Components'] = "Instrument has no component \"" \
+                                       + ','.join(components) + "\""
+
+        return issues
+
+    def __updatePos(self, info, component):
+        pos = component.getPos()
+        info['x'] = pos.X()
+        info['y'] = pos.Y()
+        info['z'] = pos.Z()
+
+        angles = component.getRotation().getEulerAngles('YZY')
+        info['Y1'] = angles[0]
+        info['Z'] = angles[1]
+        info['Y2'] = angles[2]
+
+    def __writexmlSource(self, handle, instrument):
+        source = {}
+        self.__updatePos(source, instrument.getSource())
+        handle.write(SOURCE_XML % source)
+
+        sample = {}
+        self.__updatePos(sample, instrument.getSample())
+        handle.write(SAMPLE_XML % sample)
+
+    def __writexml(self, handle, component):
+        info = {'name': component.getName()}
+        self.__updatePos(info, component)
+
+        handle.write(COMPONENT_XML % info)
+
+    def PyExec(self):
+        wksp = self.getProperty("InputWorkspace").value
+        components = self.getProperty("Components").value
+        filename = self.getProperty("Filename").value
+
+        instrument = wksp.getInstrument()
+        with open(filename, 'w') as handle:
+            # write out the source and sample components
+            self.__writexmlSource(handle, instrument)
+
+            # write out the requested components
+            handle.write("""  <!--COMPONENTS-->\n""")
+            for component in components:
+                component = instrument.getComponentByName(component)
+                self.__writexml(handle, component)
+
+AlgorithmFactory.subscribe(ExportGeometry)
diff --git a/Framework/PythonInterface/plugins/algorithms/ExportSampleLogsToCSVFile.py b/Framework/PythonInterface/plugins/algorithms/ExportSampleLogsToCSVFile.py
index 61f528de6dc7b99a9dbe3ad49be3c3cefb1008f9..7d6d8de90228ec813b48537ab90ba3dcda83a64d 100644
--- a/Framework/PythonInterface/plugins/algorithms/ExportSampleLogsToCSVFile.py
+++ b/Framework/PythonInterface/plugins/algorithms/ExportSampleLogsToCSVFile.py
@@ -24,7 +24,7 @@ class ExportSampleLogsToCSVFile(PythonAlgorithm):
     def category(self):
         """ Category
         """
-        return "Utility;PythonAlgorithms"
+        return "DataHandling\\Logs"
 
     def name(self):
         """ Algorithm name
diff --git a/Framework/PythonInterface/plugins/algorithms/FindReflectometryLines.py b/Framework/PythonInterface/plugins/algorithms/FindReflectometryLines.py
index eaa71defbc6c61b34d0b403967ceec0d73311f5f..5c159502f0494f23ac59f8dba03cc6e57a9cf716 100644
--- a/Framework/PythonInterface/plugins/algorithms/FindReflectometryLines.py
+++ b/Framework/PythonInterface/plugins/algorithms/FindReflectometryLines.py
@@ -37,7 +37,7 @@ class FindReflectometryLines(PythonAlgorithm):
         return y_data
 
     def category(self):
-        return "PythonAlgorithms;Reflectometry"
+        return "Reflectometry"
 
     def name(self):
         return "FindReflectometryLines"
diff --git a/Framework/PythonInterface/plugins/algorithms/GenerateGroupingSNSInelastic.py b/Framework/PythonInterface/plugins/algorithms/GenerateGroupingSNSInelastic.py
index f165df35ac187caa8d313e0bc285d91f3fd30a83..d97c8c78ef99fb88df0479178240c6411dba99c3 100644
--- a/Framework/PythonInterface/plugins/algorithms/GenerateGroupingSNSInelastic.py
+++ b/Framework/PythonInterface/plugins/algorithms/GenerateGroupingSNSInelastic.py
@@ -13,7 +13,7 @@ class GenerateGroupingSNSInelastic(mantid.api.PythonAlgorithm):
     def category(self):
         """ Mantid required
         """
-        return "Inelastic;PythonAlgorithms;Transforms\\Grouping"
+        return "Inelastic\\Utility;Transforms\\Grouping"
 
     def name(self):
         """ Mantid required
diff --git a/Framework/PythonInterface/plugins/algorithms/GetEiMonDet.py b/Framework/PythonInterface/plugins/algorithms/GetEiMonDet.py
index a3d579409935cae5c6f6c4fe9b757076ba15fb39..72cf89ea2e5468ba94987f9b75640b2d94595512 100644
--- a/Framework/PythonInterface/plugins/algorithms/GetEiMonDet.py
+++ b/Framework/PythonInterface/plugins/algorithms/GetEiMonDet.py
@@ -11,7 +11,7 @@ class GetEiMonDet(PythonAlgorithm):
     def category(self):
         """ Return category
         """
-        return "PythonAlgorithms;Inelastic"
+        return "Inelastic\\Ei"
 
     def name(self):
         """ Return name
diff --git a/Framework/PythonInterface/plugins/algorithms/GetEiT0atSNS.py b/Framework/PythonInterface/plugins/algorithms/GetEiT0atSNS.py
index 5f9552241b415c145c0bebc5cacde24ed7426059..ca51c4c09fb92c4ab9c88bd774b76f5db3129930 100644
--- a/Framework/PythonInterface/plugins/algorithms/GetEiT0atSNS.py
+++ b/Framework/PythonInterface/plugins/algorithms/GetEiT0atSNS.py
@@ -7,7 +7,7 @@ class GetEiT0atSNS(mantid.api.PythonAlgorithm):
     def category(self):
         """ Return category
         """
-        return "PythonAlgorithms;Inelastic"
+        return "Inelastic\\Ei"
 
     def name(self):
         """ Return name
diff --git a/Framework/PythonInterface/plugins/algorithms/GetNegMuMuonicXRD.py b/Framework/PythonInterface/plugins/algorithms/GetNegMuMuonicXRD.py
index 09729c07767e45e249e76db78f992c6e48ea69d8..f4a5ab4accf1fec18282d425115afa4ff646a889 100644
--- a/Framework/PythonInterface/plugins/algorithms/GetNegMuMuonicXRD.py
+++ b/Framework/PythonInterface/plugins/algorithms/GetNegMuMuonicXRD.py
@@ -45,7 +45,7 @@ class GetNegMuMuonicXRD(PythonAlgorithm):
         return muon_xr_ws
 
     def category(self):
-        return "Muon;PythonAlgorithms"
+        return "Muon"
 
     def PyExec(self):
         elements = self.getProperty("Elements").value
diff --git a/Framework/PythonInterface/plugins/algorithms/IndirectTransmission.py b/Framework/PythonInterface/plugins/algorithms/IndirectTransmission.py
index e9eeecaeb696128fb5b31464a82752d44d4bb538..3ac9fc1cb496a9da870ce62a0df292f31b84c8d2 100644
--- a/Framework/PythonInterface/plugins/algorithms/IndirectTransmission.py
+++ b/Framework/PythonInterface/plugins/algorithms/IndirectTransmission.py
@@ -27,7 +27,7 @@ def _get_instrument_property_list(instrument, property_name):
 class IndirectTransmission(PythonAlgorithm):
 
     def category(self):
-        return "Workflow\\MIDAS;PythonAlgorithms"
+        return "Workflow\\MIDAS"
 
 
     def summary(self):
diff --git a/Framework/PythonInterface/plugins/algorithms/LoadDNSLegacy.py b/Framework/PythonInterface/plugins/algorithms/LoadDNSLegacy.py
index f9ec865ac39019c89dcdc6c4674368faae340c50..32a68d7b439f813b4c182d0a433e62a44a88713a 100644
--- a/Framework/PythonInterface/plugins/algorithms/LoadDNSLegacy.py
+++ b/Framework/PythonInterface/plugins/algorithms/LoadDNSLegacy.py
@@ -26,7 +26,7 @@ class LoadDNSLegacy(PythonAlgorithm):
         """
         Returns category
         """
-        return 'PythonAlgorithms\\MLZ\\DNS;DataHandling'
+        return 'Workflow\\MLZ\\DNS;DataHandling\\Text'
 
     def name(self):
         """
diff --git a/Framework/PythonInterface/plugins/algorithms/LoadEmptyVesuvio.py b/Framework/PythonInterface/plugins/algorithms/LoadEmptyVesuvio.py
index 71f89f722ec92c77768badb7f35d20b1515e35ff..58a660fa1013fc2f7d8a84d430fb38932f5c8a9f 100644
--- a/Framework/PythonInterface/plugins/algorithms/LoadEmptyVesuvio.py
+++ b/Framework/PythonInterface/plugins/algorithms/LoadEmptyVesuvio.py
@@ -20,7 +20,11 @@ class LoadEmptyVesuvio(PythonAlgorithm):
 
     def summary(self):
         return "Loads an empty workspace containing the Vesuvio instrument at ISIS."
-
+#----------------------------------------------------------------------------------------
+    def category(self):
+        """ Defines the category the algorithm will be put in the algorithm browser
+        """
+        return 'DataHandling\\Raw'
 #----------------------------------------------------------------------------------------
 
     def PyInit(self):
diff --git a/Framework/PythonInterface/plugins/algorithms/LoadFullprofFile.py b/Framework/PythonInterface/plugins/algorithms/LoadFullprofFile.py
index 8ce3875c3f1f31650fdf8ee17295dc74d955ab2c..86901a7e0adaae915139c11b1dfc6b02e6291afd 100644
--- a/Framework/PythonInterface/plugins/algorithms/LoadFullprofFile.py
+++ b/Framework/PythonInterface/plugins/algorithms/LoadFullprofFile.py
@@ -16,7 +16,7 @@ class LoadFullprofFile(PythonAlgorithm):
     def category(self):
         """
         """
-        return "Diffraction;Utility"
+        return "Diffraction\\DataHandling"
 
     def name(self):
         """
diff --git a/Framework/PythonInterface/plugins/algorithms/LoadLogPropertyTable.py b/Framework/PythonInterface/plugins/algorithms/LoadLogPropertyTable.py
index 5119dd6bc69209b3a4178b7ae5f94c62501fc26f..0fc39e89f07ef9f540f98ce3e51313e8da05e5bd 100644
--- a/Framework/PythonInterface/plugins/algorithms/LoadLogPropertyTable.py
+++ b/Framework/PythonInterface/plugins/algorithms/LoadLogPropertyTable.py
@@ -33,7 +33,7 @@ class LoadLogPropertyTable(PythonAlgorithm):
         self.declareProperty(WorkspaceProperty("OutputWorkspace","",Direction.Output),"Table of results")
 
     def category(self):
-        return "Utility;Muon"
+        return "DataHandling\\Logs;Muon\\DataHandling"
 
     def getGeneralLogValue(self,ws,name,begin):
         # get log value
diff --git a/Framework/PythonInterface/plugins/algorithms/LoadMultipleGSS.py b/Framework/PythonInterface/plugins/algorithms/LoadMultipleGSS.py
index d47b87709ac18123a96e2965034e3a41098d913d..81cd05ec1dd66971980148a5b84bec91b5767baa 100644
--- a/Framework/PythonInterface/plugins/algorithms/LoadMultipleGSS.py
+++ b/Framework/PythonInterface/plugins/algorithms/LoadMultipleGSS.py
@@ -10,7 +10,7 @@ class LoadMultipleGSS(PythonAlgorithm):
     __loader = None
 
     def category(self):
-        return "DataHandling;PythonAlgorithms"
+        return "DataHandling\\Text"
 
     def name(self):
         return "LoadMultipleGSS"
diff --git a/Framework/PythonInterface/plugins/algorithms/LoadNMoldyn3Ascii.py b/Framework/PythonInterface/plugins/algorithms/LoadNMoldyn3Ascii.py
index b592f3e3f2b3f7d4243791fc53fb56090c983d16..f7ad63e900f8acf2ae0027ef7fbe256e3aeea998 100644
--- a/Framework/PythonInterface/plugins/algorithms/LoadNMoldyn3Ascii.py
+++ b/Framework/PythonInterface/plugins/algorithms/LoadNMoldyn3Ascii.py
@@ -87,7 +87,7 @@ class LoadNMoldyn3Ascii(PythonAlgorithm):
 #-------------------------------------------------------------------------------
 
     def category(self):
-        return 'PythonAlgorithms;Inelastic;Simulation'
+        return 'Inelastic\\DataHandling;Simulation'
 
 #-------------------------------------------------------------------------------
 
diff --git a/Framework/PythonInterface/plugins/algorithms/LoadNMoldyn4Ascii.py b/Framework/PythonInterface/plugins/algorithms/LoadNMoldyn4Ascii.py
index 49ab19e664cb95677bfab18d45f05dc7ae0642b4..80fed4719c8ed80ff2e12879c5b1a33ef5b5ce79 100644
--- a/Framework/PythonInterface/plugins/algorithms/LoadNMoldyn4Ascii.py
+++ b/Framework/PythonInterface/plugins/algorithms/LoadNMoldyn4Ascii.py
@@ -31,7 +31,7 @@ class LoadNMoldyn4Ascii(PythonAlgorithm):
 #------------------------------------------------------------------------------
 
     def category(self):
-        return 'PythonAlgorithms;Inelastic;Simulation'
+        return 'Inelastic\\DataHandling;Simulation'
 
 
     def summary(self):
diff --git a/Framework/PythonInterface/plugins/algorithms/LoadSINQ.py b/Framework/PythonInterface/plugins/algorithms/LoadSINQ.py
index 2aeedd4bc6f2ea5cba3514a8fb751ad84c67ca5a..a164a0dd862bf271ca1b611d143739ec5f4de66e 100644
--- a/Framework/PythonInterface/plugins/algorithms/LoadSINQ.py
+++ b/Framework/PythonInterface/plugins/algorithms/LoadSINQ.py
@@ -21,7 +21,7 @@ datapath='/afs/psi.ch/project/sinqdata'
 class LoadSINQ(PythonAlgorithm):
 
     def category(self):
-        return "DataHandling;PythonAlgorithms"
+        return "DataHandling\\Nexus"
 
     def summary(self):
         return "SINQ data file loader"
diff --git a/Framework/PythonInterface/plugins/algorithms/LoadSINQFile.py b/Framework/PythonInterface/plugins/algorithms/LoadSINQFile.py
index 5852f993f84a23ddc19dc5bfc5abf78c9fa3c315..9c3a43d5cc6dc34ac683a68497f053b7f7706cce 100644
--- a/Framework/PythonInterface/plugins/algorithms/LoadSINQFile.py
+++ b/Framework/PythonInterface/plugins/algorithms/LoadSINQFile.py
@@ -20,7 +20,7 @@ import re
 
 class LoadSINQFile(PythonAlgorithm):
     def category(self):
-        return "DataHandling;PythonAlgorithms"
+        return "DataHandling\\Nexus"
 
     def summary(self):
         return "Load a SINQ file with the right dictionary."
diff --git a/Framework/PythonInterface/plugins/algorithms/LoadVesuvio.py b/Framework/PythonInterface/plugins/algorithms/LoadVesuvio.py
index 239a6a4df7e47b1e7c71bbd6a1c4187ae8bfb658..cc16aeabe38c91b3df4ff619da1bd19afe32c63e 100644
--- a/Framework/PythonInterface/plugins/algorithms/LoadVesuvio.py
+++ b/Framework/PythonInterface/plugins/algorithms/LoadVesuvio.py
@@ -93,6 +93,11 @@ class LoadVesuvio(LoadEmptyVesuvio):
 
 #----------------------------------------------------------------------------------------
 
+    def category(self):
+        """ Defines the category the algorithm will be put in the algorithm browser
+        """
+        return 'DataHandling\\Raw'
+#----------------------------------------------------------------------------------------
     def PyInit(self):
         self.declareProperty(RUN_PROP, "", StringMandatoryValidator(),
                              doc="The run numbers that should be loaded. E.g."
diff --git a/Framework/PythonInterface/plugins/algorithms/LoadVisionElasticBS.py b/Framework/PythonInterface/plugins/algorithms/LoadVisionElasticBS.py
index 37e8d2902e2aa71df9ccb5a700cbe4a7999f217e..03557e8d898122b48991be3b4b050c31b1fe2112 100644
--- a/Framework/PythonInterface/plugins/algorithms/LoadVisionElasticBS.py
+++ b/Framework/PythonInterface/plugins/algorithms/LoadVisionElasticBS.py
@@ -13,7 +13,7 @@ class LoadVisionElasticBS(PythonAlgorithm):
     __backscattering = "bank15,bank16,bank17,bank18,bank19,bank20,bank21,bank22,bank23,bank24"
 
     def category(self):
-        return "DataHandling;PythonAlgorithms"
+        return "DataHandling\\Nexus"
 
     def name(self):
         return "LoadVisionElasticBS"
diff --git a/Framework/PythonInterface/plugins/algorithms/LoadVisionElasticEQ.py b/Framework/PythonInterface/plugins/algorithms/LoadVisionElasticEQ.py
index c9ccaea5c88c613dfd529a715abacd529307726a..b7a22460b3b9fb3398430b29fb38d11950534ef6 100644
--- a/Framework/PythonInterface/plugins/algorithms/LoadVisionElasticEQ.py
+++ b/Framework/PythonInterface/plugins/algorithms/LoadVisionElasticEQ.py
@@ -13,7 +13,7 @@ class LoadVisionElasticEQ(PythonAlgorithm):
     __equatorial = "bank25,bank26,bank27,bank28,bank29,bank30"
 
     def category(self):
-        return "DataHandling;PythonAlgorithms"
+        return "DataHandling\\Nexus"
 
     def name(self):
         return "LoadVisionElasticEQ"
diff --git a/Framework/PythonInterface/plugins/algorithms/LoadVisionInelastic.py b/Framework/PythonInterface/plugins/algorithms/LoadVisionInelastic.py
index 065069ba32171a6444aefe2411ae43b63839b753..06a44558c7c375608d9baea281e721a1f3d08b9b 100644
--- a/Framework/PythonInterface/plugins/algorithms/LoadVisionInelastic.py
+++ b/Framework/PythonInterface/plugins/algorithms/LoadVisionInelastic.py
@@ -13,7 +13,7 @@ class LoadVisionInelastic(PythonAlgorithm):
     __backward = "bank8,bank9,bank10,bank11,bank12,bank13,bank14"
 
     def category(self):
-        return "DataHandling;PythonAlgorithms"
+        return "DataHandling\\Nexus"
 
     def name(self):
         return "LoadVisionInelastic"
diff --git a/Framework/PythonInterface/plugins/algorithms/MSDFit.py b/Framework/PythonInterface/plugins/algorithms/MSDFit.py
index de147bde8f794a7a787b822a0e9c8c5def0b3e0c..d2bc7d01dfa0d4e1f03a95615c0977adcfb0180d 100644
--- a/Framework/PythonInterface/plugins/algorithms/MSDFit.py
+++ b/Framework/PythonInterface/plugins/algorithms/MSDFit.py
@@ -14,7 +14,7 @@ class MSDFit(DataProcessorAlgorithm):
     _output_msd_ws = None
 
     def category(self):
-        return 'Workflow\\MIDAS;PythonAlgorithms'
+        return 'Workflow\\MIDAS'
 
 
     def summary(self):
diff --git a/Framework/PythonInterface/plugins/algorithms/MaskAngle.py b/Framework/PythonInterface/plugins/algorithms/MaskAngle.py
index 91f2ae62b5b98b87d04b371d925c6cc27b065701..0fef60babde6d38a404e6cbf4b3303aa75fce553 100644
--- a/Framework/PythonInterface/plugins/algorithms/MaskAngle.py
+++ b/Framework/PythonInterface/plugins/algorithms/MaskAngle.py
@@ -11,7 +11,7 @@ class MaskAngle(mantid.api.PythonAlgorithm):
     def category(self):
         """ Mantid required
         """
-        return "PythonAlgorithms;Transforms\\Masking"
+        return "Transforms\\Masking"
 
     def name(self):
         """ Mantid require
diff --git a/Framework/PythonInterface/plugins/algorithms/MaskBTP.py b/Framework/PythonInterface/plugins/algorithms/MaskBTP.py
index 1321ba1d2cce570ac9eb6219e23c8f17a58e38ae..f6e70c9b371290122797cd9eeb8f50b17c0a7be1 100644
--- a/Framework/PythonInterface/plugins/algorithms/MaskBTP.py
+++ b/Framework/PythonInterface/plugins/algorithms/MaskBTP.py
@@ -16,7 +16,7 @@ class MaskBTP(mantid.api.PythonAlgorithm):
     def category(self):
         """ Mantid required
         """
-        return "PythonAlgorithms;Transforms\\Masking;Inelastic"
+        return "Transforms\\Masking;Inelastic\\Utility"
 
     def name(self):
         """ Mantid required
diff --git a/Framework/PythonInterface/plugins/algorithms/MaskWorkspaceToCalFile.py b/Framework/PythonInterface/plugins/algorithms/MaskWorkspaceToCalFile.py
index 9315a0f112a9017174b62bfa222be7ae0ddf9fe8..d8b91094a065a31926de9f1b220283bcf1216ddb 100644
--- a/Framework/PythonInterface/plugins/algorithms/MaskWorkspaceToCalFile.py
+++ b/Framework/PythonInterface/plugins/algorithms/MaskWorkspaceToCalFile.py
@@ -16,7 +16,7 @@ class QueryValue(object):
 class MaskWorkspaceToCalFile(PythonAlgorithm):
 
     def category(self):
-        return "DataHandling\\Text;Diffraction;PythonAlgorithms"
+        return "DataHandling\\Text;Diffraction\\DataHandling;Diffraction\\Masking"
 
     def name(self):
         return "MaskWorkspaceToCalFile"
diff --git a/Framework/PythonInterface/plugins/algorithms/MergeCalFiles.py b/Framework/PythonInterface/plugins/algorithms/MergeCalFiles.py
index 1bd3509e11d56c9024428a9aa614aa8de3b2edaf..e4e8b7f218489ca2701e21a81c2b672c50a90580 100644
--- a/Framework/PythonInterface/plugins/algorithms/MergeCalFiles.py
+++ b/Framework/PythonInterface/plugins/algorithms/MergeCalFiles.py
@@ -5,7 +5,7 @@ from mantid.kernel import *
 class MergeCalFiles(PythonAlgorithm):
 
     def category(self):
-        return "DataHandling\\Text;Diffraction;PythonAlgorithms"
+        return "DataHandling\\Text;Diffraction\\DataHandling\\CalFiles"
 
     def name(self):
         return "MergeCalFiles"
diff --git a/Framework/PythonInterface/plugins/algorithms/MuscatSofQW.py b/Framework/PythonInterface/plugins/algorithms/MuscatSofQW.py
index ba2ba8f585e53e36e347ba5acb038605150fc2f6..2abd235d5a7e1fd24bc97646cc65c9441bc2d555 100644
--- a/Framework/PythonInterface/plugins/algorithms/MuscatSofQW.py
+++ b/Framework/PythonInterface/plugins/algorithms/MuscatSofQW.py
@@ -23,7 +23,7 @@ class MuscatSofQW(DataProcessorAlgorithm):
 
 
     def category(self):
-        return "Workflow\\MIDAS;PythonAlgorithms"
+        return "Workflow\\MIDAS"
 
 
     def summary(self):
diff --git a/Framework/PythonInterface/plugins/algorithms/PDToPDFgetN.py b/Framework/PythonInterface/plugins/algorithms/PDToPDFgetN.py
index db6819bf1d05cb23dc7ed144a29799ca64e6b257..57d9127794233d5efed4b23d4790f62326c9a746 100644
--- a/Framework/PythonInterface/plugins/algorithms/PDToPDFgetN.py
+++ b/Framework/PythonInterface/plugins/algorithms/PDToPDFgetN.py
@@ -12,7 +12,7 @@ class PDToPDFgetN(DataProcessorAlgorithm):
     _iparmFile = None
 
     def category(self):
-        return "Workflow\\Diffraction;PythonAlgorithms"
+        return "Workflow\\Diffraction"
 
     def name(self):
         return "PDToPDFgetN"
diff --git a/Framework/PythonInterface/plugins/algorithms/PearlMCAbsorption.py b/Framework/PythonInterface/plugins/algorithms/PearlMCAbsorption.py
index 3d40c7629dfede342d04f5edd66036d9fdf5a0c8..3cab3427d284468d9e4798e02aa33f75b1039235 100644
--- a/Framework/PythonInterface/plugins/algorithms/PearlMCAbsorption.py
+++ b/Framework/PythonInterface/plugins/algorithms/PearlMCAbsorption.py
@@ -7,7 +7,7 @@ import math
 class PearlMCAbsorption(PythonAlgorithm):
 
     def category(self):
-        return "CorrectionFunctions\\AbsorptionCorrections;PythonAlgorithms"
+        return "CorrectionFunctions\\AbsorptionCorrections"
 
     def summary(self):
         return "Loads pre-calculated or measured absorption correction files for Pearl."
diff --git a/Framework/PythonInterface/plugins/algorithms/RefinePowderDiffProfileSeq.py b/Framework/PythonInterface/plugins/algorithms/RefinePowderDiffProfileSeq.py
index fef53a34b982f612211387687588dd7254d7d8ad..2d3256af9adf1858ed51b41bf2b29b14151e1dc0 100644
--- a/Framework/PythonInterface/plugins/algorithms/RefinePowderDiffProfileSeq.py
+++ b/Framework/PythonInterface/plugins/algorithms/RefinePowderDiffProfileSeq.py
@@ -35,7 +35,7 @@ class RefinePowderDiffProfileSeq(PythonAlgorithm):
     def category(self):
         """ Category
         """
-        return "Diffraction"
+        return "Diffraction\\Fitting"
 
     def name(self):
         """ Algorithm name
diff --git a/Framework/PythonInterface/plugins/algorithms/ResNorm.py b/Framework/PythonInterface/plugins/algorithms/ResNorm.py
index 647baf31176d3e544513389223daf5570283fb6a..76b74553101c68096a83f5b1ef361c068ba51ab9 100644
--- a/Framework/PythonInterface/plugins/algorithms/ResNorm.py
+++ b/Framework/PythonInterface/plugins/algorithms/ResNorm.py
@@ -9,7 +9,7 @@ import os
 class ResNorm(PythonAlgorithm):
 
     def category(self):
-        return "Workflow\\MIDAS;PythonAlgorithms"
+        return "Workflow\\MIDAS"
 
 
     def summary(self):
diff --git a/Framework/PythonInterface/plugins/algorithms/RetrieveRunInfo.py b/Framework/PythonInterface/plugins/algorithms/RetrieveRunInfo.py
index 3aaa93fb3f72d7812e60645273defc5a6c9d3fa1..cf8a3e34f4e35b0348f26c23d811433c7aeb9f52 100644
--- a/Framework/PythonInterface/plugins/algorithms/RetrieveRunInfo.py
+++ b/Framework/PythonInterface/plugins/algorithms/RetrieveRunInfo.py
@@ -177,7 +177,7 @@ class FileBackedWsIterator(object):
 
 class RetrieveRunInfo(PythonAlgorithm):
     def category(self):
-        return 'Utility;PythonAlgorithms'
+        return 'DataHandling\\Catalog'
 
     def summary(self):
         return "Given a range of run numbers and an output workspace name, will compile a table of info for "+\
diff --git a/Framework/PythonInterface/plugins/algorithms/SANSSubtract.py b/Framework/PythonInterface/plugins/algorithms/SANSSubtract.py
index 82b33e967a0c22a1dbf1e951fc59775d2a825ad0..dc5a25d24aef3dbf50f7860f0bea653a637a6330 100644
--- a/Framework/PythonInterface/plugins/algorithms/SANSSubtract.py
+++ b/Framework/PythonInterface/plugins/algorithms/SANSSubtract.py
@@ -12,7 +12,7 @@ class SANSSubtract(PythonAlgorithm):
         """
             Return category
         """
-        return "PythonAlgorithms;SANS"
+        return "SANS"
 
     def name(self):
         """
diff --git a/Framework/PythonInterface/plugins/algorithms/SNSPowderReduction.py b/Framework/PythonInterface/plugins/algorithms/SNSPowderReduction.py
index a42d88fd43d6b34c67cd2fbf76c84c2acd2006c9..700a1ce9796ce414d7b800398a89de5baaafbbd3 100644
--- a/Framework/PythonInterface/plugins/algorithms/SNSPowderReduction.py
+++ b/Framework/PythonInterface/plugins/algorithms/SNSPowderReduction.py
@@ -63,7 +63,7 @@ class SNSPowderReduction(DataProcessorAlgorithm):
     _info = None
 
     def category(self):
-        return "Diffraction;PythonAlgorithms"
+        return "Diffraction\\Reduction"
 
     def name(self):
         return "SNSPowderReduction"
diff --git a/Framework/PythonInterface/plugins/algorithms/SavePlot1DAsJson.py b/Framework/PythonInterface/plugins/algorithms/SavePlot1DAsJson.py
index 7bc6cc433707c03185ec1ec1402151f124a6de45..66c1c7e330ede33705b7df112f6f4d3c2dee10fe 100644
--- a/Framework/PythonInterface/plugins/algorithms/SavePlot1DAsJson.py
+++ b/Framework/PythonInterface/plugins/algorithms/SavePlot1DAsJson.py
@@ -11,7 +11,7 @@ class SavePlot1DAsJson(PythonAlgorithm):
     def category(self):
         """
         """
-        return "Utility"
+        return "DataHandling\\Plots"
 
     def name(self):
         """
diff --git a/Framework/PythonInterface/plugins/algorithms/SaveVulcanGSS.py b/Framework/PythonInterface/plugins/algorithms/SaveVulcanGSS.py
index c7a8720a85299cd3aa18128ab0182ec3ad5697a5..234ded0c5e965ffee6563b640cd9c4f2e0cd49cc 100644
--- a/Framework/PythonInterface/plugins/algorithms/SaveVulcanGSS.py
+++ b/Framework/PythonInterface/plugins/algorithms/SaveVulcanGSS.py
@@ -9,7 +9,7 @@ class SaveVulcanGSS(PythonAlgorithm):
     def category(self):
         """
         """
-        return "Diffraction;Utility"
+        return "Diffraction\\DataHandling"
 
     def name(self):
         """
diff --git a/Framework/PythonInterface/plugins/algorithms/SelectPowderDiffPeaks.py b/Framework/PythonInterface/plugins/algorithms/SelectPowderDiffPeaks.py
index fac88e2cbd3bf8da32762f6bf55bebcb935ec7c0..05e2f8055566d11a87e370f1280ffbd5d6b2e117 100644
--- a/Framework/PythonInterface/plugins/algorithms/SelectPowderDiffPeaks.py
+++ b/Framework/PythonInterface/plugins/algorithms/SelectPowderDiffPeaks.py
@@ -14,7 +14,7 @@ class SelectPowderDiffPeaks(PythonAlgorithm):
     def category(self):
         """
         """
-        return "Diffraction;Utility"
+        return "Diffraction\\Fitting"
 
     def name(self):
         """
diff --git a/Framework/PythonInterface/plugins/algorithms/SortByQVectors.py b/Framework/PythonInterface/plugins/algorithms/SortByQVectors.py
index a8398463ea859e48dcd57f9453463fda56906b21..d55f6ed5cb8ade7725e3c67be66e0801da5c0ec1 100644
--- a/Framework/PythonInterface/plugins/algorithms/SortByQVectors.py
+++ b/Framework/PythonInterface/plugins/algorithms/SortByQVectors.py
@@ -11,7 +11,7 @@ class SortByQVectors(PythonAlgorithm):
     """
 
     def category(self):
-        return "Transforms\\Merging;PythonAlgorithms"
+        return "Transforms\\Merging;Utility\\Sorting"
 
     def name(self):
         return "SortByQVectors"
diff --git a/Framework/PythonInterface/plugins/algorithms/SortDetectors.py b/Framework/PythonInterface/plugins/algorithms/SortDetectors.py
index 12798d8df9d8d38cda50e455da90254369cce48c..6a1744585231ee8740bce406962fd138cb79f5f3 100644
--- a/Framework/PythonInterface/plugins/algorithms/SortDetectors.py
+++ b/Framework/PythonInterface/plugins/algorithms/SortDetectors.py
@@ -10,7 +10,7 @@ class SortDetectors(PythonAlgorithm):
     def category(self):
         """ Return category
         """
-        return "PythonAlgorithms;Utility"
+        return "Utility\\Sorting"
 
     def name(self):
         """ Return name
diff --git a/Framework/PythonInterface/plugins/algorithms/SortXAxis.py b/Framework/PythonInterface/plugins/algorithms/SortXAxis.py
index a839e7a3783c6c0a7ce9ddfc980f1c43838e0ea7..13483e879972ca532c55858c6cfc3612609b374e 100644
--- a/Framework/PythonInterface/plugins/algorithms/SortXAxis.py
+++ b/Framework/PythonInterface/plugins/algorithms/SortXAxis.py
@@ -8,7 +8,7 @@ import numpy as np
 class SortXAxis(PythonAlgorithm):
 
     def category(self):
-        return "Transforms\\Axes"
+        return "Transforms\\Axes;Utility\\Sorting"
 
 
     def name(self):
diff --git a/Framework/PythonInterface/plugins/algorithms/StatisticsOfTableWorkspace.py b/Framework/PythonInterface/plugins/algorithms/StatisticsOfTableWorkspace.py
index 176f9474519fe49023291b4ea69827d74c4d0a07..829e4a4d07bd0ddfa6a922d1939fa44ac7b3b6e4 100644
--- a/Framework/PythonInterface/plugins/algorithms/StatisticsOfTableWorkspace.py
+++ b/Framework/PythonInterface/plugins/algorithms/StatisticsOfTableWorkspace.py
@@ -25,7 +25,7 @@ def _stats_to_dict(stats):
 class StatisticsOfTableWorkspace(PythonAlgorithm):
 
     def category(self):
-        return 'DataHandling'
+        return 'Utility\\Workspaces'
 
 
     def summary(self):
diff --git a/Framework/PythonInterface/plugins/algorithms/SuggestTibCNCS.py b/Framework/PythonInterface/plugins/algorithms/SuggestTibCNCS.py
index ed6e06032b7b31d8861845bed8f09d4d3106bc0e..1ed4b3ac50fcea2fb85874fa49fff79b30c79492 100644
--- a/Framework/PythonInterface/plugins/algorithms/SuggestTibCNCS.py
+++ b/Framework/PythonInterface/plugins/algorithms/SuggestTibCNCS.py
@@ -25,7 +25,7 @@ class SuggestTibCNCS(PythonAlgorithm):
     def category(self):
         """ Return category
         """
-        return "PythonAlgorithms;Utility;Inelastic"
+        return "Inelastic\\Utility"
 
     def name(self):
         """ Return name
diff --git a/Framework/PythonInterface/plugins/algorithms/SuggestTibHYSPEC.py b/Framework/PythonInterface/plugins/algorithms/SuggestTibHYSPEC.py
index 53563069596c89ac872808e90ea4bb699e17c6d5..6d315608e74f9c7cd05d65890dd38db46d540b12 100644
--- a/Framework/PythonInterface/plugins/algorithms/SuggestTibHYSPEC.py
+++ b/Framework/PythonInterface/plugins/algorithms/SuggestTibHYSPEC.py
@@ -10,7 +10,7 @@ class SuggestTibHYSPEC(PythonAlgorithm):
     def category(self):
         """ Return category
         """
-        return "PythonAlgorithms;Utility;Inelastic"
+        return "Inelastic\\Utility"
 
     def name(self):
         """ Return name
diff --git a/Framework/PythonInterface/plugins/algorithms/Symmetrise.py b/Framework/PythonInterface/plugins/algorithms/Symmetrise.py
index 01daf86b7badb12659ec33f0527d8055a04cba4f..0974c3204202da8c6fdd34219fcc50c47eea3ecd 100644
--- a/Framework/PythonInterface/plugins/algorithms/Symmetrise.py
+++ b/Framework/PythonInterface/plugins/algorithms/Symmetrise.py
@@ -21,7 +21,7 @@ class Symmetrise(PythonAlgorithm):
     _negative_min_index = None
 
     def category(self):
-        return 'PythonAlgorithms'
+        return 'CorrectionFunctions\\SpecialCorrections'
 
 
     def summary(self):
diff --git a/Framework/PythonInterface/plugins/algorithms/TOFTOFCropWorkspace.py b/Framework/PythonInterface/plugins/algorithms/TOFTOFCropWorkspace.py
index c7c6f387adb444ff9c0b0ded8ac87c33c0f3bd99..c4251b417f0f99ffd32ca56533ec04f231510378 100644
--- a/Framework/PythonInterface/plugins/algorithms/TOFTOFCropWorkspace.py
+++ b/Framework/PythonInterface/plugins/algorithms/TOFTOFCropWorkspace.py
@@ -12,7 +12,7 @@ class TOFTOFCropWorkspace(PythonAlgorithm):
     def category(self):
         """ Return category
         """
-        return "PythonAlgorithms\\MLZ\\TOFTOF;Utility"
+        return "Workflow\\MLZ\\TOFTOF;Transforms\\Splitting"
 
     def name(self):
         """ Return summary
diff --git a/Framework/PythonInterface/plugins/algorithms/TOFTOFMergeRuns.py b/Framework/PythonInterface/plugins/algorithms/TOFTOFMergeRuns.py
index 2c55914fd0b2dbdbc49cc8c74a4866b856bb4c1c..d05397e3e7949b469fc656ee5531a236ddff39bb 100644
--- a/Framework/PythonInterface/plugins/algorithms/TOFTOFMergeRuns.py
+++ b/Framework/PythonInterface/plugins/algorithms/TOFTOFMergeRuns.py
@@ -23,7 +23,7 @@ class TOFTOFMergeRuns(PythonAlgorithm):
     def category(self):
         """ Return category
         """
-        return "PythonAlgorithms\\MLZ\\TOFTOF;Utility"
+        return "Workflow\\MLZ\\TOFTOF;Transforms\\Splitting"
 
     def name(self):
         """ Return summary
diff --git a/Framework/PythonInterface/plugins/algorithms/TestWorkspaceGroupProperty.py b/Framework/PythonInterface/plugins/algorithms/TestWorkspaceGroupProperty.py
index 1eb1fb4afff6cbe6db51ac6933df857f4d9f13ec..0770560a191e213ddff9ed3d6db0204b75990ea3 100644
--- a/Framework/PythonInterface/plugins/algorithms/TestWorkspaceGroupProperty.py
+++ b/Framework/PythonInterface/plugins/algorithms/TestWorkspaceGroupProperty.py
@@ -7,7 +7,7 @@ class TestWorkspaceGroupProperty(PythonAlgorithm):
     """
 
     def category(self):
-        return "PythonAlgorithms"
+        return "Workflow\\Testing"
 
     def name(self):
         return "WorkspaceGroupProperty"
diff --git a/Framework/PythonInterface/plugins/algorithms/UpdatePeakParameterTableValue.py b/Framework/PythonInterface/plugins/algorithms/UpdatePeakParameterTableValue.py
index 5e0f24d077c44a4945e0344f69d2bcaa83953d08..8642675f3f802272c562061c1b409909d4a37bb6 100644
--- a/Framework/PythonInterface/plugins/algorithms/UpdatePeakParameterTableValue.py
+++ b/Framework/PythonInterface/plugins/algorithms/UpdatePeakParameterTableValue.py
@@ -14,7 +14,7 @@ class UpdatePeakParameterTableValue(mantid.api.PythonAlgorithm):
     def category(self):
         """ Mantid required
         """
-        return "Inelastic;PythonAlgorithms;Transforms\\Grouping"
+        return "Inelastic\\Utility;Transforms\\Grouping"
 
     def name(self):
         """ Mantid require
diff --git a/Framework/PythonInterface/plugins/algorithms/VesuvioResolution.py b/Framework/PythonInterface/plugins/algorithms/VesuvioResolution.py
index 5d5090dd2dd5748c590a778aa76739921d745dd1..f62153fbb38ef1893c5844366b503f2954821095 100644
--- a/Framework/PythonInterface/plugins/algorithms/VesuvioResolution.py
+++ b/Framework/PythonInterface/plugins/algorithms/VesuvioResolution.py
@@ -11,7 +11,7 @@ class VesuvioResolution(PythonAlgorithm):
     _mass = None
 
     def category(self):
-        return 'Inelastic'
+        return 'Inelastic\\Utility'
 
     def summary(self):
         return 'Calculates the resolution function for VESUVIO'
diff --git a/Framework/PythonInterface/plugins/algorithms/ViewBOA.py b/Framework/PythonInterface/plugins/algorithms/ViewBOA.py
index d0cacec22b8abfd103e2b4fbd426430151edac69..0bdd32bcdaee137cfaecf4d9164feef44f1e30c2 100644
--- a/Framework/PythonInterface/plugins/algorithms/ViewBOA.py
+++ b/Framework/PythonInterface/plugins/algorithms/ViewBOA.py
@@ -7,7 +7,7 @@ import datetime
 
 class ViewBOA(PythonAlgorithm):
     def category(self):
-        return 'PythonAlgorithms;SINQ'
+        return 'SINQ'
 
     def summary(self):
         return "Load a BOA file and create the 3 BOA plots."
diff --git a/Framework/PythonInterface/plugins/algorithms/VisionLoadDetectorTable.py b/Framework/PythonInterface/plugins/algorithms/VisionLoadDetectorTable.py
index 531e4cc257992caf3274bfc44ac2eb99b7459813..667a5b8fa7ee69497a551b663eae3bfac11ffa9b 100644
--- a/Framework/PythonInterface/plugins/algorithms/VisionLoadDetectorTable.py
+++ b/Framework/PythonInterface/plugins/algorithms/VisionLoadDetectorTable.py
@@ -8,7 +8,7 @@ import numpy as np
 class VisionLoadDetectorTable(PythonAlgorithm):
 
     def category(self):
-        return "Utility\\Development;PythonAlgorithms"
+        return "Utility\\Development"
 
     def summary(self):
         return "Warning - This is under development - Algorithm to load detector parameters for VISION."
diff --git a/Framework/PythonInterface/plugins/algorithms/VisionReduction.py b/Framework/PythonInterface/plugins/algorithms/VisionReduction.py
index 610f798d9b49694ca61ecfba68b09f14c7c51dca..b7e7fd3aa904a20802a508b260163cadf229e1ee 100644
--- a/Framework/PythonInterface/plugins/algorithms/VisionReduction.py
+++ b/Framework/PythonInterface/plugins/algorithms/VisionReduction.py
@@ -50,7 +50,7 @@ class VisionReduction(PythonAlgorithm):
         return outfilename
 
     def category(self):
-        return "DataHandling;PythonAlgorithms;Utility\\Development"
+        return "Workflow\\Inelastic;Utility\\Development"
 
     def name(self):
         return "VisionReduction"
diff --git a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ApplyPaalmanPingsCorrection.py b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ApplyPaalmanPingsCorrection.py
index 2d2977b4ede6dc2e7f07cb46dba9b19fa15557cf..8a93e86ae19d024d06e27a6c9076a15a769e80ba 100644
--- a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ApplyPaalmanPingsCorrection.py
+++ b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ApplyPaalmanPingsCorrection.py
@@ -20,7 +20,7 @@ class ApplyPaalmanPingsCorrection(PythonAlgorithm):
 
 
     def category(self):
-        return "Workflow\\MIDAS;PythonAlgorithms"
+        return "Workflow\\MIDAS"
 
 
     def summary(self):
diff --git a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/BayesQuasi.py b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/BayesQuasi.py
index ad8f200d7def37f04dc2b9257195f49d50c9693c..c6c8a138cccbf210ec0660f3bea42a90e25fd19e 100644
--- a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/BayesQuasi.py
+++ b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/BayesQuasi.py
@@ -34,7 +34,7 @@ class BayesQuasi(PythonAlgorithm):
     _plot = None
 
     def category(self):
-        return "Workflow\\MIDAS;PythonAlgorithms"
+        return "Workflow\\MIDAS"
 
     def summary(self):
         return "This algorithm runs the Fortran QLines programs which fits a Delta function of"+\
diff --git a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/EVSDiffractionReduction.py b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/EVSDiffractionReduction.py
index 69a0a5485cf1d5ce2e9d537260f2e60f09e913d5..4d02c46c006462ddeca94dfe76ff10d06094e61d 100644
--- a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/EVSDiffractionReduction.py
+++ b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/EVSDiffractionReduction.py
@@ -23,7 +23,7 @@ class EVSDiffractionReduction(DataProcessorAlgorithm):
 
 
     def category(self):
-        return 'Diffraction;PythonAlgorithms'
+        return 'Diffraction\\Reduction'
 
 
     def summary(self):
diff --git a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ElasticWindowMultiple.py b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ElasticWindowMultiple.py
index fc52059afd2a3e5add103dc01d5c6b43e00c54af..bb4f3648854caae82c3bc0ee5740726c90c55d27 100644
--- a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ElasticWindowMultiple.py
+++ b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ElasticWindowMultiple.py
@@ -39,7 +39,7 @@ class ElasticWindowMultiple(DataProcessorAlgorithm):
 
 
     def category(self):
-        return 'Workflow\\Inelastic;PythonAlgorithms;Inelastic'
+        return 'Workflow\\Inelastic;Inelastic\\Indirect'
 
 
     def summary(self):
diff --git a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/FlatPlatePaalmanPingsCorrection.py b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/FlatPlatePaalmanPingsCorrection.py
index 468c52f6e4fc005c7acaccbd25d1012e6edeaeda..7a4ffbc8b0d727fbb7ce05489248900575613120 100644
--- a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/FlatPlatePaalmanPingsCorrection.py
+++ b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/FlatPlatePaalmanPingsCorrection.py
@@ -32,7 +32,7 @@ class FlatPlatePaalmanPingsCorrection(PythonAlgorithm):
 #------------------------------------------------------------------------------
 
     def category(self):
-        return "Workflow\\MIDAS;PythonAlgorithms;CorrectionFunctions\\AbsorptionCorrections"
+        return "Workflow\\MIDAS;CorrectionFunctions\\AbsorptionCorrections"
 
 
     def summary(self):
diff --git a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/FuryFitMultiple.py b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/FuryFitMultiple.py
index f6a33ca3e8fba0dda46b91a88f24314bd3c84bc9..09bb97a1971877097bce4305804ad9905947bb6c 100644
--- a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/FuryFitMultiple.py
+++ b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/FuryFitMultiple.py
@@ -8,7 +8,7 @@ import os.path
 class FuryFitMultiple(PythonAlgorithm):
 
     def category(self):
-        return "Workflow\\MIDAS;PythonAlgorithms"
+        return "Workflow\\MIDAS"
 
     def summary(self):
         #pylint: disable=anomalous-backslash-in-string
diff --git a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ILLIN16BCalibration.py b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ILLIN16BCalibration.py
index 209b61f8a22a45b5cfec484e497b1d2feadbb06a..5721324cc0906bd23d34d8dd71b3609018db257e 100644
--- a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ILLIN16BCalibration.py
+++ b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ILLIN16BCalibration.py
@@ -16,7 +16,7 @@ class ILLIN16BCalibration(DataProcessorAlgorithm):
 
 
     def category(self):
-        return 'Workflow\\Inelastic;PythonAlgorithms;Inelastic'
+        return 'Workflow\\Inelastic;Inelastic\\Calibration'
 
 
     def summary(self):
diff --git a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ISISIndirectDiffractionReduction.py b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ISISIndirectDiffractionReduction.py
index a55c7650016ddb0d1ee75db5a11bb435493e2cae..9c1edef264495a42eac76a7722dc8a86e0c07be3 100644
--- a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ISISIndirectDiffractionReduction.py
+++ b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ISISIndirectDiffractionReduction.py
@@ -29,7 +29,7 @@ class ISISIndirectDiffractionReduction(DataProcessorAlgorithm):
 #------------------------------------------------------------------------------
 
     def category(self):
-        return 'Diffraction;PythonAlgorithms'
+        return 'Diffraction\\Reduction'
 
 
     def summary(self):
diff --git a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ISISIndirectEnergyTransfer.py b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ISISIndirectEnergyTransfer.py
index fa83c92cf98338544ae381a386f21a458da96d7d..c02d2ac4c0c66abdbee35448c04622e841f59636 100644
--- a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ISISIndirectEnergyTransfer.py
+++ b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ISISIndirectEnergyTransfer.py
@@ -41,7 +41,7 @@ class ISISIndirectEnergyTransfer(DataProcessorAlgorithm):
 
 
     def category(self):
-        return 'Workflow\\Inelastic;PythonAlgorithms;Inelastic'
+        return 'Workflow\\Inelastic;Inelastic\\Indirect'
 
 
     def summary(self):
diff --git a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/IndirectAnnulusAbsorption.py b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/IndirectAnnulusAbsorption.py
index d8900bf4c4ceb1058e3d9a5999095b6c6ea1f89c..38949bdbbb6fbcc5f0014f7014710434beddf663 100644
--- a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/IndirectAnnulusAbsorption.py
+++ b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/IndirectAnnulusAbsorption.py
@@ -25,7 +25,7 @@ class IndirectAnnulusAbsorption(DataProcessorAlgorithm):
     _sample_inner_radius = 0.
 
     def category(self):
-        return "Workflow\\Inelastic;PythonAlgorithms;CorrectionFunctions\\AbsorptionCorrections;Workflow\\MIDAS"
+        return "Workflow\\Inelastic;CorrectionFunctions\\AbsorptionCorrections;Workflow\\MIDAS"
 
 
     def summary(self):
diff --git a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/IndirectCalibration.py b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/IndirectCalibration.py
index ac91de07fc00ca8d77a8ac3608f2474fb54e925d..b988df3c04d0178342b554261e35a5b6d5bab3e3 100644
--- a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/IndirectCalibration.py
+++ b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/IndirectCalibration.py
@@ -18,7 +18,7 @@ class IndirectCalibration(DataProcessorAlgorithm):
 
 
     def category(self):
-        return 'Workflow\\Inelastic;PythonAlgorithms;Inelastic'
+        return 'Workflow\\Inelastic;Inelastic\\Calibration'
 
 
     def summary(self):
diff --git a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/IndirectCylinderAbsorption.py b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/IndirectCylinderAbsorption.py
index b0c0f7ff51f615060308b333e1375ba2c569923c..20788fcbbd613eb02e8bc515e303db2738048f3d 100644
--- a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/IndirectCylinderAbsorption.py
+++ b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/IndirectCylinderAbsorption.py
@@ -25,7 +25,7 @@ class IndirectCylinderAbsorption(DataProcessorAlgorithm):
 
 
     def category(self):
-        return "Workflow\\Inelastic;PythonAlgorithms;CorrectionFunctions\\AbsorptionCorrections;Workflow\\MIDAS"
+        return "Workflow\\Inelastic;CorrectionFunctions\\AbsorptionCorrections;Workflow\\MIDAS"
 
 
     def summary(self):
diff --git a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/IndirectFlatPlateAbsorption.py b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/IndirectFlatPlateAbsorption.py
index 3034d13f565467cdd277e285d1f12f913ef6e8ea..49918d11a7bbc9da561ca7fba5eb29c14a9b2737 100644
--- a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/IndirectFlatPlateAbsorption.py
+++ b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/IndirectFlatPlateAbsorption.py
@@ -28,7 +28,7 @@ class IndirectFlatPlateAbsorption(DataProcessorAlgorithm):
 
 
     def category(self):
-        return "Workflow\\Inelastic;PythonAlgorithms;CorrectionFunctions\\AbsorptionCorrections;Workflow\\MIDAS"
+        return "Workflow\\Inelastic;CorrectionFunctions\\AbsorptionCorrections;Workflow\\MIDAS"
 
 
     def summary(self):
diff --git a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/IndirectILLReduction.py b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/IndirectILLReduction.py
index 10bf21c20ddaa393ba6df080da6b7329e79b1f98..c16e587ed7884e8809648f9368650333c92634d6 100644
--- a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/IndirectILLReduction.py
+++ b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/IndirectILLReduction.py
@@ -27,7 +27,7 @@ class IndirectILLReduction(DataProcessorAlgorithm):
     _calibration_workspace = None
 
     def category(self):
-        return "Workflow\\MIDAS;Inelastic;PythonAlgorithms"
+        return "Workflow\\MIDAS;Inelastic\\Reduction"
 
 
     def summary(self):
diff --git a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/IndirectResolution.py b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/IndirectResolution.py
index a88ea9986fe34518ff87fa6def56c65499984feb..0c75bb15d5dcb9a89c5d858aea6e18b5ab431af3 100644
--- a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/IndirectResolution.py
+++ b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/IndirectResolution.py
@@ -19,7 +19,7 @@ class IndirectResolution(DataProcessorAlgorithm):
 
 
     def category(self):
-        return 'Workflow\\Inelastic;PythonAlgorithms;Inelastic'
+        return 'Workflow\\Inelastic;Inelastic\\Indirect'
 
 
     def summary(self):
diff --git a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/IndirectTransmissionMonitor.py b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/IndirectTransmissionMonitor.py
index 3cc79bdb412fe5babe272af18f04935ad2fb8834..23eeb56b94e0ff2312983005eace40a7621d5250 100644
--- a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/IndirectTransmissionMonitor.py
+++ b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/IndirectTransmissionMonitor.py
@@ -14,7 +14,7 @@ class IndirectTransmissionMonitor(PythonAlgorithm):
 
 
     def category(self):
-        return "Workflow\\Inelastic;PythonAlgorithms;Inelastic"
+        return "Workflow\\Inelastic;Inelastic\\Indirect"
 
 
     def summary(self):
diff --git a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/MolDyn.py b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/MolDyn.py
index 9ea95741c053f94e1a2cd979f2f5129afdcdc168..b6b07a5b84b8dba1d510413678ffe79f3e7a6e1f 100644
--- a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/MolDyn.py
+++ b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/MolDyn.py
@@ -12,7 +12,7 @@ class MolDyn(PythonAlgorithm):
 
 
     def category(self):
-        return 'Workflow\\Inelastic;PythonAlgorithms;Inelastic;Simulation'
+        return 'Workflow\\Inelastic;Inelastic\\DataHandling;Simulation'
 
 
     def summary(self):
diff --git a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/MuscatData.py b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/MuscatData.py
index 0bbef2e5396644d8bad5bcf4f50a159b4f4bc894..7ccb3b9ba0e9ce18048654f137b063ac69c448cb 100644
--- a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/MuscatData.py
+++ b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/MuscatData.py
@@ -6,7 +6,7 @@ from mantid.kernel import StringListValidator, StringMandatoryValidator
 class MuscatData(PythonAlgorithm):
 
     def category(self):
-        return "Workflow\\MIDAS;PythonAlgorithms"
+        return "Workflow\\MIDAS"
 
     def summary(self):
         return "Calculates multiple scattering using a sample S(Q,w)."
diff --git a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/MuscatFunc.py b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/MuscatFunc.py
index d6d8912d390f3cd9294a6bd16a937d6f79da6105..39a0bff029baf616fa64f895d52dbac35f34d8f3 100644
--- a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/MuscatFunc.py
+++ b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/MuscatFunc.py
@@ -6,7 +6,7 @@ from mantid.api import PythonAlgorithm, AlgorithmFactory
 class MuscatFunc(PythonAlgorithm):
 
     def category(self):
-        return "Workflow\\MIDAS;PythonAlgorithms"
+        return "Workflow\\MIDAS"
 
     def summary(self):
         return "Calculates multiple scattering using S(Q,w) from specified functions."
diff --git a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/OSIRISDiffractionReduction.py b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/OSIRISDiffractionReduction.py
index 682140babe6867a48efc7eb0d20e391b1f7f8e35..462748040cc31822e73229f541b01d88920b426c 100644
--- a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/OSIRISDiffractionReduction.py
+++ b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/OSIRISDiffractionReduction.py
@@ -209,7 +209,7 @@ class OSIRISDiffractionReduction(PythonAlgorithm):
 
 
     def category(self):
-        return 'Diffraction;PythonAlgorithms'
+        return 'Diffraction\\Reduction'
 
     def summary(self):
         return "This Python algorithm performs the operations necessary for the reduction of diffraction data "+\
diff --git a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/QLines.py b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/QLines.py
index eb58bfd9e2ccd1dbcee12ef6ef5eced06afc5ed3..f0ff7541a032b4fd5b06563fb9562abf72057219 100644
--- a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/QLines.py
+++ b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/QLines.py
@@ -8,7 +8,7 @@ import os
 class QLines(PythonAlgorithm):
 
     def category(self):
-        return "Workflow\\MIDAS;PythonAlgorithms"
+        return "Workflow\\MIDAS"
 
     def summary(self):
         return "The program estimates the quasielastic components of each of the groups of spectra and "+\
diff --git a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/Quest.py b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/Quest.py
index 2f0bea460b3b5f3f54b6289e2ad00cfbb56baabd..7c20f5752179cab84ce9a078736b60950a929ee7 100644
--- a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/Quest.py
+++ b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/Quest.py
@@ -8,7 +8,7 @@ import os
 class Quest(PythonAlgorithm):
 
     def category(self):
-        return "Workflow\\MIDAS;PythonAlgorithms"
+        return "Workflow\\MIDAS"
 
     def summary(self):
         return "This is a variation of the stretched exponential option of Quasi."
diff --git a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ResNorm2.py b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ResNorm2.py
index 461f44dfac4040837f72c838ae4e1d8c4fd1a4a2..03c36e157247c4327ef113a8b927ccecdbc44619 100644
--- a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ResNorm2.py
+++ b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ResNorm2.py
@@ -18,7 +18,7 @@ class ResNorm(PythonAlgorithm):
 
 
     def category(self):
-        return "Workflow\\MIDAS;PythonAlgorithms"
+        return "Workflow\\MIDAS"
 
 
     def summary(self):
diff --git a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/SavePlot1D.py b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/SavePlot1D.py
index f27c92fd462c9b590db148f13ce4117f56e392f8..c8974dcf3d11fb0de9969ce7c7e239feccea9639 100644
--- a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/SavePlot1D.py
+++ b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/SavePlot1D.py
@@ -8,7 +8,7 @@ class SavePlot1D(mantid.api.PythonAlgorithm):
     def category(self):
         """ Category
         """
-        return "Utility;PythonAlgorithms"
+        return "DataHandling\\Plots"
 
     def name(self):
         """ Algorithm name
diff --git a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/SofQWMoments.py b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/SofQWMoments.py
index fa4cc3fe49c591a2e131ee24f8a306ed24ca65a7..8b5cf7f7165fcf89e54b7ca10f5f96b116ce6db9 100644
--- a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/SofQWMoments.py
+++ b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/SofQWMoments.py
@@ -12,7 +12,7 @@ import numpy as np
 class SofQWMoments(DataProcessorAlgorithm):
 
     def category(self):
-        return "Workflow\\MIDAS;PythonAlgorithms"
+        return "Workflow\\MIDAS"
 
 
     def summary (self):
diff --git a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/TOSCABankCorrection.py b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/TOSCABankCorrection.py
index 498867d9255d05bbc559622ab1771f212f60acb0..fff35fbf4419f769c19441e2b6eed9cda95ccfc4 100644
--- a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/TOSCABankCorrection.py
+++ b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/TOSCABankCorrection.py
@@ -15,7 +15,7 @@ class TOSCABankCorrection(DataProcessorAlgorithm):
 
 
     def category(self):
-        return 'PythonAlgorithms;Inelastic;CorrectionFunctions'
+        return 'Inelastic\\Corrections;CorrectionFunctions\\SpecialCorrections'
 
 
     def summary(self):
diff --git a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/TimeSlice.py b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/TimeSlice.py
index 021a4d1e4d7a1f4c7aef079cdfe68df024b1c6f1..8b29268a248935f7d752866b6e440f7c0d5bd902 100644
--- a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/TimeSlice.py
+++ b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/TimeSlice.py
@@ -57,7 +57,7 @@ class TimeSlice(PythonAlgorithm):
     _out_ws_group = None
 
     def category(self):
-        return 'PythonAlgorithms;Inelastic'
+        return 'Inelastic\\Utility'
 
 
     def summary(self):
diff --git a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/TransformToIqt.py b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/TransformToIqt.py
index 0f7907e7e4cc59741e4f4e68d5d702a505ea6375..ac01695a1b455e68cd9132b1976baa6e46cfd0ca 100644
--- a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/TransformToIqt.py
+++ b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/TransformToIqt.py
@@ -21,7 +21,7 @@ class TransformToIqt(PythonAlgorithm):
 
 
     def category(self):
-        return "Workflow\\Inelastic;PythonAlgorithms;Workflow\\MIDAS"
+        return "Workflow\\Inelastic;Workflow\\MIDAS"
 
 
     def summary(self):
diff --git a/Framework/PythonInterface/test/python/mantid/api/AlgorithmPropertyTest.py b/Framework/PythonInterface/test/python/mantid/api/AlgorithmPropertyTest.py
index 487c2280dba648c6d2373fa7faf38cb649783d45..bbe763ccb594d746adab95e246ea5dc13ccb0143 100644
--- a/Framework/PythonInterface/test/python/mantid/api/AlgorithmPropertyTest.py
+++ b/Framework/PythonInterface/test/python/mantid/api/AlgorithmPropertyTest.py
@@ -11,7 +11,7 @@ class AlgorithmPropertyTest(unittest.TestCase):
 
     def test_value_method_returns_an_algorithm_type(self):
         prop = AlgorithmProperty("TestProperty")
-        prop.valueAsStr = 'CreateWorkspace(OutputWorkspace="ws",DataY="1",DataX="1",NSpec=1'
+        prop.valueAsStr = '{"name":"CreateWorkspace","paramters":{"OutputWorkspace":"ws","DataY":"1","DataX":"1","NSpec":"1"}}'
 
         alg = prop.value
         self.assertTrue(isinstance(alg,IAlgorithm))
diff --git a/Framework/PythonInterface/test/python/mantid/api/AlgorithmTest.py b/Framework/PythonInterface/test/python/mantid/api/AlgorithmTest.py
index 155cc3f932897a0d1118aa6e90b44e6b3a7f6824..7880e0ade0295cf66ac3d778eebfc2d1b2474a9d 100644
--- a/Framework/PythonInterface/test/python/mantid/api/AlgorithmTest.py
+++ b/Framework/PythonInterface/test/python/mantid/api/AlgorithmTest.py
@@ -49,7 +49,7 @@ class AlgorithmTest(unittest.TestCase):
         self.assertTrue(ws.getMemorySize() > 0.0 )
 
         as_str = str(alg)
-        self.assertEquals(as_str, "CreateWorkspace.1(OutputWorkspace=UNUSED_NAME_FOR_CHILD,DataX=1,2,3,DataY=1,2,3,UnitX=Wavelength)")
+        self.assertEquals(as_str, '{"name":"CreateWorkspace","properties":{"DataX":"1,2,3","DataY":"1,2,3","OutputWorkspace":"UNUSED_NAME_FOR_CHILD","UnitX":"Wavelength"},"version":1}\n')
 
     def test_getAlgorithmID_returns_AlgorithmID_object(self):
         alg = AlgorithmManager.createUnmanaged('Load')
diff --git a/Framework/SINQ/inc/MantidSINQ/InvertMDDim.h b/Framework/SINQ/inc/MantidSINQ/InvertMDDim.h
index ff111d602954168d94a8e3bde154331d8b8d5594..f52abdc3a251c136ac566ba0ec954d9f7ee16b9a 100644
--- a/Framework/SINQ/inc/MantidSINQ/InvertMDDim.h
+++ b/Framework/SINQ/inc/MantidSINQ/InvertMDDim.h
@@ -49,7 +49,9 @@ public:
   /// Algorithm's version
   virtual int version() const { return (1); }
   /// Algorithm's category for identification
-  virtual const std::string category() const { return "MDAlgorithms"; }
+  virtual const std::string category() const {
+    return "MDAlgorithms\\Transforms";
+  }
 
 private:
   /// Initialisation code
diff --git a/Framework/SINQ/inc/MantidSINQ/MDHistoToWorkspace2D.h b/Framework/SINQ/inc/MantidSINQ/MDHistoToWorkspace2D.h
index 58293dbd1930dea6d39c55ec2d4fa1e4c169a53a..9b79b8e63b7d21aa988fff52854264e2d6b6d3e8 100644
--- a/Framework/SINQ/inc/MantidSINQ/MDHistoToWorkspace2D.h
+++ b/Framework/SINQ/inc/MantidSINQ/MDHistoToWorkspace2D.h
@@ -52,7 +52,9 @@ public:
   /// Algorithm's version
   virtual int version() const { return (1); }
   /// Algorithm's category for identification
-  virtual const std::string category() const { return "MDAlgorithms"; }
+  virtual const std::string category() const {
+    return "MDAlgorithms\\Transforms";
+  }
 
 private:
   /// Initialisation code
diff --git a/Framework/SINQ/inc/MantidSINQ/PoldiUtilities/PoldiMockInstrumentHelpers.h b/Framework/SINQ/inc/MantidSINQ/PoldiUtilities/PoldiMockInstrumentHelpers.h
index 717702c21ffc041133aeb9c79238e12b23759e12..fa1e79eafbf861dd80aac4f3bb59767deedffba4 100644
--- a/Framework/SINQ/inc/MantidSINQ/PoldiUtilities/PoldiMockInstrumentHelpers.h
+++ b/Framework/SINQ/inc/MantidSINQ/PoldiUtilities/PoldiMockInstrumentHelpers.h
@@ -528,7 +528,7 @@ public:
     BraggScatterer_sptr atomSi =
         BraggScattererFactory::Instance().createScatterer(
             "IsotropicAtomBraggScatterer",
-            "Element=Si;Position=[0,0,0];U=0.005");
+            "{\"Element\":\"Si\",\"Position\":\"0,0,0\",\"U\":\"0.005\"}");
     CompositeBraggScatterer_sptr atoms = CompositeBraggScatterer::create();
     atoms->addScatterer(atomSi);
 
diff --git a/Framework/SINQ/inc/MantidSINQ/ProjectMD.h b/Framework/SINQ/inc/MantidSINQ/ProjectMD.h
index acb7dd9cea0d973c92bce62eb9899fd5b770c7c0..2c81a71345aeae26a7a9e70ae5feed810c35b8ba 100644
--- a/Framework/SINQ/inc/MantidSINQ/ProjectMD.h
+++ b/Framework/SINQ/inc/MantidSINQ/ProjectMD.h
@@ -48,7 +48,7 @@ public:
   /// Algorithm's version
   virtual int version() const { return (1); }
   /// Algorithm's category for identification
-  virtual const std::string category() const { return "MDAlgorithms"; }
+  virtual const std::string category() const { return "MDAlgorithms\\Slicing"; }
 
 private:
   /// Initialisation code
diff --git a/Framework/SINQ/inc/MantidSINQ/SINQTranspose3D.h b/Framework/SINQ/inc/MantidSINQ/SINQTranspose3D.h
index 862aea97d2671aac13d45818290bd2145fe87aef..259cffe5b38f23a895456a9359dc01ca5e01f80f 100644
--- a/Framework/SINQ/inc/MantidSINQ/SINQTranspose3D.h
+++ b/Framework/SINQ/inc/MantidSINQ/SINQTranspose3D.h
@@ -55,7 +55,9 @@ public:
   /// Algorithm's version
   virtual int version() const { return (1); }
   /// Algorithm's category for identification
-  virtual const std::string category() const { return "MDAlgorithms"; }
+  virtual const std::string category() const {
+    return "MDAlgorithms\\Transforms";
+  }
 
 private:
   /// Initialisation code
diff --git a/Framework/SINQ/inc/MantidSINQ/SliceMDHisto.h b/Framework/SINQ/inc/MantidSINQ/SliceMDHisto.h
index 276f146829f767370fbf1ecaad4fefe341ea1a8f..2445c8c084c01a293212b03df8927d6fabfea06c 100644
--- a/Framework/SINQ/inc/MantidSINQ/SliceMDHisto.h
+++ b/Framework/SINQ/inc/MantidSINQ/SliceMDHisto.h
@@ -48,7 +48,7 @@ public:
   /// Algorithm's version
   virtual int version() const { return (1); }
   /// Algorithm's category for identification
-  virtual const std::string category() const { return "MDAlgorithms"; }
+  virtual const std::string category() const { return "MDAlgorithms\\Slicing"; }
 
 private:
   /// Initialisation code
diff --git a/Framework/SINQ/test/PoldiPeakCollectionTest.h b/Framework/SINQ/test/PoldiPeakCollectionTest.h
index 6d75c9df41d49c48e1a5ed0365bb5018ad959b9b..7c218c80e0b647965c94357c3977a91760dfddfe 100644
--- a/Framework/SINQ/test/PoldiPeakCollectionTest.h
+++ b/Framework/SINQ/test/PoldiPeakCollectionTest.h
@@ -386,9 +386,10 @@ private:
 
     BraggScatterer_sptr cs = BraggScattererFactory::Instance().createScatterer(
         "IsotropicAtomBraggScatterer",
-        "Element=Cs;Position=[0.5,0.5,0.5];U=0.005");
+        "{\"Element\":\"Cs\",\"Position\":\"0.5,0.5,0.5\",\"U\":\"0.005\"}");
     BraggScatterer_sptr cl = BraggScattererFactory::Instance().createScatterer(
-        "IsotropicAtomBraggScatterer", "Element=Cl;Position=[0,0,0];U=0.005");
+        "IsotropicAtomBraggScatterer",
+        "{\"Element\":\"Cl\",\"Position\":\"0,0,0\",\"U\":\"0.005\"}");
 
     CompositeBraggScatterer_sptr atoms = CompositeBraggScatterer::create();
     atoms->addScatterer(cs);
diff --git a/Framework/UserAlgorithms/SConstruct b/Framework/UserAlgorithms/SConstruct
index 4b54d99b505f8e2f0a95f30a2b4ad388801e62ed..f8338933ecad03ef230e795d470c17c22581e08e 100644
--- a/Framework/UserAlgorithms/SConstruct
+++ b/Framework/UserAlgorithms/SConstruct
@@ -30,20 +30,22 @@ env = Environment(ENV=os.environ,
                            'MantidAPI',
                            'MantidGeometry',
                            'MantidDataObjects',
-                           'MantidCurveFitting'
+                           'MantidCurveFitting',
+                           'boost_date_time-mt'
                          ], 
                   LINKFLAGS = link_flags,
                   CCFLAGS = ['/nologo','/Ox', '/Ot','/GL', '/W3','/EHsc', '/MD', '/TP','/wd4251', '/wd4275', '/wd4996'],
                   CPPDEFINES = ['NDEBUG', '_SCL_SECURE_NO_WARNINGS', '_CRT_SECURE_NO_WARNINGS', '_CRT_SECURE_NO_DEPRECATE',\
                                 '_CRT_NONSTDC_NO_DEPRECATE', '_SCL_SECURE_NO_DEPRECATE', ('MS_VISUAL_STUDIO','1'),\
                                 ('WINVER','0x0500'), 'BOOST_ALL_DYN_LINK', 'BOOST_DATE_TIME_POSIX_TIME_STD_CONFIG',\
-                                'NOMINMAX','_USE_MATH_DEFINES', 'WNT','WIN32','_WINDOWS', 'POCO_DLL', 'GSL_DLL']
+                                'BOOST_ALL_NO_LIB','NOMINMAX','_USE_MATH_DEFINES', 'WNT','WIN32','_WINDOWS', 'POCO_DLL',\
+                                'GSL_DLL']
                   )
 # Check whether we should include the OpenMP flag
 conf = Configure(env)
 if conf.CheckLib('vcomp'):
     env.Append(CCFLAGS=['/openmp'])
-			
+
 # The output library name will be the same as the directory that the build is run from
 cwd = os.getcwd()
 lib_name = os.path.basename(os.getcwd()) 
diff --git a/Framework/WorkflowAlgorithms/src/SendUsage.cpp b/Framework/WorkflowAlgorithms/src/SendUsage.cpp
index c8c2e87b64417fe78028c8c937190b93f46ac9aa..3e0426e53bb5d74a9cfc366227a8bb24ebf322ee 100644
--- a/Framework/WorkflowAlgorithms/src/SendUsage.cpp
+++ b/Framework/WorkflowAlgorithms/src/SendUsage.cpp
@@ -76,7 +76,7 @@ const std::string SendUsage::name() const { return "SendUsage"; }
 int SendUsage::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
-const std::string SendUsage::category() const { return "Workflow"; }
+const std::string SendUsage::category() const { return "Workflow\\Reporting"; }
 
 /// Algorithm's summary for use in the GUI and help. @see Algorithm::summary
 const std::string SendUsage::summary() const {
diff --git a/MantidPlot/src/Mantid/MantidUI.cpp b/MantidPlot/src/Mantid/MantidUI.cpp
index 8c762182bbce47f5c38c09779c573bdc6d47a758..60b8d9f7a268533e70d1a6e81888d75c6bf6524e 100644
--- a/MantidPlot/src/Mantid/MantidUI.cpp
+++ b/MantidPlot/src/Mantid/MantidUI.cpp
@@ -1542,24 +1542,7 @@ void MantidUI::executeAlgorithm(Mantid::API::IAlgorithm_sptr alg)
   executeAlgorithmAsync(alg);
 }
 
-/**
-* Execute an algorithm
-* @param algName :: The algorithm name
-* @param paramList :: A list of algorithm properties to be passed to Algorithm::setProperties
-* @param obs :: A pointer to an instance of AlgorithmObserver which will be attached to the finish notification
-*/
-void MantidUI::executeAlgorithm(const QString & algName, const QString & paramList, Mantid::API::AlgorithmObserver* obs)
-{
-  //Get latest version of the algorithm
-  Mantid::API::IAlgorithm_sptr alg = this->createAlgorithm(algName, -1);
-  if( !alg ) return;
-  if (obs)
-  {
-    obs->observeFinish(alg);
-  }
-  alg->setProperties(paramList.toStdString());
-  executeAlgorithmAsync(alg);
-}
+
 
 /**
 * This creates an algorithm dialog (the default property entry thingie).
diff --git a/MantidPlot/src/Mantid/MantidUI.h b/MantidPlot/src/Mantid/MantidUI.h
index caa2a32949123fcb7523f2a6048fe51a3de9c1ba..4edc755bd5bb724684e837732fa87614b7891c1c 100644
--- a/MantidPlot/src/Mantid/MantidUI.h
+++ b/MantidPlot/src/Mantid/MantidUI.h
@@ -398,8 +398,6 @@ signals:
     void showAlgorithmDialog(QString algName, QHash<QString, QString> paramList, Mantid::API::AlgorithmObserver *obs = NULL, int version = -1);
     // Execute an algorithm
     void executeAlgorithm(Mantid::API::IAlgorithm_sptr alg);
-    // Execute a named algorithm using the given parameters
-    void executeAlgorithm(const QString & algName, const QString & paramList, Mantid::API::AlgorithmObserver* obs);
 
     // Find the name of the first input workspace for an algorithm
     QString findInputWorkspaceProperty(Mantid::API::IAlgorithm_sptr algorithm) const;
diff --git a/MantidQt/CustomDialogs/src/StartLiveDataDialog.cpp b/MantidQt/CustomDialogs/src/StartLiveDataDialog.cpp
index 65955fef6b5da0bc712877e7e9b842e885b24aaf..d982b9c0bffa46e67bb9ad7e1924747d3c2e1b75 100644
--- a/MantidQt/CustomDialogs/src/StartLiveDataDialog.cpp
+++ b/MantidQt/CustomDialogs/src/StartLiveDataDialog.cpp
@@ -225,7 +225,7 @@ void StartLiveDataDialog::parseInput()
   {
     storePropertyValue("ProcessingAlgorithm", ui.processingAlgo->getSelectedAlgorithm());
     std::string props;
-    props = m_processingAlg->asString(false, ';'); /* use semicolon to properly separate the props */
+    props = m_processingAlg->asString(false); 
     storePropertyValue("ProcessingProperties", QString::fromStdString(props));
   }
   else if (m_useProcessScript)
@@ -238,7 +238,7 @@ void StartLiveDataDialog::parseInput()
   {
     storePropertyValue("PostProcessingAlgorithm", ui.postAlgo->getSelectedAlgorithm());
     std::string props;
-    props = m_postProcessingAlg->asString(false, ';'); /* use semicolon to properly separate the props */
+    props = m_postProcessingAlg->asString(false); 
     storePropertyValue("PostProcessingProperties", QString::fromStdString(props));
   }
   else if (m_usePostProcessScript)
diff --git a/MantidQt/CustomInterfaces/CMakeLists.txt b/MantidQt/CustomInterfaces/CMakeLists.txt
index f51c5258d86a87e8903454f93ac608675621db5f..d5df9abbff18bb703b58ff8fef8d0c5424e30a9f 100644
--- a/MantidQt/CustomInterfaces/CMakeLists.txt
+++ b/MantidQt/CustomInterfaces/CMakeLists.txt
@@ -47,7 +47,6 @@ set ( SRC_FILES
 	src/Indirect/Stretch.cpp
 	src/MantidEV.cpp
 	src/MantidEVWorker.cpp
-	src/Measurement.cpp
 	src/MultiDatasetFit/MDFAddWorkspaceDialog.cpp
 	src/MultiDatasetFit/MDFDataController.cpp
 	src/MultiDatasetFit/MDFDatasetPlotData.cpp
@@ -73,17 +72,18 @@ set ( SRC_FILES
 	src/Muon/MuonAnalysisOptionTab.cpp
 	src/Muon/MuonAnalysisResultTableTab.cpp
 	src/ParseKeyValueString.cpp
-	src/QReflTableModel.cpp
-	src/QtReflMainView.cpp
-	src/QtReflOptionsDialog.cpp
-	src/ReflCatalogSearcher.cpp
-	src/ReflGenerateNotebook.cpp
-	src/ReflLegacyTransferStrategy.cpp
-	src/ReflMainViewPresenter.cpp
-	src/ReflMeasureTransferStrategy.cpp
-	src/ReflNexusMeasurementSource.cpp
-	src/ReflSearchModel.cpp
-	src/ReflTableSchema.cpp
+	src/Reflectometry/MeasurementItem.cpp
+	src/Reflectometry/QReflTableModel.cpp
+	src/Reflectometry/QtReflMainView.cpp
+	src/Reflectometry/QtReflOptionsDialog.cpp
+	src/Reflectometry/ReflCatalogSearcher.cpp
+	src/Reflectometry/ReflGenerateNotebook.cpp
+	src/Reflectometry/ReflLegacyTransferStrategy.cpp
+	src/Reflectometry/ReflMainViewPresenter.cpp
+	src/Reflectometry/ReflMeasureTransferStrategy.cpp
+	src/Reflectometry/ReflNexusMeasurementItemSource.cpp
+	src/Reflectometry/ReflSearchModel.cpp
+	src/Reflectometry/ReflTableSchema.cpp
 	src/SANSAddFiles.cpp
 	src/SANSConstants.cpp
 	src/SANSDiagnostics.cpp
@@ -121,8 +121,6 @@ set ( INC_FILES
 	inc/MantidQtCustomInterfaces/EnggDiffraction/IEnggDiffractionPresenter.h
 	inc/MantidQtCustomInterfaces/EnggDiffraction/IEnggDiffractionView.h
 	inc/MantidQtCustomInterfaces/Homer.h
-	inc/MantidQtCustomInterfaces/IReflPresenter.h
-	inc/MantidQtCustomInterfaces/IReflSearcher.h
 	inc/MantidQtCustomInterfaces/Indirect/AbsorptionCorrections.h
 	inc/MantidQtCustomInterfaces/Indirect/ApplyPaalmanPings.h
 	inc/MantidQtCustomInterfaces/Indirect/CalculatePaalmanPings.h
@@ -166,7 +164,6 @@ set ( INC_FILES
 	inc/MantidQtCustomInterfaces/Indirect/Stretch.h
 	inc/MantidQtCustomInterfaces/MantidEV.h
 	inc/MantidQtCustomInterfaces/MantidEVWorker.h
-	inc/MantidQtCustomInterfaces/Measurement.h
 	inc/MantidQtCustomInterfaces/MultiDatasetFit/MDFAddWorkspaceDialog.h
 	inc/MantidQtCustomInterfaces/MultiDatasetFit/MDFDataController.h
 	inc/MantidQtCustomInterfaces/MultiDatasetFit/MDFDatasetPlotData.h
@@ -198,21 +195,24 @@ set ( INC_FILES
 	inc/MantidQtCustomInterfaces/Muon/MuonAnalysisResultTableTab.h
 	inc/MantidQtCustomInterfaces/ParseKeyValueString.h
 	inc/MantidQtCustomInterfaces/ProgressableView.h
-	inc/MantidQtCustomInterfaces/QReflTableModel.h
-	inc/MantidQtCustomInterfaces/QtReflMainView.h
-	inc/MantidQtCustomInterfaces/QtReflOptionsDialog.h
-	inc/MantidQtCustomInterfaces/ReflCatalogSearcher.h
-	inc/MantidQtCustomInterfaces/ReflGenerateNotebook.h
-	inc/MantidQtCustomInterfaces/ReflLegacyTransferStrategy.h
-	inc/MantidQtCustomInterfaces/ReflMainView.h
-	inc/MantidQtCustomInterfaces/ReflMainViewPresenter.h
-	inc/MantidQtCustomInterfaces/ReflMeasureTransferStrategy.h
-	inc/MantidQtCustomInterfaces/ReflMeasurementSource.h
-	inc/MantidQtCustomInterfaces/ReflNexusMeasurementSource.h
-	inc/MantidQtCustomInterfaces/ReflSearchModel.h
-	inc/MantidQtCustomInterfaces/ReflTableSchema.h
-	inc/MantidQtCustomInterfaces/ReflTransferStrategy.h
-	inc/MantidQtCustomInterfaces/ReflVectorString.h
+	inc/MantidQtCustomInterfaces/Reflectometry/IReflPresenter.h
+	inc/MantidQtCustomInterfaces/Reflectometry/IReflSearcher.h
+	inc/MantidQtCustomInterfaces/Reflectometry/MeasurementItem.h
+	inc/MantidQtCustomInterfaces/Reflectometry/QReflTableModel.h
+	inc/MantidQtCustomInterfaces/Reflectometry/QtReflMainView.h
+	inc/MantidQtCustomInterfaces/Reflectometry/QtReflOptionsDialog.h
+	inc/MantidQtCustomInterfaces/Reflectometry/ReflCatalogSearcher.h
+	inc/MantidQtCustomInterfaces/Reflectometry/ReflGenerateNotebook.h
+	inc/MantidQtCustomInterfaces/Reflectometry/ReflLegacyTransferStrategy.h
+	inc/MantidQtCustomInterfaces/Reflectometry/ReflMainView.h
+	inc/MantidQtCustomInterfaces/Reflectometry/ReflMainViewPresenter.h
+	inc/MantidQtCustomInterfaces/Reflectometry/ReflMeasureTransferStrategy.h
+	inc/MantidQtCustomInterfaces/Reflectometry/ReflMeasurementItemSource.h
+	inc/MantidQtCustomInterfaces/Reflectometry/ReflNexusMeasurementItemSource.h
+	inc/MantidQtCustomInterfaces/Reflectometry/ReflSearchModel.h
+	inc/MantidQtCustomInterfaces/Reflectometry/ReflTableSchema.h
+	inc/MantidQtCustomInterfaces/Reflectometry/ReflTransferStrategy.h
+	inc/MantidQtCustomInterfaces/Reflectometry/ReflVectorString.h
 	inc/MantidQtCustomInterfaces/SANSAddFiles.h
 	inc/MantidQtCustomInterfaces/SANSConstants.h
 	inc/MantidQtCustomInterfaces/SANSDiagnostics.h
@@ -317,10 +317,10 @@ set ( MOC_FILES inc/MantidQtCustomInterfaces/Background.h
                 inc/MantidQtCustomInterfaces/Muon/MuonAnalysisHelper.h
                 inc/MantidQtCustomInterfaces/Muon/MuonAnalysisOptionTab.h
                 inc/MantidQtCustomInterfaces/Muon/MuonAnalysisResultTableTab.h
-                inc/MantidQtCustomInterfaces/ReflSearchModel.h
-                inc/MantidQtCustomInterfaces/QReflTableModel.h
-                inc/MantidQtCustomInterfaces/QtReflMainView.h
-                inc/MantidQtCustomInterfaces/QtReflOptionsDialog.h
+                inc/MantidQtCustomInterfaces/Reflectometry/ReflSearchModel.h
+                inc/MantidQtCustomInterfaces/Reflectometry/QReflTableModel.h
+                inc/MantidQtCustomInterfaces/Reflectometry/QtReflMainView.h
+                inc/MantidQtCustomInterfaces/Reflectometry/QtReflOptionsDialog.h
                 inc/MantidQtCustomInterfaces/SampleTransmission.h
                 inc/MantidQtCustomInterfaces/SANSAddFiles.h
                 inc/MantidQtCustomInterfaces/SANSPlotSpecial.h
@@ -384,9 +384,9 @@ set ( UI_FILES inc/MantidQtCustomInterfaces/DataComparison.ui
                inc/MantidQtCustomInterfaces/Muon/ALCInterface.ui
                inc/MantidQtCustomInterfaces/Muon/ALCPeakFittingView.ui
                inc/MantidQtCustomInterfaces/Muon/MuonAnalysis.ui
-               inc/MantidQtCustomInterfaces/ReflMainWidget.ui
-               inc/MantidQtCustomInterfaces/ReflOptionsDialog.ui
-               inc/MantidQtCustomInterfaces/ReflWindow.ui
+               inc/MantidQtCustomInterfaces/Reflectometry/ReflMainWidget.ui
+               inc/MantidQtCustomInterfaces/Reflectometry/ReflOptionsDialog.ui
+               inc/MantidQtCustomInterfaces/Reflectometry/ReflWindow.ui
                inc/MantidQtCustomInterfaces/SampleTransmission.ui
                inc/MantidQtCustomInterfaces/SANSPlotSpecial.ui
                inc/MantidQtCustomInterfaces/SANSRunWindow.ui
@@ -411,14 +411,14 @@ set ( TEST_FILES
 	EnggDiffractionPresenterTest.h
 	IO_MuonGroupingTest.h
 	ImageROIPresenterTest.h
-	MeasurementTest.h
+	MeasurementItemTest.h
 	MuonAnalysisHelperTest.h
 	ParseKeyValueStringTest.h
 	ReflGenerateNotebookTest.h
 	ReflLegacyTransferStrategyTest.h
 	ReflMainViewPresenterTest.h
 	ReflMeasureTransferStrategyTest.h
-	ReflNexusMeasurementSourceTest.h
+	ReflNexusMeasurementItemSourceTest.h
 	StackOfImagesDirsTest.h
 	TomographyIfacePresenterTest.h
 	UserInputValidatorTest.h
diff --git a/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/MantidEV.ui b/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/MantidEV.ui
index 4906f166dbcb095a57fff07ca31a045459a3fce7..444a801ee7c1922ac59b39bed0e278bb2ec0724b 100644
--- a/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/MantidEV.ui
+++ b/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/MantidEV.ui
@@ -250,7 +250,7 @@
                    <item>
                     <widget class="QLabel" name="MinMagQ_lbl">
                      <property name="text">
-                      <string>Min |Q| to Map to MD</string>
+                      <string>Qmin to Map to MD</string>
                      </property>
                     </widget>
                    </item>
@@ -282,7 +282,7 @@
                       </size>
                      </property>
                      <property name="toolTip">
-                      <string>Specify value to use as bound on |Qx|, |Qy| and |Qz|</string>
+                      <string>Specify value to use as lower bound of Qx, Qy and Qz. Default is -Qmax</string>
                      </property>
                     </widget>
                    </item>
@@ -293,7 +293,7 @@
                    <item>
                     <widget class="QLabel" name="MaxMagQ_lbl">
                      <property name="text">
-                      <string>Max |Q| to Map to MD</string>
+                      <string>Qmax to Map to MD</string>
                      </property>
                     </widget>
                    </item>
@@ -325,7 +325,7 @@
                       </size>
                      </property>
                      <property name="toolTip">
-                      <string>Specify value to use as bound on |Qx|, |Qy| and |Qz|</string>
+                      <string>Specify value to use as upper bound of Qx, Qy and Qz</string>
                      </property>
                     </widget>
                    </item>
diff --git a/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/IReflPresenter.h b/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/IReflPresenter.h
new file mode 100644
index 0000000000000000000000000000000000000000..9acf1b47564a38313f2d7b1cdeecaf941a68f1a2
--- /dev/null
+++ b/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/IReflPresenter.h
@@ -0,0 +1,77 @@
+#ifndef MANTID_CUSTOMINTERFACES_IREFLPRESENTER_H
+#define MANTID_CUSTOMINTERFACES_IREFLPRESENTER_H
+
+#include <map>
+#include <string>
+
+#include "MantidKernel/System.h"
+
+#include <QVariant>
+
+namespace MantidQt
+{
+  namespace CustomInterfaces
+  {
+    /** @class IReflPresenter
+
+    IReflPresenter is an interface which defines the functions any reflectometry interface presenter needs to support.
+
+    Copyright &copy; 2011-14 ISIS Rutherford Appleton Laboratory, NScD Oak Ridge National Laboratory & European Spallation Source
+
+    This file is part of Mantid.
+
+    Mantid is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 3 of the License, or
+    (at your option) any later version.
+
+    Mantid is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+    File change history is stored at: <https://github.com/mantidproject/mantid>.
+    Code Documentation is available at: <http://doxygen.mantidproject.org>
+    */
+    class IReflPresenter
+    {
+    public:
+      virtual ~IReflPresenter() {};
+
+      enum Flag
+      {
+        SaveFlag,
+        SaveAsFlag,
+        AppendRowFlag,
+        PrependRowFlag,
+        DeleteRowFlag,
+        ProcessFlag,
+        GroupRowsFlag,
+        OpenTableFlag,
+        NewTableFlag,
+        TableUpdatedFlag,
+        ExpandSelectionFlag,
+        OptionsDialogFlag,
+        ClearSelectedFlag,
+        CopySelectedFlag,
+        CutSelectedFlag,
+        PasteSelectedFlag,
+        SearchFlag,
+        TransferFlag,
+        ImportTableFlag,
+        ExportTableFlag,
+        PlotRowFlag,
+        PlotGroupFlag
+      };
+
+      //Tell the presenter something happened
+      virtual void notify(IReflPresenter::Flag flag) = 0;
+      virtual const std::map<std::string,QVariant>& options() const = 0;
+      virtual void setOptions(const std::map<std::string,QVariant>& options) = 0;
+    };
+  }
+}
+#endif
diff --git a/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/IReflSearcher.h b/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/IReflSearcher.h
new file mode 100644
index 0000000000000000000000000000000000000000..9ca40bae6b65de7ee69338283de198671a74945c
--- /dev/null
+++ b/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/IReflSearcher.h
@@ -0,0 +1,46 @@
+#ifndef MANTID_CUSTOMINTERFACES_IREFLSEARCHER_H
+#define MANTID_CUSTOMINTERFACES_IREFLSEARCHER_H
+
+#include <string>
+
+#include "MantidQtCustomInterfaces/Reflectometry/IReflPresenter.h"
+#include "MantidAPI/ITableWorkspace_fwd.h"
+
+namespace MantidQt
+{
+  namespace CustomInterfaces
+  {
+    /** @class IReflSearcher
+
+    IReflSearcher is an interface for search implementations used by IReflPresenter implementations.
+
+    Copyright &copy; 2011-14 ISIS Rutherford Appleton Laboratory, NScD Oak Ridge National Laboratory & European Spallation Source
+
+    This file is part of Mantid.
+
+    Mantid is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 3 of the License, or
+    (at your option) any later version.
+
+    Mantid is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+    File change history is stored at: <https://github.com/mantidproject/mantid>.
+    Code Documentation is available at: <http://doxygen.mantidproject.org>
+    */
+    class IReflSearcher
+    {
+    public:
+      virtual ~IReflSearcher() {};
+      virtual Mantid::API::ITableWorkspace_sptr
+      search(const std::string &text) = 0;
+    };
+  }
+}
+#endif
diff --git a/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Measurement.h b/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/MeasurementItem.h
similarity index 76%
rename from MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Measurement.h
rename to MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/MeasurementItem.h
index d2f441c9c32738acb43879f85a87d6d74ac61b52..d6672e8d416d973fc62e09f8171ca2f69b1447d5 100644
--- a/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Measurement.h
+++ b/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/MeasurementItem.h
@@ -1,5 +1,5 @@
-#ifndef MANTIDQT_CUSTOMINTERFACES_MEASUREMENT_H_
-#define MANTIDQT_CUSTOMINTERFACES_MEASUREMENT_H_
+#ifndef MANTIDQT_CUSTOMINTERFACES_MEASUREMENTITEM_H_
+#define MANTIDQT_CUSTOMINTERFACES_MEASUREMENTITEM_H_
 
 #include "MantidQtCustomInterfaces/DllConfig.h"
 #include <string>
@@ -30,24 +30,24 @@ namespace CustomInterfaces {
   File change history is stored at: <https://github.com/mantidproject/mantid>
   Code Documentation is available at: <http://doxygen.mantidproject.org>
 */
-class MANTIDQT_CUSTOMINTERFACES_DLL Measurement {
+class MANTIDQT_CUSTOMINTERFACES_DLL MeasurementItem {
 
 public:
   typedef std::string IDType;
 
   /// Constructor
-  Measurement(const IDType &measurementId, const IDType &subId,
+  MeasurementItem(const IDType &measurementItemId, const IDType &subId,
               const std::string &label, const std::string &type,
               const double angle, const std::string &run);
 
   /// Constructional method
-  static Measurement InvalidMeasurement(const std::string &why);
+  static MeasurementItem InvalidMeasurementItem(const std::string &why);
 
   /// Copy constructor
-  Measurement(const Measurement &other);
+  MeasurementItem(const MeasurementItem &other);
 
   /// Destructor
-  ~Measurement();
+  ~MeasurementItem();
 
   bool isUseable() const;
   std::string whyUnuseable() const;
@@ -58,12 +58,12 @@ public:
   std::string label() const;
   double angle() const;
   std::string angleStr() const;
-  Measurement &operator=(const Measurement &);
+  MeasurementItem &operator=(const MeasurementItem &);
 
 private:
   /// Constructor
-  Measurement(const std::string &why);
-  IDType m_measurementId;
+  MeasurementItem(const std::string &why);
+  IDType m_measurementItemId;
   IDType m_subId;
   std::string m_label;
   std::string m_type;
@@ -76,4 +76,4 @@ private:
 } // namespace CustomInterfaces
 } // namespace MantidQt
 
-#endif /* MANTIDQT_CUSTOMINTERFACES_MEASUREMENT_H_ */
+#endif /* MANTIDQT_CUSTOMINTERFACES_MEASUREMENTITEM_H_ */
diff --git a/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/QReflTableModel.h b/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/QReflTableModel.h
similarity index 98%
rename from MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/QReflTableModel.h
rename to MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/QReflTableModel.h
index c85592a48ae876353e35446655d7f1bb8545747a..e1354659f5f53066428da139d03f56be442eae15 100644
--- a/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/QReflTableModel.h
+++ b/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/QReflTableModel.h
@@ -4,7 +4,7 @@
 
 #include "MantidAPI/ITableWorkspace_fwd.h"
 #include "MantidQtCustomInterfaces/DllConfig.h"
-#include "MantidQtCustomInterfaces/ReflTableSchema.h"
+#include "MantidQtCustomInterfaces/Reflectometry/ReflTableSchema.h"
 #include <QAbstractTableModel>
 #include <boost/shared_ptr.hpp>
 #include <map>
diff --git a/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/QtReflMainView.h b/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/QtReflMainView.h
similarity index 95%
rename from MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/QtReflMainView.h
rename to MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/QtReflMainView.h
index b0c472c87379f1fa9fd9ef8cb3cc02500d908388..9b55d96b88e922513a108b0ec24d60e55d4876a9 100644
--- a/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/QtReflMainView.h
+++ b/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/QtReflMainView.h
@@ -5,10 +5,10 @@
 #include "MantidQtAPI/UserSubWindow.h"
 #include "MantidQtCustomInterfaces/DllConfig.h"
 #include "MantidQtCustomInterfaces/ProgressableView.h"
-#include "MantidQtCustomInterfaces/ReflMainView.h"
-#include "MantidQtCustomInterfaces/IReflPresenter.h"
-#include "MantidQtCustomInterfaces/ReflSearchModel.h"
-#include "MantidQtCustomInterfaces/QReflTableModel.h"
+#include "MantidQtCustomInterfaces/Reflectometry/ReflMainView.h"
+#include "MantidQtCustomInterfaces/Reflectometry/IReflPresenter.h"
+#include "MantidQtCustomInterfaces/Reflectometry/ReflSearchModel.h"
+#include "MantidQtCustomInterfaces/Reflectometry/QReflTableModel.h"
 #include "MantidQtMantidWidgets/SlitCalculator.h"
 #include <boost/scoped_ptr.hpp>
 #include <QSignalMapper>
diff --git a/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/QtReflOptionsDialog.h b/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/QtReflOptionsDialog.h
similarity index 93%
rename from MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/QtReflOptionsDialog.h
rename to MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/QtReflOptionsDialog.h
index 7ae3c6662d8706ac5deeceeaea9571d960bb4cc0..254c8c7d1dc405d963fd2a9cefa4273e962c105d 100644
--- a/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/QtReflOptionsDialog.h
+++ b/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/QtReflOptionsDialog.h
@@ -2,8 +2,8 @@
 #define MANTID_CUSTOMINTERFACES_QTREFLOPTIONSDIALOG_H
 
 #include "MantidKernel/System.h"
-#include "MantidQtCustomInterfaces/IReflPresenter.h"
-#include "MantidQtCustomInterfaces/ReflMainView.h"
+#include "MantidQtCustomInterfaces/Reflectometry/IReflPresenter.h"
+#include "MantidQtCustomInterfaces/Reflectometry/ReflMainView.h"
 
 #include <QDialog>
 
diff --git a/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/ReflCatalogSearcher.h b/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/ReflCatalogSearcher.h
similarity index 95%
rename from MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/ReflCatalogSearcher.h
rename to MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/ReflCatalogSearcher.h
index 31bcfcb30ba650306321247e17bb29af9d8ff064..9889f1abdb2ca02de932002fde737e4dc12bd948 100644
--- a/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/ReflCatalogSearcher.h
+++ b/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/ReflCatalogSearcher.h
@@ -1,7 +1,7 @@
 #ifndef MANTID_CUSTOMINTERFACES_REFLCATALOGSEARCHER_H
 #define MANTID_CUSTOMINTERFACES_REFLCATALOGSEARCHER_H
 
-#include "MantidQtCustomInterfaces/IReflSearcher.h"
+#include "MantidQtCustomInterfaces/Reflectometry/IReflSearcher.h"
 
 namespace MantidQt
 {
diff --git a/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/ReflGenerateNotebook.h b/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/ReflGenerateNotebook.h
similarity index 98%
rename from MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/ReflGenerateNotebook.h
rename to MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/ReflGenerateNotebook.h
index d620a7090bffcf65187656413c83489ae464f918..79f0fc7e526bb3eb9074894b33ddad8f17712008 100644
--- a/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/ReflGenerateNotebook.h
+++ b/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/ReflGenerateNotebook.h
@@ -28,7 +28,7 @@
     Code Documentation is available at: <http://doxygen.mantidproject.org>
     */
 
-#include "MantidQtCustomInterfaces/QReflTableModel.h"
+#include "MantidQtCustomInterfaces/Reflectometry/QReflTableModel.h"
 #include "MantidKernel/System.h"
 
 #include <set>
diff --git a/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/ReflLegacyTransferStrategy.h b/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/ReflLegacyTransferStrategy.h
similarity index 95%
rename from MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/ReflLegacyTransferStrategy.h
rename to MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/ReflLegacyTransferStrategy.h
index 4d259ed13943b00b1ebd0bf9faa2c91f57458ae5..dae3c0e525186b706a7859ac88684671c57458e2 100644
--- a/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/ReflLegacyTransferStrategy.h
+++ b/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/ReflLegacyTransferStrategy.h
@@ -2,7 +2,7 @@
 #define MANTID_CUSTOMINTERFACES_REFLLEGACYTRANSFERSTRATEGY_H
 
 #include "MantidKernel/System.h"
-#include "MantidQtCustomInterfaces/ReflTransferStrategy.h"
+#include "MantidQtCustomInterfaces/Reflectometry/ReflTransferStrategy.h"
 
 namespace MantidQt
 {
diff --git a/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/ReflMainView.h b/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/ReflMainView.h
similarity index 94%
rename from MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/ReflMainView.h
rename to MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/ReflMainView.h
index df3775fc0100358e636c0f0c72dcf4ecb7070997..8ab746ba54cf87654b8e5938fa47c72d6f52fd6e 100644
--- a/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/ReflMainView.h
+++ b/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/ReflMainView.h
@@ -2,9 +2,9 @@
 #define MANTID_CUSTOMINTERFACES_REFLMAINVIEW_H
 
 #include "MantidKernel/System.h"
-#include "MantidQtCustomInterfaces/IReflPresenter.h"
-#include "MantidQtCustomInterfaces/ReflSearchModel.h"
-#include "MantidQtCustomInterfaces/QReflTableModel.h"
+#include "MantidQtCustomInterfaces/Reflectometry/IReflPresenter.h"
+#include "MantidQtCustomInterfaces/Reflectometry/ReflSearchModel.h"
+#include "MantidQtCustomInterfaces/Reflectometry/QReflTableModel.h"
 #include "MantidQtMantidWidgets/HintStrategy.h"
 
 #include <map>
diff --git a/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/ReflMainViewPresenter.h b/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/ReflMainViewPresenter.h
similarity index 94%
rename from MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/ReflMainViewPresenter.h
rename to MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/ReflMainViewPresenter.h
index a6f24709eecc204643224e779ab03c8dd8eaec6a..435e12de6e70744d9ce83f1e1aa16b3dc1db7920 100644
--- a/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/ReflMainViewPresenter.h
+++ b/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/ReflMainViewPresenter.h
@@ -4,11 +4,11 @@
 #include "MantidAPI/ITableWorkspace_fwd.h"
 #include "MantidQtAPI/WorkspaceObserver.h"
 #include "MantidQtCustomInterfaces/DllConfig.h"
-#include "MantidQtCustomInterfaces/IReflPresenter.h"
-#include "MantidQtCustomInterfaces/IReflSearcher.h"
-#include "MantidQtCustomInterfaces/ReflTransferStrategy.h"
-#include "MantidQtCustomInterfaces/ReflMainView.h"
-#include "MantidQtCustomInterfaces/QReflTableModel.h"
+#include "MantidQtCustomInterfaces/Reflectometry/ReflMainView.h"
+#include "MantidQtCustomInterfaces/Reflectometry/IReflPresenter.h"
+#include "MantidQtCustomInterfaces/Reflectometry/IReflSearcher.h"
+#include "MantidQtCustomInterfaces/Reflectometry/ReflTransferStrategy.h"
+#include "MantidQtCustomInterfaces/Reflectometry/QReflTableModel.h"
 
 #include <Poco/AutoPtr.h>
 #include <memory>
@@ -154,4 +154,4 @@ private:
 };
 }
 }
-#endif
\ No newline at end of file
+#endif
diff --git a/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/ReflMainWidget.ui b/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/ReflMainWidget.ui
new file mode 100644
index 0000000000000000000000000000000000000000..3dfb5ec1882dd8dedf8c0c66061d35bc97fdf99e
--- /dev/null
+++ b/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/ReflMainWidget.ui
@@ -0,0 +1,759 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>reflMainWidget</class>
+ <widget class="QMainWindow" name="reflMainWidget">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>959</width>
+    <height>346</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>ISIS Reflectometry (Polref)</string>
+  </property>
+  <widget class="QWidget" name="centralwidget">
+   <layout class="QVBoxLayout" name="layoutMain">
+    <property name="margin">
+     <number>1</number>
+    </property>
+    <item>
+     <widget class="QSplitter" name="splitterTables">
+      <property name="sizePolicy">
+       <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+        <horstretch>0</horstretch>
+        <verstretch>0</verstretch>
+       </sizepolicy>
+      </property>
+      <property name="orientation">
+       <enum>Qt::Horizontal</enum>
+      </property>
+      <property name="childrenCollapsible">
+       <bool>true</bool>
+      </property>
+      <widget class="QGroupBox" name="groupSearchPane">
+       <property name="title">
+        <string>Search Runs</string>
+       </property>
+       <layout class="QVBoxLayout" name="layoutSearchPane">
+        <property name="spacing">
+         <number>1</number>
+        </property>
+        <property name="margin">
+         <number>1</number>
+        </property>
+        <item>
+         <layout class="QFormLayout" name="layoutSearchForm">
+          <property name="fieldGrowthPolicy">
+           <enum>QFormLayout::AllNonFixedFieldsGrow</enum>
+          </property>
+          <item row="0" column="0">
+           <widget class="QLabel" name="labelInstrument">
+            <property name="text">
+             <string>Instrument:</string>
+            </property>
+            <property name="buddy">
+             <cstring>comboSearchInstrument</cstring>
+            </property>
+           </widget>
+          </item>
+          <item row="0" column="1">
+           <widget class="QComboBox" name="comboSearchInstrument">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="minimumSize">
+             <size>
+              <width>150</width>
+              <height>0</height>
+             </size>
+            </property>
+            <property name="toolTip">
+             <string>Select the instrument to search with</string>
+            </property>
+            <property name="whatsThis">
+             <string>Specifies which instrument you're searching for data from.</string>
+            </property>
+           </widget>
+          </item>
+          <item row="1" column="0">
+           <widget class="QLabel" name="labelInvestigationId">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="text">
+             <string>Investigation Id:</string>
+            </property>
+            <property name="buddy">
+             <cstring>textSearch</cstring>
+            </property>
+           </widget>
+          </item>
+          <item row="1" column="1">
+           <widget class="QLineEdit" name="textSearch">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="minimumSize">
+             <size>
+              <width>40</width>
+              <height>0</height>
+             </size>
+            </property>
+            <property name="toolTip">
+             <string>Investigation to search for</string>
+            </property>
+            <property name="whatsThis">
+             <string>Specifies the investigation id that you are searching for runs from.</string>
+            </property>
+            <property name="inputMethodHints">
+             <set>Qt::ImhDigitsOnly</set>
+            </property>
+            <property name="cursorPosition">
+             <number>0</number>
+            </property>
+           </widget>
+          </item>
+          <item row="2" column="1">
+           <widget class="QPushButton" name="buttonSearch">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="toolTip">
+             <string>Search</string>
+            </property>
+            <property name="whatsThis">
+             <string>Searches ICAT for runs from the given instrument with the given investigation id.</string>
+            </property>
+            <property name="text">
+             <string>Search</string>
+            </property>
+           </widget>
+          </item>
+          <item row="2" column="0">
+           <widget class="QComboBox" name="comboTransferMethod">
+            <property name="whatsThis">
+             <string>The strategy for searching and transfering files. See help.</string>
+            </property>
+           </widget>
+          </item>
+         </layout>
+        </item>
+        <item>
+         <widget class="QTableView" name="tableSearchResults">
+          <property name="contextMenuPolicy">
+           <enum>Qt::CustomContextMenu</enum>
+          </property>
+          <property name="selectionMode">
+           <enum>QAbstractItemView::ExtendedSelection</enum>
+          </property>
+          <property name="selectionBehavior">
+           <enum>QAbstractItemView::SelectRows</enum>
+          </property>
+          <attribute name="horizontalHeaderDefaultSectionSize">
+           <number>60</number>
+          </attribute>
+          <attribute name="horizontalHeaderMinimumSectionSize">
+           <number>20</number>
+          </attribute>
+          <attribute name="horizontalHeaderStretchLastSection">
+           <bool>true</bool>
+          </attribute>
+          <attribute name="verticalHeaderVisible">
+           <bool>false</bool>
+          </attribute>
+          <attribute name="verticalHeaderDefaultSectionSize">
+           <number>20</number>
+          </attribute>
+         </widget>
+        </item>
+        <item>
+         <layout class="QHBoxLayout" name="layoutSearchBottomRow">
+          <item>
+           <spacer name="spacerTransfer">
+            <property name="orientation">
+             <enum>Qt::Horizontal</enum>
+            </property>
+            <property name="sizeHint" stdset="0">
+             <size>
+              <width>40</width>
+              <height>20</height>
+             </size>
+            </property>
+           </spacer>
+          </item>
+          <item>
+           <widget class="QToolButton" name="buttonTransfer">
+            <property name="text">
+             <string>Transfer</string>
+            </property>
+            <property name="toolButtonStyle">
+             <enum>Qt::ToolButtonTextBesideIcon</enum>
+            </property>
+           </widget>
+          </item>
+         </layout>
+        </item>
+       </layout>
+      </widget>
+      <widget class="QGroupBox" name="groupProcessPane">
+       <property name="title">
+        <string>Process Runs</string>
+       </property>
+       <layout class="QHBoxLayout" name="layoutTableView">
+        <property name="spacing">
+         <number>1</number>
+        </property>
+        <property name="margin">
+         <number>1</number>
+        </property>
+        <item>
+         <layout class="QVBoxLayout" name="layoutButtonsTable">
+          <property name="spacing">
+           <number>1</number>
+          </property>
+          <item>
+           <widget class="QToolBar" name="rowToolBar">
+            <property name="styleSheet">
+             <string>QToolBar{border: none;}</string>
+            </property>
+            <addaction name="actionProcess"/>
+            <addaction name="actionExpandSelection"/>
+            <addaction name="separator"/>
+            <addaction name="actionPlotRow"/>
+            <addaction name="actionPlotGroup"/>
+            <addaction name="separator"/>
+            <addaction name="actionAppendRow"/>
+            <addaction name="actionDeleteRow"/>
+            <addaction name="separator"/>
+            <addaction name="actionGroupRows"/>
+            <addaction name="actionCopySelected"/>
+            <addaction name="actionCutSelected"/>
+            <addaction name="actionPasteSelected"/>
+            <addaction name="actionClearSelected"/>
+            <addaction name="actionHelp"/>
+           </widget>
+          </item>
+          <item>
+           <widget class="QTableView" name="viewTable">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="contextMenuPolicy">
+             <enum>Qt::CustomContextMenu</enum>
+            </property>
+            <property name="editTriggers">
+             <set>QAbstractItemView::AnyKeyPressed|QAbstractItemView::DoubleClicked|QAbstractItemView::EditKeyPressed|QAbstractItemView::SelectedClicked</set>
+            </property>
+            <property name="alternatingRowColors">
+             <bool>true</bool>
+            </property>
+            <property name="selectionMode">
+             <enum>QAbstractItemView::ExtendedSelection</enum>
+            </property>
+            <property name="selectionBehavior">
+             <enum>QAbstractItemView::SelectRows</enum>
+            </property>
+            <attribute name="horizontalHeaderDefaultSectionSize">
+             <number>60</number>
+            </attribute>
+            <attribute name="horizontalHeaderMinimumSectionSize">
+             <number>20</number>
+            </attribute>
+            <attribute name="horizontalHeaderStretchLastSection">
+             <bool>true</bool>
+            </attribute>
+            <attribute name="verticalHeaderDefaultSectionSize">
+             <number>20</number>
+            </attribute>
+           </widget>
+          </item>
+          <item>
+           <layout class="QHBoxLayout" name="layoutRowButtons">
+            <property name="margin">
+             <number>1</number>
+            </property>
+            <item>
+             <widget class="QProgressBar" name="progressBar">
+              <property name="whatsThis">
+               <string>Shows the current progress when processing.</string>
+              </property>
+              <property name="value">
+               <number>0</number>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <widget class="QLabel" name="labelProcessInstrument">
+              <property name="text">
+               <string>Instrument:</string>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <widget class="QComboBox" name="comboProcessInstrument">
+              <property name="sizePolicy">
+               <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+                <horstretch>0</horstretch>
+                <verstretch>0</verstretch>
+               </sizepolicy>
+              </property>
+              <property name="toolTip">
+               <string>Select the instrument to assume for fetching runs</string>
+              </property>
+              <property name="whatsThis">
+               <string>Specifies the instrument that data being processed was generated by. This is used to help identify the correct data to load when given sample run numbers to process.</string>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <widget class="QCheckBox" name="checkEnableNotebook">
+              <property name="text">
+               <string>Output Notebook</string>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <widget class="QToolButton" name="buttonProcess">
+              <property name="text">
+               <string>Process</string>
+              </property>
+              <property name="toolButtonStyle">
+               <enum>Qt::ToolButtonTextBesideIcon</enum>
+              </property>
+              <property name="arrowType">
+               <enum>Qt::NoArrow</enum>
+              </property>
+             </widget>
+            </item>
+           </layout>
+          </item>
+         </layout>
+        </item>
+       </layout>
+      </widget>
+     </widget>
+    </item>
+   </layout>
+  </widget>
+  <widget class="QMenuBar" name="menuBar">
+   <property name="geometry">
+    <rect>
+     <x>0</x>
+     <y>0</y>
+     <width>959</width>
+     <height>18</height>
+    </rect>
+   </property>
+   <property name="nativeMenuBar">
+    <bool>false</bool>
+   </property>
+   <widget class="QMenu" name="menuTable">
+    <property name="title">
+     <string>&amp;Reflectometry</string>
+    </property>
+    <widget class="QMenu" name="menuOpenTable">
+     <property name="title">
+      <string>Open Table</string>
+     </property>
+     <property name="icon">
+      <iconset resource="../../../../MantidPlot/icons/icons.qrc">
+       <normaloff>:/multiload.png</normaloff>:/multiload.png</iconset>
+     </property>
+    </widget>
+    <addaction name="menuOpenTable"/>
+    <addaction name="actionNewTable"/>
+    <addaction name="actionSaveTable"/>
+    <addaction name="actionSaveTableAs"/>
+    <addaction name="separator"/>
+    <addaction name="actionImportTable"/>
+    <addaction name="actionExportTable"/>
+    <addaction name="separator"/>
+    <addaction name="actionSlitCalculator"/>
+    <addaction name="separator"/>
+    <addaction name="actionOptionsDialog"/>
+   </widget>
+   <widget class="QMenu" name="menuRows">
+    <property name="title">
+     <string>&amp;Edit</string>
+    </property>
+    <addaction name="actionProcess"/>
+    <addaction name="actionExpandSelection"/>
+    <addaction name="separator"/>
+    <addaction name="actionPlotRow"/>
+    <addaction name="actionPlotGroup"/>
+    <addaction name="separator"/>
+    <addaction name="actionPrependRow"/>
+    <addaction name="actionAppendRow"/>
+    <addaction name="separator"/>
+    <addaction name="actionGroupRows"/>
+    <addaction name="actionCopySelected"/>
+    <addaction name="actionCutSelected"/>
+    <addaction name="actionPasteSelected"/>
+    <addaction name="actionClearSelected"/>
+    <addaction name="separator"/>
+    <addaction name="actionDeleteRow"/>
+   </widget>
+   <addaction name="menuTable"/>
+   <addaction name="menuRows"/>
+  </widget>
+  <action name="actionNewTable">
+   <property name="icon">
+    <iconset resource="../../../../MantidPlot/icons/icons.qrc">
+     <normaloff>:/new.png</normaloff>:/new.png</iconset>
+   </property>
+   <property name="text">
+    <string>New Table</string>
+   </property>
+   <property name="whatsThis">
+    <string>Discards the current contents of the processing table and starts afresh.</string>
+   </property>
+  </action>
+  <action name="actionSaveTable">
+   <property name="icon">
+    <iconset resource="../../../../MantidPlot/icons/icons.qrc">
+     <normaloff>:/filesave.png</normaloff>:/filesave.png</iconset>
+   </property>
+   <property name="text">
+    <string>Save Table</string>
+   </property>
+   <property name="whatsThis">
+    <string>Saves the current contents of the table to the table workspace that was last saved to or opened. If none exist, it prompts for a workspace name to save as.</string>
+   </property>
+  </action>
+  <action name="actionSaveTableAs">
+   <property name="icon">
+    <iconset resource="../../../../MantidPlot/icons/icons.qrc">
+     <normaloff>:/filesaveas.png</normaloff>:/filesaveas.png</iconset>
+   </property>
+   <property name="text">
+    <string>Save Table As</string>
+   </property>
+   <property name="whatsThis">
+    <string>Prompts for a workspace name to save the current contents of the table to.</string>
+   </property>
+  </action>
+  <action name="actionAppendRow">
+   <property name="icon">
+    <iconset resource="../../../../MantidPlot/icons/icons.qrc">
+     <normaloff>:/insert_row.png</normaloff>:/insert_row.png</iconset>
+   </property>
+   <property name="text">
+    <string>Insert Row After</string>
+   </property>
+   <property name="toolTip">
+    <string>Insert Row After</string>
+   </property>
+   <property name="whatsThis">
+    <string>Inserts a new row after the first selected row. If no rows are selected then a new row is added at the end of the table.</string>
+   </property>
+  </action>
+  <action name="actionPrependRow">
+   <property name="icon">
+    <iconset resource="../../../../MantidPlot/icons/icons.qrc">
+     <normaloff>:/insert_row.png</normaloff>:/insert_row.png</iconset>
+   </property>
+   <property name="text">
+    <string>Insert Row Before</string>
+   </property>
+   <property name="toolTip">
+    <string>Insert Row Before</string>
+   </property>
+   <property name="whatsThis">
+    <string>Inserts a new row before the first selected row. If no rows are selected then a new row is inserted at the start of the table.</string>
+   </property>
+  </action>
+  <action name="actionDeleteRow">
+   <property name="icon">
+    <iconset resource="../../../../MantidPlot/icons/icons.qrc">
+     <normaloff>:/delete_row.png</normaloff>:/delete_row.png</iconset>
+   </property>
+   <property name="text">
+    <string>Delete Row</string>
+   </property>
+   <property name="whatsThis">
+    <string>Deletes the selected rows.</string>
+   </property>
+  </action>
+  <action name="actionGroupRows">
+   <property name="icon">
+    <iconset resource="../../../../MantidPlot/icons/icons.qrc">
+     <normaloff>:/drag_curves.png</normaloff>:/drag_curves.png</iconset>
+   </property>
+   <property name="text">
+    <string>Group Selected</string>
+   </property>
+   <property name="whatsThis">
+    <string>Places all of the selected rows into the same group.</string>
+   </property>
+  </action>
+  <action name="actionProcess">
+   <property name="icon">
+    <iconset resource="../../../../MantidPlot/icons/icons.qrc">
+     <normaloff>:/stat_rows.png</normaloff>:/stat_rows.png</iconset>
+   </property>
+   <property name="text">
+    <string>Process</string>
+   </property>
+   <property name="whatsThis">
+    <string>Processes the selected rows. If no rows are selected then all rows are processed.</string>
+   </property>
+  </action>
+  <action name="actionExpandSelection">
+   <property name="icon">
+    <iconset resource="../../../../MantidPlot/icons/icons.qrc">
+     <normaloff>:/fit_frame.png</normaloff>:/fit_frame.png</iconset>
+   </property>
+   <property name="text">
+    <string>Expand Selection</string>
+   </property>
+   <property name="toolTip">
+    <string>Select an entire group</string>
+   </property>
+   <property name="whatsThis">
+    <string>Expands the current selection to include any rows that are in the same group as any selected row.</string>
+   </property>
+  </action>
+  <action name="actionOptionsDialog">
+   <property name="icon">
+    <iconset resource="../../../../MantidPlot/icons/icons.qrc">
+     <normaloff>:/configure.png</normaloff>:/configure.png</iconset>
+   </property>
+   <property name="text">
+    <string>Options...</string>
+   </property>
+   <property name="toolTip">
+    <string>Set options for the Reflectometry UI</string>
+   </property>
+   <property name="whatsThis">
+    <string>Opens a dialog that allows the behaviour of the Reflectometry UI to be customised.</string>
+   </property>
+  </action>
+  <action name="actionClearSelected">
+   <property name="icon">
+    <iconset resource="../../../../MantidPlot/icons/icons.qrc">
+     <normaloff>:/erase.png</normaloff>:/erase.png</iconset>
+   </property>
+   <property name="text">
+    <string>Clear Selected</string>
+   </property>
+   <property name="whatsThis">
+    <string>Clears the contents of the selected rows and ungroups them, placing each row into a unique group.</string>
+   </property>
+  </action>
+  <action name="actionCopySelected">
+   <property name="icon">
+    <iconset resource="../../../../MantidPlot/icons/icons.qrc">
+     <normaloff>:/copy.png</normaloff>:/copy.png</iconset>
+   </property>
+   <property name="text">
+    <string>Copy Selected</string>
+   </property>
+   <property name="whatsThis">
+    <string>Copies the selected rows to the clipboard. Each row is placed on a new line, and each cell is separated by a tab.</string>
+   </property>
+   <property name="shortcut">
+    <string>Ctrl+C</string>
+   </property>
+  </action>
+  <action name="actionPasteSelected">
+   <property name="icon">
+    <iconset resource="../../../../MantidPlot/icons/icons.qrc">
+     <normaloff>:/paste.png</normaloff>:/paste.png</iconset>
+   </property>
+   <property name="text">
+    <string>Paste Selected</string>
+   </property>
+   <property name="whatsThis">
+    <string>Pastes the contents of the clipboard into the selected rows. If no rows are selected, new ones are added at the end of the table.</string>
+   </property>
+   <property name="shortcut">
+    <string>Ctrl+V</string>
+   </property>
+  </action>
+  <action name="actionCutSelected">
+   <property name="icon">
+    <iconset resource="../../../../MantidPlot/icons/icons.qrc">
+     <normaloff>:/cut.png</normaloff>:/cut.png</iconset>
+   </property>
+   <property name="text">
+    <string>Cut Selected</string>
+   </property>
+   <property name="whatsThis">
+    <string>Copies the selected rows to the clipboard, and then deletes them. Each row is placed on a new line, and each cell is separated by a tab.</string>
+   </property>
+   <property name="shortcut">
+    <string>Ctrl+X</string>
+   </property>
+  </action>
+  <action name="actionSearch">
+   <property name="icon">
+    <iconset resource="../../../../MantidPlot/icons/icons.qrc">
+     <normaloff>:/folder.png</normaloff>:/folder.png</iconset>
+   </property>
+   <property name="text">
+    <string>Search</string>
+   </property>
+  </action>
+  <action name="actionTransfer">
+   <property name="icon">
+    <iconset resource="../../../../MantidPlot/icons/icons.qrc">
+     <normaloff>:/append_drag_curves.png</normaloff>:/append_drag_curves.png</iconset>
+   </property>
+   <property name="text">
+    <string>Transfer</string>
+   </property>
+   <property name="toolTip">
+    <string>Transfer the selected run(s) to the processing table.</string>
+   </property>
+   <property name="whatsThis">
+    <string>Transfers the selected runs into the processing table.</string>
+   </property>
+  </action>
+  <action name="actionImportTable">
+   <property name="icon">
+    <iconset resource="../../../../MantidPlot/icons/icons.qrc">
+     <normaloff>:/open_template.png</normaloff>:/open_template.png</iconset>
+   </property>
+   <property name="text">
+    <string>Import .TBL</string>
+   </property>
+   <property name="toolTip">
+    <string>Import a .TBL file</string>
+   </property>
+   <property name="whatsThis">
+    <string>Imports a .TBL file to a workspace using the LoadReflTBL algorithm. The resulting workspace can then be loaded as a table as normal.</string>
+   </property>
+  </action>
+  <action name="actionExportTable">
+   <property name="icon">
+    <iconset resource="../../../../MantidPlot/icons/icons.qrc">
+     <normaloff>:/save_template.png</normaloff>:/save_template.png</iconset>
+   </property>
+   <property name="text">
+    <string>Export .TBL</string>
+   </property>
+   <property name="toolTip">
+    <string>Export a .TBL file</string>
+   </property>
+   <property name="whatsThis">
+    <string>Exports a table workspace to a .TBL file that can be used by the ISIS Reflectometry UI in older versions of Mantid.</string>
+   </property>
+  </action>
+  <action name="actionHelp">
+   <property name="icon">
+    <iconset resource="../../../../MantidPlot/icons/icons.qrc">
+     <normaloff>:/help.png</normaloff>:/help.png</iconset>
+   </property>
+   <property name="text">
+    <string>Help</string>
+   </property>
+   <property name="toolTip">
+    <string>Opens the documentation.</string>
+   </property>
+   <property name="whatsThis">
+    <string>Opens the interface's documentation in the Qt Help Browser.</string>
+   </property>
+   <property name="shortcut">
+    <string>F1</string>
+   </property>
+  </action>
+  <action name="actionPlotRow">
+   <property name="icon">
+    <iconset resource="../../../../MantidPlot/icons/icons.qrc">
+     <normaloff>:/graph.png</normaloff>:/graph.png</iconset>
+   </property>
+   <property name="text">
+    <string>Plot Selected Rows</string>
+   </property>
+   <property name="toolTip">
+    <string>Plot the selected rows</string>
+   </property>
+   <property name="whatsThis">
+    <string>Creates a plot of the IvsQ workspaces produced by the selected rows.</string>
+   </property>
+  </action>
+  <action name="actionPlotGroup">
+   <property name="icon">
+    <iconset resource="../../../../MantidPlot/icons/icons.qrc">
+     <normaloff>:/trajectory.png</normaloff>:/trajectory.png</iconset>
+   </property>
+   <property name="text">
+    <string>Plot Selected Groups</string>
+   </property>
+   <property name="toolTip">
+    <string>Plot the selected groups</string>
+   </property>
+   <property name="whatsThis">
+    <string>Creates a plot of the stitched IvsQ workspaces produced by any groups any selected rows are in.</string>
+   </property>
+  </action>
+  <action name="actionSlitCalculator">
+   <property name="icon">
+    <iconset resource="../../../../MantidPlot/icons/icons.qrc">
+     <normaloff>:/param_range_btn.png</normaloff>:/param_range_btn.png</iconset>
+   </property>
+   <property name="text">
+    <string>Slit Calculator</string>
+   </property>
+  </action>
+ </widget>
+ <tabstops>
+  <tabstop>comboSearchInstrument</tabstop>
+  <tabstop>tableSearchResults</tabstop>
+  <tabstop>viewTable</tabstop>
+ </tabstops>
+ <resources>
+  <include location="../../../../MantidPlot/icons/icons.qrc"/>
+ </resources>
+ <connections>
+  <connection>
+   <sender>buttonSearch</sender>
+   <signal>clicked()</signal>
+   <receiver>actionSearch</receiver>
+   <slot>trigger()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>217</x>
+     <y>143</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>-1</x>
+     <y>-1</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>textSearch</sender>
+   <signal>returnPressed()</signal>
+   <receiver>actionSearch</receiver>
+   <slot>trigger()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>228</x>
+     <y>112</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>-1</x>
+     <y>-1</y>
+    </hint>
+   </hints>
+  </connection>
+ </connections>
+</ui>
diff --git a/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/ReflMeasureTransferStrategy.h b/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/ReflMeasureTransferStrategy.h
similarity index 90%
rename from MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/ReflMeasureTransferStrategy.h
rename to MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/ReflMeasureTransferStrategy.h
index 87b6ae6ba251c6606e707bc9d08adcd419a1e118..762434c59a7380a2413ec8a29778f24d7ca85fba 100644
--- a/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/ReflMeasureTransferStrategy.h
+++ b/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/ReflMeasureTransferStrategy.h
@@ -2,7 +2,7 @@
 #define MANTID_CUSTOMINTERFACES_REFLMEASURETRANSFERSTRATEGY_H_
 
 #include "MantidQtCustomInterfaces/DllConfig.h"
-#include "MantidQtCustomInterfaces/ReflTransferStrategy.h"
+#include "MantidQtCustomInterfaces/Reflectometry/ReflTransferStrategy.h"
 
 #include <vector>
 #include <map>
@@ -20,7 +20,7 @@ namespace MantidQt {
 namespace CustomInterfaces {
 
 // Forward dec
-class ReflMeasurementSource;
+class ReflMeasurementItemSource;
 
 /** ReflMeasureTransferStrategy : Transfer strategy that uses the measurement
   information
@@ -52,7 +52,7 @@ class MANTIDQT_CUSTOMINTERFACES_DLL ReflMeasureTransferStrategy
 public:
   ReflMeasureTransferStrategy(
       std::unique_ptr<Mantid::Kernel::ICatalogInfo> catInfo,
-      std::unique_ptr<ReflMeasurementSource> measurementSource);
+      std::unique_ptr<ReflMeasurementItemSource> measurementItemSource);
 
   ReflMeasureTransferStrategy(const ReflMeasureTransferStrategy &other);
 
@@ -71,7 +71,7 @@ private:
   std::unique_ptr<Mantid::Kernel::ICatalogInfo> m_catInfo;
 
   /// Measurement source for loading.
-  std::unique_ptr<ReflMeasurementSource> m_measurementSource;
+  std::unique_ptr<ReflMeasurementItemSource> m_measurementItemSource;
 };
 
 } // namespace CustomInterfaces
diff --git a/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/ReflMeasurementSource.h b/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/ReflMeasurementItemSource.h
similarity index 75%
rename from MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/ReflMeasurementSource.h
rename to MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/ReflMeasurementItemSource.h
index 72722824ea3e9427335dc02ea5258956cdf368b3..a38355a73204613cc522e62f57017eb2aca27eed 100644
--- a/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/ReflMeasurementSource.h
+++ b/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/ReflMeasurementItemSource.h
@@ -1,8 +1,8 @@
-#ifndef MANTIDQT_CUSTOMINTERFACES_REFLMEASUREMENTSOURCE_H_
-#define MANTIDQT_CUSTOMINTERFACES_REFLMEASUREMENTSOURCE_H_
+#ifndef MANTIDQT_CUSTOMINTERFACES_REFLMEASUREMENTITEMSOURCE_H_
+#define MANTIDQT_CUSTOMINTERFACES_REFLMEASUREMENTITEMSOURCE_H_
 
 #include "MantidQtCustomInterfaces/DllConfig.h"
-#include "MantidQtCustomInterfaces/Measurement.h"
+#include "MantidQtCustomInterfaces/Reflectometry/MeasurementItem.h"
 #include <string>
 
 namespace MantidQt {
@@ -34,18 +34,18 @@ namespace CustomInterfaces {
   File change history is stored at: <https://github.com/mantidproject/mantid>
   Code Documentation is available at: <http://doxygen.mantidproject.org>
 */
-class MANTIDQT_CUSTOMINTERFACES_DLL ReflMeasurementSource {
+class MANTIDQT_CUSTOMINTERFACES_DLL ReflMeasurementItemSource {
 public:
   /// Get the measurement somehow using location, or fuzzy path
-  virtual Measurement obtain(const std::string &definedPath,
+  virtual MeasurementItem obtain(const std::string &definedPath,
                              const std::string &fuzzyName) const = 0;
   /// Virtual destructor
-  virtual ReflMeasurementSource *clone() const = 0;
+  virtual ReflMeasurementItemSource *clone() const = 0;
   /// Destructor
-  virtual ~ReflMeasurementSource(){};
+  virtual ~ReflMeasurementItemSource(){};
 };
 
 } // namespace CustomInterfaces
 } // namespace Mantid
 
-#endif /* MANTIDQT_CUSTOMINTERFACES_REFLMEASUREMENTSOURCE_H_ */
+#endif /* MANTIDQT_CUSTOMINTERFACES_REFLMEASUREMENTITEMSOURCE_H_ */
diff --git a/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/ReflNexusMeasurementSource.h b/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/ReflNexusMeasurementItemSource.h
similarity index 70%
rename from MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/ReflNexusMeasurementSource.h
rename to MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/ReflNexusMeasurementItemSource.h
index a943f2eb84a5304d3f47d526962aeb4ccc22b8e1..20b26504581ae69991f19c72ee0ea7290847b0d4 100644
--- a/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/ReflNexusMeasurementSource.h
+++ b/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/ReflNexusMeasurementItemSource.h
@@ -1,9 +1,9 @@
-#ifndef MANTIDQT_CUSTOMINTERFACES_REFLNEXUSMEASUREMENTSOURCE_H_
-#define MANTIDQT_CUSTOMINTERFACES_REFLNEXUSMEASUREMENTSOURCE_H_
+#ifndef MANTIDQT_CUSTOMINTERFACES_REFLNEXUSMEASUREMENTITEMSOURCE_H_
+#define MANTIDQT_CUSTOMINTERFACES_REFLNEXUSMEASUREMENTITEMSOURCE_H_
 
 #include "MantidQtCustomInterfaces/DllConfig.h"
-#include "MantidQtCustomInterfaces/ReflMeasurementSource.h"
-#include "MantidQtCustomInterfaces/Measurement.h"
+#include "MantidQtCustomInterfaces/Reflectometry/ReflMeasurementItemSource.h"
+#include "MantidQtCustomInterfaces/Reflectometry/MeasurementItem.h"
 
 #include <string>
 
@@ -34,14 +34,14 @@ namespace CustomInterfaces {
   File change history is stored at: <https://github.com/mantidproject/mantid>
   Code Documentation is available at: <http://doxygen.mantidproject.org>
 */
-class MANTIDQT_CUSTOMINTERFACES_DLL ReflNexusMeasurementSource : public ReflMeasurementSource {
+class MANTIDQT_CUSTOMINTERFACES_DLL ReflNexusMeasurementItemSource : public ReflMeasurementItemSource {
 public:
-  ReflNexusMeasurementSource();
-  virtual Measurement obtain(const std::string &definedPath,
+  ReflNexusMeasurementItemSource();
+  virtual MeasurementItem obtain(const std::string &definedPath,
                              const std::string &fuzzyName) const;
   /// Virtual destructor
-  virtual ReflNexusMeasurementSource *clone() const;
-  virtual ~ReflNexusMeasurementSource();
+  virtual ReflNexusMeasurementItemSource *clone() const;
+  virtual ~ReflNexusMeasurementItemSource();
 
 };
 
diff --git a/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/ReflOptionsDialog.ui b/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/ReflOptionsDialog.ui
new file mode 100644
index 0000000000000000000000000000000000000000..d436410bd92a23f3e920b770ec9378dd794357c2
--- /dev/null
+++ b/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/ReflOptionsDialog.ui
@@ -0,0 +1,293 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>reflOptionsDialog</class>
+ <widget class="QDialog" name="reflOptionsDialog">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>372</width>
+    <height>222</height>
+   </rect>
+  </property>
+  <property name="sizePolicy">
+   <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+    <horstretch>0</horstretch>
+    <verstretch>0</verstretch>
+   </sizepolicy>
+  </property>
+  <property name="windowTitle">
+   <string>Reflectometry UI Options</string>
+  </property>
+  <layout class="QVBoxLayout" name="verticalLayout">
+   <item>
+    <widget class="QTabWidget" name="tabWidget">
+     <property name="currentIndex">
+      <number>0</number>
+     </property>
+     <widget class="QWidget" name="tabWarnings">
+      <attribute name="title">
+       <string>Warnings</string>
+      </attribute>
+      <layout class="QFormLayout" name="formLayout">
+       <item row="0" column="0">
+        <widget class="QCheckBox" name="checkWarnProcessAll">
+         <property name="text">
+          <string>Warn when processing all rows</string>
+         </property>
+         <property name="reflOptionName" stdset="0">
+          <string>WarnProcessAll</string>
+         </property>
+        </widget>
+       </item>
+       <item row="2" column="0">
+        <widget class="QCheckBox" name="checkWarnDiscardChanges">
+         <property name="text">
+          <string>Warn when discarding unsaved changes</string>
+         </property>
+         <property name="reflOptionName" stdset="0">
+          <string>WarnDiscardChanges</string>
+         </property>
+        </widget>
+       </item>
+       <item row="1" column="0">
+        <widget class="QCheckBox" name="checkWarnProcessPartialGroup">
+         <property name="text">
+          <string>Warn when processing only part of a group</string>
+         </property>
+         <property name="reflOptionName" stdset="0">
+          <string>WarnProcessPartialGroup</string>
+         </property>
+        </widget>
+       </item>
+      </layout>
+     </widget>
+     <widget class="QWidget" name="tabRounding">
+      <attribute name="title">
+       <string>Rounding</string>
+      </attribute>
+      <layout class="QGridLayout" name="gridLayout">
+       <item row="2" column="0">
+        <widget class="QCheckBox" name="checkRoundQMax">
+         <property name="text">
+          <string>Round q_max column to</string>
+         </property>
+         <property name="reflOptionName" stdset="0">
+          <string>RoundQMax</string>
+         </property>
+        </widget>
+       </item>
+       <item row="1" column="1">
+        <widget class="QSpinBox" name="spinQMinPrecision">
+         <property name="enabled">
+          <bool>false</bool>
+         </property>
+         <property name="reflOptionName" stdset="0">
+          <string>RoundQMinPrecision</string>
+         </property>
+        </widget>
+       </item>
+       <item row="2" column="1">
+        <widget class="QSpinBox" name="spinQMaxPrecision">
+         <property name="enabled">
+          <bool>false</bool>
+         </property>
+         <property name="reflOptionName" stdset="0">
+          <string>RoundQMaxPrecision</string>
+         </property>
+        </widget>
+       </item>
+       <item row="3" column="1">
+        <widget class="QSpinBox" name="spinDQQPrecision">
+         <property name="enabled">
+          <bool>false</bool>
+         </property>
+         <property name="reflOptionName" stdset="0">
+          <string>RoundDQQPrecision</string>
+         </property>
+        </widget>
+       </item>
+       <item row="1" column="0">
+        <widget class="QCheckBox" name="checkRoundQMin">
+         <property name="text">
+          <string>Round q_min column to</string>
+         </property>
+         <property name="reflOptionName" stdset="0">
+          <string>RoundQMin</string>
+         </property>
+        </widget>
+       </item>
+       <item row="3" column="0">
+        <widget class="QCheckBox" name="checkRoundDQQ">
+         <property name="text">
+          <string>Round dq/q column to</string>
+         </property>
+         <property name="reflOptionName" stdset="0">
+          <string>RoundDQQ</string>
+         </property>
+        </widget>
+       </item>
+       <item row="0" column="0">
+        <widget class="QCheckBox" name="checkRoundAngle">
+         <property name="text">
+          <string>Round Angle column to</string>
+         </property>
+         <property name="reflOptionName" stdset="0">
+          <string>RoundAngle</string>
+         </property>
+        </widget>
+       </item>
+       <item row="0" column="1">
+        <widget class="QSpinBox" name="spinAnglePrecision">
+         <property name="enabled">
+          <bool>false</bool>
+         </property>
+         <property name="reflOptionName" stdset="0">
+          <string>RoundAnglePrecision</string>
+         </property>
+        </widget>
+       </item>
+       <item row="0" column="2">
+        <widget class="QLabel" name="labelAnglePlaces">
+         <property name="text">
+          <string>decimal places</string>
+         </property>
+        </widget>
+       </item>
+       <item row="1" column="2">
+        <widget class="QLabel" name="labelQMinPlaces">
+         <property name="text">
+          <string>decimal places</string>
+         </property>
+        </widget>
+       </item>
+       <item row="2" column="2">
+        <widget class="QLabel" name="labelQMaxPlaces">
+         <property name="text">
+          <string>decimal places</string>
+         </property>
+        </widget>
+       </item>
+       <item row="3" column="2">
+        <widget class="QLabel" name="labelDQQPlaces">
+         <property name="text">
+          <string>decimal places</string>
+         </property>
+        </widget>
+       </item>
+      </layout>
+     </widget>
+    </widget>
+   </item>
+   <item>
+    <widget class="QDialogButtonBox" name="buttonBox">
+     <property name="orientation">
+      <enum>Qt::Horizontal</enum>
+     </property>
+     <property name="standardButtons">
+      <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
+     </property>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <resources/>
+ <connections>
+  <connection>
+   <sender>buttonBox</sender>
+   <signal>accepted()</signal>
+   <receiver>reflOptionsDialog</receiver>
+   <slot>accept()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>248</x>
+     <y>254</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>157</x>
+     <y>274</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>buttonBox</sender>
+   <signal>rejected()</signal>
+   <receiver>reflOptionsDialog</receiver>
+   <slot>reject()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>316</x>
+     <y>260</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>286</x>
+     <y>274</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>checkRoundAngle</sender>
+   <signal>toggled(bool)</signal>
+   <receiver>spinAnglePrecision</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>106</x>
+     <y>53</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>226</x>
+     <y>53</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>checkRoundQMin</sender>
+   <signal>toggled(bool)</signal>
+   <receiver>spinQMinPrecision</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>106</x>
+     <y>84</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>226</x>
+     <y>84</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>checkRoundQMax</sender>
+   <signal>toggled(bool)</signal>
+   <receiver>spinQMaxPrecision</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>106</x>
+     <y>115</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>226</x>
+     <y>115</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>checkRoundDQQ</sender>
+   <signal>toggled(bool)</signal>
+   <receiver>spinDQQPrecision</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>106</x>
+     <y>146</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>226</x>
+     <y>146</y>
+    </hint>
+   </hints>
+  </connection>
+ </connections>
+</ui>
diff --git a/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/ReflSearchModel.h b/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/ReflSearchModel.h
similarity index 100%
rename from MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/ReflSearchModel.h
rename to MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/ReflSearchModel.h
diff --git a/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/ReflTableSchema.h b/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/ReflTableSchema.h
similarity index 100%
rename from MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/ReflTableSchema.h
rename to MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/ReflTableSchema.h
diff --git a/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/ReflTransferStrategy.h b/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/ReflTransferStrategy.h
similarity index 100%
rename from MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/ReflTransferStrategy.h
rename to MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/ReflTransferStrategy.h
diff --git a/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/ReflVectorString.h b/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/ReflVectorString.h
similarity index 100%
rename from MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/ReflVectorString.h
rename to MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/ReflVectorString.h
diff --git a/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/ReflWindow.ui b/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/ReflWindow.ui
new file mode 100644
index 0000000000000000000000000000000000000000..c0375ae18d20a36c38905faaf9affcc0a3342218
--- /dev/null
+++ b/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Reflectometry/ReflWindow.ui
@@ -0,0 +1,599 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>windowRefl</class>
+ <widget class="QMainWindow" name="windowRefl">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>897</width>
+    <height>412</height>
+   </rect>
+  </property>
+  <property name="acceptDrops">
+   <bool>true</bool>
+  </property>
+  <property name="windowTitle">
+   <string>ISIS Reflectometry</string>
+  </property>
+  <widget class="QWidget" name="widgetMainRow">
+   <layout class="QVBoxLayout" name="layoutMain">
+    <item>
+     <layout class="QHBoxLayout" name="layoutTopRow">
+      <item>
+       <widget class="QLabel" name="labelInstrument">
+        <property name="text">
+         <string>Instrument:</string>
+        </property>
+        <property name="buddy">
+         <cstring>comboInstrument</cstring>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <widget class="QComboBox" name="comboInstrument">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+        <property name="font">
+         <font>
+          <weight>75</weight>
+          <bold>true</bold>
+         </font>
+        </property>
+        <property name="toolTip">
+         <string>Sets the instrument to use.</string>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <spacer name="spacer_2">
+        <property name="orientation">
+         <enum>Qt::Horizontal</enum>
+        </property>
+        <property name="sizeHint" stdset="0">
+         <size>
+          <width>40</width>
+          <height>20</height>
+         </size>
+        </property>
+       </spacer>
+      </item>
+      <item>
+       <widget class="QLabel" name="labelRuns">
+        <property name="text">
+         <string>Transmission run(s):</string>
+        </property>
+        <property name="buddy">
+         <cstring>textRuns</cstring>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <widget class="QLineEdit" name="textRuns">
+        <property name="minimumSize">
+         <size>
+          <width>90</width>
+          <height>0</height>
+         </size>
+        </property>
+        <property name="maximumSize">
+         <size>
+          <width>120</width>
+          <height>16777215</height>
+         </size>
+        </property>
+        <property name="toolTip">
+         <string>Transmission run number to be automatically entered into the 'trans' column when transferring runs.</string>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <spacer name="horizontalSpacer_2">
+        <property name="orientation">
+         <enum>Qt::Horizontal</enum>
+        </property>
+        <property name="sizeHint" stdset="0">
+         <size>
+          <width>40</width>
+          <height>20</height>
+         </size>
+        </property>
+       </spacer>
+      </item>
+      <item>
+       <widget class="QLabel" name="labelPolarCorrect">
+        <property name="text">
+         <string>Polarisation corrections:</string>
+        </property>
+        <property name="buddy">
+         <cstring>comboPolarCorrect</cstring>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <widget class="QComboBox" name="comboPolarCorrect">
+        <property name="font">
+         <font>
+          <weight>75</weight>
+          <bold>true</bold>
+         </font>
+        </property>
+        <property name="toolTip">
+         <string>Sets the polarisation corrections to be done when processing.</string>
+        </property>
+        <item>
+         <property name="text">
+          <string>None</string>
+         </property>
+        </item>
+        <item>
+         <property name="text">
+          <string>1-PNR</string>
+         </property>
+        </item>
+        <item>
+         <property name="text">
+          <string>2-PA</string>
+         </property>
+        </item>
+       </widget>
+      </item>
+      <item>
+       <spacer name="horizontalSpacer_3">
+        <property name="orientation">
+         <enum>Qt::Horizontal</enum>
+        </property>
+        <property name="sizeHint" stdset="0">
+         <size>
+          <width>40</width>
+          <height>20</height>
+         </size>
+        </property>
+       </spacer>
+      </item>
+      <item>
+       <widget class="QPushButton" name="buttonColumns">
+        <property name="text">
+         <string>Choose Columns...</string>
+        </property>
+       </widget>
+      </item>
+     </layout>
+    </item>
+    <item>
+     <layout class="QHBoxLayout" name="layoutMidRow">
+      <property name="spacing">
+       <number>12</number>
+      </property>
+      <item>
+       <widget class="MantidQt::MantidWidgets::WorkspaceSelector" name="workspaceSelector"/>
+      </item>
+      <item>
+       <widget class="QLabel" name="labelRB">
+        <property name="text">
+         <string>RB Search:</string>
+        </property>
+        <property name="buddy">
+         <cstring>textRB</cstring>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <widget class="QLineEdit" name="textRB">
+        <property name="minimumSize">
+         <size>
+          <width>40</width>
+          <height>0</height>
+         </size>
+        </property>
+        <property name="maximumSize">
+         <size>
+          <width>70</width>
+          <height>16777215</height>
+         </size>
+        </property>
+        <property name="toolTip">
+         <string>The term to search the archives for</string>
+        </property>
+        <property name="inputMethodHints">
+         <set>Qt::ImhDigitsOnly</set>
+        </property>
+        <property name="cursorPosition">
+         <number>0</number>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <widget class="QLabel" name="labelDepth">
+        <property name="text">
+         <string>Search Depth (Cycles):</string>
+        </property>
+        <property name="buddy">
+         <cstring>spinDepth</cstring>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <widget class="QSpinBox" name="spinDepth">
+        <property name="toolTip">
+         <string>The depth in cycles of the serach to to on the archives. A depth of '1' seraches only the most recent cycle.</string>
+        </property>
+        <property name="minimum">
+         <number>1</number>
+        </property>
+        <property name="maximum">
+         <number>99</number>
+        </property>
+        <property name="value">
+         <number>5</number>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <widget class="QPushButton" name="buttonSearch">
+        <property name="text">
+         <string>Search</string>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <spacer name="horizontalSpacer">
+        <property name="orientation">
+         <enum>Qt::Horizontal</enum>
+        </property>
+        <property name="sizeHint" stdset="0">
+         <size>
+          <width>40</width>
+          <height>20</height>
+         </size>
+        </property>
+       </spacer>
+      </item>
+      <item>
+       <widget class="QPushButton" name="buttonAuto">
+        <property name="text">
+         <string>AutoFill</string>
+        </property>
+       </widget>
+      </item>
+     </layout>
+    </item>
+    <item>
+     <widget class="QSplitter" name="splitterTables">
+      <property name="sizePolicy">
+       <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+        <horstretch>0</horstretch>
+        <verstretch>0</verstretch>
+       </sizepolicy>
+      </property>
+      <property name="orientation">
+       <enum>Qt::Horizontal</enum>
+      </property>
+      <widget class="QTableWidget" name="tableRuns">
+       <attribute name="horizontalHeaderHighlightSections">
+        <bool>false</bool>
+       </attribute>
+       <attribute name="horizontalHeaderStretchLastSection">
+        <bool>true</bool>
+       </attribute>
+       <attribute name="verticalHeaderVisible">
+        <bool>false</bool>
+       </attribute>
+       <attribute name="verticalHeaderHighlightSections">
+        <bool>false</bool>
+       </attribute>
+       <column>
+        <property name="text">
+         <string>Run #</string>
+        </property>
+       </column>
+       <column>
+        <property name="text">
+         <string>Title</string>
+        </property>
+       </column>
+      </widget>
+      <widget class="QWidget" name="layoutWidget">
+       <layout class="QHBoxLayout" name="layoutTableView">
+        <item>
+         <widget class="QPushButton" name="buttonTransfer">
+          <property name="sizePolicy">
+           <sizepolicy hsizetype="Fixed" vsizetype="Expanding">
+            <horstretch>0</horstretch>
+            <verstretch>0</verstretch>
+           </sizepolicy>
+          </property>
+          <property name="maximumSize">
+           <size>
+            <width>25</width>
+            <height>16777215</height>
+           </size>
+          </property>
+          <property name="text">
+           <string>=&gt;</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <layout class="QVBoxLayout" name="layoutButtonsTable">
+          <item>
+           <widget class="QTableView" name="viewTable">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+           </widget>
+          </item>
+          <item>
+           <layout class="QHBoxLayout" name="layoutButtons">
+            <item>
+             <widget class="QPushButton" name="buttonProcess">
+              <property name="sizePolicy">
+               <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+                <horstretch>0</horstretch>
+                <verstretch>0</verstretch>
+               </sizepolicy>
+              </property>
+              <property name="text">
+               <string>Process</string>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <widget class="QPushButton" name="buttonClear">
+              <property name="text">
+               <string>Clear all</string>
+              </property>
+             </widget>
+            </item>
+           </layout>
+          </item>
+         </layout>
+        </item>
+       </layout>
+      </widget>
+     </widget>
+    </item>
+   </layout>
+   <zorder>splitterTables</zorder>
+  </widget>
+  <widget class="QMenuBar" name="menuBar">
+   <property name="geometry">
+    <rect>
+     <x>0</x>
+     <y>0</y>
+     <width>897</width>
+     <height>21</height>
+    </rect>
+   </property>
+   <widget class="QMenu" name="menuFile">
+    <property name="title">
+     <string>File</string>
+    </property>
+    <addaction name="actionOpen_Table"/>
+    <addaction name="actionReload_from_Disk"/>
+    <addaction name="separator"/>
+    <addaction name="actionSave"/>
+    <addaction name="actionSave_As"/>
+    <addaction name="actionSave_Workspaces"/>
+    <addaction name="separator"/>
+    <addaction name="actionClose_Refl_Gui"/>
+   </widget>
+   <widget class="QMenu" name="menuHelp">
+    <property name="title">
+     <string>Help</string>
+    </property>
+    <addaction name="actionMantid_Help"/>
+   </widget>
+   <widget class="QMenu" name="menuFunction">
+    <property name="title">
+     <string>Function</string>
+    </property>
+    <addaction name="actionTransfer"/>
+    <addaction name="actionAutofill"/>
+    <addaction name="separator"/>
+    <addaction name="actionProcess"/>
+    <addaction name="actionClear_Table"/>
+    <addaction name="separator"/>
+    <addaction name="actionSearch_RB"/>
+   </widget>
+   <widget class="QMenu" name="menuEdit">
+    <property name="title">
+     <string>Edit</string>
+    </property>
+    <addaction name="actionCopy"/>
+    <addaction name="actionCut"/>
+    <addaction name="actionPaste"/>
+    <addaction name="actionClear"/>
+   </widget>
+   <widget class="QMenu" name="menuOptions">
+    <property name="title">
+     <string>Options</string>
+    </property>
+    <addaction name="actionChoose_Columns"/>
+    <addaction name="actionRefl_Gui_Options"/>
+   </widget>
+   <addaction name="menuFile"/>
+   <addaction name="menuEdit"/>
+   <addaction name="menuOptions"/>
+   <addaction name="menuFunction"/>
+   <addaction name="menuHelp"/>
+  </widget>
+  <widget class="QStatusBar" name="statusMain">
+   <property name="font">
+    <font>
+     <pointsize>11</pointsize>
+    </font>
+   </property>
+  </widget>
+  <action name="actionSave_As">
+   <property name="text">
+    <string>Save As...</string>
+   </property>
+   <property name="shortcut">
+    <string>Ctrl+Alt+S</string>
+   </property>
+  </action>
+  <action name="actionOpen_Table">
+   <property name="text">
+    <string>Open Table...</string>
+   </property>
+   <property name="shortcut">
+    <string>Ctrl+O</string>
+   </property>
+  </action>
+  <action name="actionReload_from_Disk">
+   <property name="text">
+    <string>Reload from Disk</string>
+   </property>
+   <property name="shortcut">
+    <string>Ctrl+R</string>
+   </property>
+  </action>
+  <action name="actionSave_Workspaces">
+   <property name="text">
+    <string>Save Workspaces</string>
+   </property>
+   <property name="shortcut">
+    <string>Ctrl+Shift+S</string>
+   </property>
+  </action>
+  <action name="actionMantid_Help">
+   <property name="text">
+    <string>Mantid Help</string>
+   </property>
+   <property name="shortcut">
+    <string>Ctrl+H</string>
+   </property>
+  </action>
+  <action name="actionSave">
+   <property name="text">
+    <string>Save</string>
+   </property>
+   <property name="shortcut">
+    <string>Ctrl+S</string>
+   </property>
+  </action>
+  <action name="actionClose_Refl_Gui">
+   <property name="text">
+    <string>Close Refl Gui</string>
+   </property>
+   <property name="shortcut">
+    <string>Ctrl+F4</string>
+   </property>
+  </action>
+  <action name="actionAutofill">
+   <property name="text">
+    <string>Autofill</string>
+   </property>
+   <property name="shortcut">
+    <string>Alt+A</string>
+   </property>
+  </action>
+  <action name="actionProcess">
+   <property name="text">
+    <string>Process</string>
+   </property>
+   <property name="shortcut">
+    <string>Alt+P</string>
+   </property>
+  </action>
+  <action name="actionTransfer">
+   <property name="text">
+    <string>Transfer</string>
+   </property>
+   <property name="shortcut">
+    <string>Alt+T</string>
+   </property>
+  </action>
+  <action name="actionClear_Table">
+   <property name="text">
+    <string>Clear Table</string>
+   </property>
+   <property name="shortcut">
+    <string>Alt+C</string>
+   </property>
+  </action>
+  <action name="actionSearch_RB">
+   <property name="text">
+    <string>Search RB</string>
+   </property>
+   <property name="shortcut">
+    <string>Alt+R</string>
+   </property>
+  </action>
+  <action name="actionCopy">
+   <property name="text">
+    <string>Copy</string>
+   </property>
+   <property name="shortcut">
+    <string>Ctrl+C</string>
+   </property>
+  </action>
+  <action name="actionPaste">
+   <property name="text">
+    <string>Paste</string>
+   </property>
+   <property name="shortcut">
+    <string>Ctrl+V</string>
+   </property>
+  </action>
+  <action name="actionCut">
+   <property name="text">
+    <string>Cut</string>
+   </property>
+   <property name="shortcut">
+    <string>Ctrl+X</string>
+   </property>
+  </action>
+  <action name="actionClear">
+   <property name="text">
+    <string>Clear</string>
+   </property>
+   <property name="shortcut">
+    <string>Del</string>
+   </property>
+  </action>
+  <action name="actionChoose_Columns">
+   <property name="text">
+    <string>Choose Columns...</string>
+   </property>
+   <property name="shortcut">
+    <string>Ctrl+M</string>
+   </property>
+  </action>
+  <action name="actionRefl_Gui_Options">
+   <property name="text">
+    <string>Refl Gui Options...</string>
+   </property>
+   <property name="shortcut">
+    <string>Ctrl+Shift+O</string>
+   </property>
+  </action>
+ </widget>
+ <customwidgets>
+  <customwidget>
+   <class>MantidQt::MantidWidgets::WorkspaceSelector</class>
+   <extends>QComboBox</extends>
+   <header>MantidQtMantidWidgets/WorkspaceSelector.h</header>
+  </customwidget>
+ </customwidgets>
+ <tabstops>
+  <tabstop>comboInstrument</tabstop>
+  <tabstop>textRuns</tabstop>
+  <tabstop>comboPolarCorrect</tabstop>
+  <tabstop>textRB</tabstop>
+  <tabstop>spinDepth</tabstop>
+  <tabstop>buttonSearch</tabstop>
+  <tabstop>buttonAuto</tabstop>
+  <tabstop>buttonTransfer</tabstop>
+ </tabstops>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/MantidQt/CustomInterfaces/src/EnggDiffraction/EnggDiffractionPresenter.cpp b/MantidQt/CustomInterfaces/src/EnggDiffraction/EnggDiffractionPresenter.cpp
index 1afb10e991f9f1f42454e31ca82980d36362af50..7974d0abf78e3a0fca78c1a4c465a42ee8344807 100644
--- a/MantidQt/CustomInterfaces/src/EnggDiffraction/EnggDiffractionPresenter.cpp
+++ b/MantidQt/CustomInterfaces/src/EnggDiffraction/EnggDiffractionPresenter.cpp
@@ -15,6 +15,7 @@
 #include <Poco/File.h>
 
 #include <QThread>
+#include <MantidAPI/AlgorithmManager.h>
 
 using namespace Mantid::API;
 using namespace MantidQt::CustomInterfaces;
@@ -1465,7 +1466,7 @@ EnggDiffractionPresenter::loadToPreproc(const std::string runNo) {
   Workspace_sptr inWS;
 
   try {
-    auto load = Algorithm::fromString("Load");
+    auto load = Mantid::API::AlgorithmManager::Instance().createUnmanaged("Load");
     load->initialize();
     load->setPropertyValue("Filename", runNo);
     const std::string inWSName = "engggui_preproc_input_ws";
diff --git a/MantidQt/CustomInterfaces/src/Measurement.cpp b/MantidQt/CustomInterfaces/src/Measurement.cpp
deleted file mode 100644
index 1b0225105ea18fe808d34805948a29ab2b263c32..0000000000000000000000000000000000000000
--- a/MantidQt/CustomInterfaces/src/Measurement.cpp
+++ /dev/null
@@ -1,97 +0,0 @@
-#include "MantidQtCustomInterfaces/Measurement.h"
-#include <string>
-#include <sstream>
-
-namespace MantidQt {
-namespace CustomInterfaces {
-
-/**
- * Constructor
- * @param measurementId
- * @param subId
- * @param label
- * @param type
- * @param angle
- * @param run
- */
-Measurement::Measurement(const Measurement::IDType &measurementId,
-                         const Measurement::IDType &subId,
-                         const std::string &label, const std::string &type,
-                         const double angle, const std::string &run)
-    : m_measurementId(measurementId), m_subId(subId), m_label(label),
-      m_type(type), m_angle(angle), m_run(run) {
-
-  std::string accumulatedProblems;
-  if (m_measurementId.empty()) {
-    accumulatedProblems += "No measurement id. ";
-  } else if (m_subId.empty()) {
-    accumulatedProblems += "No sub id. ";
-  } else if (m_run.empty()) {
-    accumulatedProblems += "No run";
-  }
-  m_whyUnuseable = accumulatedProblems;
-}
-
-/**
- * Constructor making an invalid Measurement
- */
-Measurement::Measurement(const std::string &why)
-    : m_angle(0), m_whyUnuseable(why) {}
-
-/**
- * Copy constructor
- * @param other
- */
-Measurement::Measurement(const Measurement &other)
-    : m_measurementId(other.m_measurementId), m_subId(other.m_subId),
-      m_label(other.m_label), m_type(other.m_type), m_angle(other.m_angle),
-      m_run(other.m_run), m_whyUnuseable(other.m_whyUnuseable) {}
-
-/// Destructor
-Measurement::~Measurement() {}
-
-/**
- * InvalidMeasurement static creational method
- * @return Invalid measurement
- */
-Measurement Measurement::InvalidMeasurement(const std::string &why) {
-  return Measurement(why);
-}
-
-bool Measurement::isUseable() const { return m_whyUnuseable.empty(); }
-
-Measurement::IDType Measurement::id() const { return m_measurementId; }
-
-Measurement::IDType Measurement::subId() const { return m_subId; }
-
-std::string Measurement::label() const { return m_label; }
-
-std::string Measurement::type() const { return m_type; }
-
-double Measurement::angle() const { return m_angle; }
-
-std::string Measurement::run() const { return m_run; }
-
-std::string Measurement::angleStr() const {
-  std::stringstream buffer;
-  buffer << angle();
-  return buffer.str();
-}
-
-Measurement &Measurement::operator=(const Measurement &other) {
-  if (&other != this) {
-    m_measurementId = other.id();
-    m_subId = other.subId();
-    m_label = other.label();
-    m_type = other.type();
-    m_angle = other.angle();
-    m_run = other.run();
-    m_whyUnuseable = other.whyUnuseable();
-  }
-  return *this;
-}
-
-std::string Measurement::whyUnuseable() const { return m_whyUnuseable; }
-
-} // namespace CustomInterfaces
-} // namespace Mantid
diff --git a/MantidQt/CustomInterfaces/src/MultiDatasetFit/MDFAddWorkspaceDialog.cpp b/MantidQt/CustomInterfaces/src/MultiDatasetFit/MDFAddWorkspaceDialog.cpp
index c4bd1f1f3c62f85e240ab1fee44bdfd85d9668cc..f3e853c0b00b32b129863950ab62f8207e3790d0 100644
--- a/MantidQt/CustomInterfaces/src/MultiDatasetFit/MDFAddWorkspaceDialog.cpp
+++ b/MantidQt/CustomInterfaces/src/MultiDatasetFit/MDFAddWorkspaceDialog.cpp
@@ -2,6 +2,7 @@
 
 #include "MantidAPI/AnalysisDataService.h"
 #include "MantidAPI/MatrixWorkspace.h"
+#include "MantidAPI/WorkspaceGroup.h"
 #include "MantidKernel/ArrayProperty.h"
 #include "MantidKernel/ArrayBoundedValidator.h"
 
@@ -24,8 +25,9 @@ AddWorkspaceDialog::AddWorkspaceDialog(QWidget *parent):QDialog(parent),m_maxInd
   auto wsNames = Mantid::API::AnalysisDataService::Instance().getObjectNames();
   for(auto name = wsNames.begin(); name != wsNames.end(); ++name)
   {
-    auto ws = Mantid::API::AnalysisDataService::Instance().retrieveWS<Mantid::API::MatrixWorkspace>( *name );
-    if ( ws )
+    auto mws = Mantid::API::AnalysisDataService::Instance().retrieveWS<Mantid::API::MatrixWorkspace>( *name );
+    auto grp = Mantid::API::AnalysisDataService::Instance().retrieveWS<Mantid::API::WorkspaceGroup>( *name );
+    if ( mws || grp )
     {
       workspaceNames << QString::fromStdString( *name );
     }
@@ -40,15 +42,24 @@ AddWorkspaceDialog::AddWorkspaceDialog(QWidget *parent):QDialog(parent),m_maxInd
 /// @param wsName :: Name of newly selected workspace.
 void AddWorkspaceDialog::workspaceNameChanged(const QString& wsName)
 {
-  auto ws = Mantid::API::AnalysisDataService::Instance().retrieveWS<Mantid::API::MatrixWorkspace>( wsName.toStdString() );
-  if ( ws )
+  auto stdWsName = wsName.toStdString();
+  auto mws = Mantid::API::AnalysisDataService::Instance().retrieveWS<Mantid::API::MatrixWorkspace>( stdWsName );
+
+  auto grp = Mantid::API::AnalysisDataService::Instance().retrieveWS<Mantid::API::WorkspaceGroup>( stdWsName );
+  if ( grp && !grp->isEmpty() )
+  {
+    mws = boost::dynamic_pointer_cast<Mantid::API::MatrixWorkspace>(grp->getItem(0));
+  }
+
+  if ( mws )
   {
-    int maxValue = static_cast<int>(ws->getNumberHistograms()) - 1;
+    int maxValue = static_cast<int>(mws->getNumberHistograms()) - 1;
     if ( maxValue < 0 ) maxValue = 0;
     m_maxIndex = maxValue;
-    if ( m_uiForm.cbAllSpectra->isChecked() )
+    if ( m_uiForm.cbAllSpectra->isChecked() || m_maxIndex == 0 )
     {
-      m_uiForm.leWSIndices->setText(QString("0-%1").arg(m_maxIndex));
+      auto text = m_maxIndex > 0 ? QString("0-%1").arg(m_maxIndex) : "0";
+      m_uiForm.leWSIndices->setText(text);
     }
     else
     {
diff --git a/MantidQt/CustomInterfaces/src/MultiDatasetFit/MDFDataController.cpp b/MantidQt/CustomInterfaces/src/MultiDatasetFit/MDFDataController.cpp
index 573fc9ca9b9bb1d55327e3d47e8cc491f2968d63..7bd1660630b6236bc09e82e44759ba99b9f618b9 100644
--- a/MantidQt/CustomInterfaces/src/MultiDatasetFit/MDFDataController.cpp
+++ b/MantidQt/CustomInterfaces/src/MultiDatasetFit/MDFDataController.cpp
@@ -4,6 +4,7 @@
 
 #include "MantidAPI/AnalysisDataService.h"
 #include "MantidAPI/MatrixWorkspace.h"
+#include "MantidAPI/WorkspaceGroup.h"
 
 #include <QTableWidget>
 #include <QMessageBox>
@@ -44,14 +45,42 @@ void DataController::addWorkspace()
     if ( wsName.isEmpty() ) return;
     if ( Mantid::API::AnalysisDataService::Instance().doesExist( wsName.toStdString()) )
     {
-      auto ws = Mantid::API::AnalysisDataService::Instance().retrieveWS<Mantid::API::MatrixWorkspace>( wsName.toStdString() );
       auto indices = dialog.workspaceIndices();
-      for(auto i = indices.begin(); i != indices.end(); ++i)
+      std::vector<Mantid::API::MatrixWorkspace_sptr> matrixWorkspaces;
+      auto mws = Mantid::API::AnalysisDataService::Instance().retrieveWS<Mantid::API::MatrixWorkspace>( wsName.toStdString() );
+      if ( mws )
       {
-        addWorkspaceSpectrum( wsName, *i, *ws );
+        matrixWorkspaces.push_back(mws);
+      }
+      else
+      {
+        auto grp = Mantid::API::AnalysisDataService::Instance().retrieveWS<Mantid::API::WorkspaceGroup>( wsName.toStdString() );
+        if ( grp )
+        {
+          for(size_t i = 0; i < static_cast<size_t>(grp->getNumberOfEntries()); ++i)
+          {
+            mws = boost::dynamic_pointer_cast<Mantid::API::MatrixWorkspace>(grp->getItem(i));
+            if ( mws )
+            {
+              matrixWorkspaces.push_back(mws);
+            }
+          }
+        }
+      }
+
+      if ( !matrixWorkspaces.empty() )
+      {
+        for(auto iws = matrixWorkspaces.begin(); iws != matrixWorkspaces.end(); ++iws)
+        {
+          auto name = QString::fromStdString((**iws).name());
+          for(auto i = indices.begin(); i != indices.end(); ++i)
+          {
+            addWorkspaceSpectrum( name, *i, **iws );
+          }
+        }
+        emit spectraAdded(static_cast<int>(indices.size() * matrixWorkspaces.size()));
+        emit dataTableUpdated();
       }
-      emit spectraAdded(static_cast<int>(indices.size()));
-      emit dataTableUpdated();
     }
     else
     {
diff --git a/MantidQt/CustomInterfaces/src/Reflectometry/MeasurementItem.cpp b/MantidQt/CustomInterfaces/src/Reflectometry/MeasurementItem.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..e6b82c21ba2f65a94a962dc10089e585c0ef585c
--- /dev/null
+++ b/MantidQt/CustomInterfaces/src/Reflectometry/MeasurementItem.cpp
@@ -0,0 +1,97 @@
+#include "MantidQtCustomInterfaces/Reflectometry/MeasurementItem.h"
+#include <string>
+#include <sstream>
+
+namespace MantidQt {
+namespace CustomInterfaces {
+
+/**
+ * Constructor
+ * @param measurementItemId
+ * @param subId
+ * @param label
+ * @param type
+ * @param angle
+ * @param run
+ */
+MeasurementItem::MeasurementItem(const MeasurementItem::IDType &measurementItemId,
+                         const MeasurementItem::IDType &subId,
+                         const std::string &label, const std::string &type,
+                         const double angle, const std::string &run)
+    : m_measurementItemId(measurementItemId), m_subId(subId), m_label(label),
+      m_type(type), m_angle(angle), m_run(run) {
+
+  std::string accumulatedProblems;
+  if (m_measurementItemId.empty()) {
+    accumulatedProblems += "No measurement id. ";
+  } else if (m_subId.empty()) {
+    accumulatedProblems += "No sub id. ";
+  } else if (m_run.empty()) {
+    accumulatedProblems += "No run";
+  }
+  m_whyUnuseable = accumulatedProblems;
+}
+
+/**
+ * Constructor making an invalid Measurement
+ */
+MeasurementItem::MeasurementItem(const std::string &why)
+    : m_angle(0), m_whyUnuseable(why) {}
+
+/**
+ * Copy constructor
+ * @param other
+ */
+MeasurementItem::MeasurementItem(const MeasurementItem &other)
+    : m_measurementItemId(other.m_measurementItemId), m_subId(other.m_subId),
+      m_label(other.m_label), m_type(other.m_type), m_angle(other.m_angle),
+      m_run(other.m_run), m_whyUnuseable(other.m_whyUnuseable) {}
+
+/// Destructor
+MeasurementItem::~MeasurementItem() {}
+
+/**
+ * InvalidMeasurement static creational method
+ * @return Invalid measurement
+ */
+MeasurementItem MeasurementItem::InvalidMeasurementItem(const std::string &why) {
+  return MeasurementItem(why);
+}
+
+bool MeasurementItem::isUseable() const { return m_whyUnuseable.empty(); }
+
+MeasurementItem::IDType MeasurementItem::id() const { return m_measurementItemId; }
+
+MeasurementItem::IDType MeasurementItem::subId() const { return m_subId; }
+
+std::string MeasurementItem::label() const { return m_label; }
+
+std::string MeasurementItem::type() const { return m_type; }
+
+double MeasurementItem::angle() const { return m_angle; }
+
+std::string MeasurementItem::run() const { return m_run; }
+
+std::string MeasurementItem::angleStr() const {
+  std::stringstream buffer;
+  buffer << angle();
+  return buffer.str();
+}
+
+MeasurementItem &MeasurementItem::operator=(const MeasurementItem &other) {
+  if (&other != this) {
+    m_measurementItemId = other.id();
+    m_subId = other.subId();
+    m_label = other.label();
+    m_type = other.type();
+    m_angle = other.angle();
+    m_run = other.run();
+    m_whyUnuseable = other.whyUnuseable();
+  }
+  return *this;
+}
+
+std::string MeasurementItem::whyUnuseable() const { return m_whyUnuseable; }
+
+} // namespace CustomInterfaces
+} // namespace Mantid
diff --git a/MantidQt/CustomInterfaces/src/QReflTableModel.cpp b/MantidQt/CustomInterfaces/src/Reflectometry/QReflTableModel.cpp
similarity index 99%
rename from MantidQt/CustomInterfaces/src/QReflTableModel.cpp
rename to MantidQt/CustomInterfaces/src/Reflectometry/QReflTableModel.cpp
index a5b42ae845fb6db23179b6408095d23abfebfcc6..a4c393393788ac9377bf949919a8913fd608dd10 100644
--- a/MantidQt/CustomInterfaces/src/QReflTableModel.cpp
+++ b/MantidQt/CustomInterfaces/src/Reflectometry/QReflTableModel.cpp
@@ -1,4 +1,4 @@
-#include "MantidQtCustomInterfaces/QReflTableModel.h"
+#include "MantidQtCustomInterfaces//Reflectometry/QReflTableModel.h"
 #include "MantidAPI/ITableWorkspace.h"
 #include "MantidAPI/TableRow.h"
 
diff --git a/MantidQt/CustomInterfaces/src/QtReflMainView.cpp b/MantidQt/CustomInterfaces/src/Reflectometry/QtReflMainView.cpp
similarity index 98%
rename from MantidQt/CustomInterfaces/src/QtReflMainView.cpp
rename to MantidQt/CustomInterfaces/src/Reflectometry/QtReflMainView.cpp
index 7904631edece2961559c80537109ddcc2010bdad..ee75c320337f39d0ee26d233c1c23c2f0b2c1226 100644
--- a/MantidQt/CustomInterfaces/src/QtReflMainView.cpp
+++ b/MantidQt/CustomInterfaces/src/Reflectometry/QtReflMainView.cpp
@@ -1,7 +1,7 @@
-#include "MantidQtCustomInterfaces/QtReflMainView.h"
-#include "MantidQtCustomInterfaces/QReflTableModel.h"
-#include "MantidQtCustomInterfaces/ReflMainViewPresenter.h"
-#include "MantidQtCustomInterfaces/ReflTableSchema.h"
+#include "MantidQtCustomInterfaces/Reflectometry/QtReflMainView.h"
+#include "MantidQtCustomInterfaces/Reflectometry/QReflTableModel.h"
+#include "MantidQtCustomInterfaces/Reflectometry/ReflMainViewPresenter.h"
+#include "MantidQtCustomInterfaces/Reflectometry/ReflTableSchema.h"
 #include "MantidQtMantidWidgets/HintingLineEditFactory.h"
 #include "MantidAPI/ITableWorkspace.h"
 #include "MantidQtAPI/HelpWindow.h"
diff --git a/MantidQt/CustomInterfaces/src/QtReflOptionsDialog.cpp b/MantidQt/CustomInterfaces/src/Reflectometry/QtReflOptionsDialog.cpp
similarity index 95%
rename from MantidQt/CustomInterfaces/src/QtReflOptionsDialog.cpp
rename to MantidQt/CustomInterfaces/src/Reflectometry/QtReflOptionsDialog.cpp
index 501c461d1e06d0d9b6fab8f0c5303c4bf4cc2add..e9055a4bdabd93df54937c01d1818bfbe7278b8e 100644
--- a/MantidQt/CustomInterfaces/src/QtReflOptionsDialog.cpp
+++ b/MantidQt/CustomInterfaces/src/Reflectometry/QtReflOptionsDialog.cpp
@@ -1,5 +1,5 @@
-#include "MantidQtCustomInterfaces/QtReflOptionsDialog.h"
-#include "MantidQtCustomInterfaces/QtReflMainView.h"
+#include "MantidQtCustomInterfaces/Reflectometry/QtReflOptionsDialog.h"
+#include "MantidQtCustomInterfaces/Reflectometry/QtReflMainView.h"
 
 namespace MantidQt
 {
diff --git a/MantidQt/CustomInterfaces/src/ReflCatalogSearcher.cpp b/MantidQt/CustomInterfaces/src/Reflectometry/ReflCatalogSearcher.cpp
similarity index 95%
rename from MantidQt/CustomInterfaces/src/ReflCatalogSearcher.cpp
rename to MantidQt/CustomInterfaces/src/Reflectometry/ReflCatalogSearcher.cpp
index 7db4dd4d11e2aaf1cc8f7600e9ccc838ed5bc915..e6f207a74401a292f325e206964f911f9588b182 100644
--- a/MantidQt/CustomInterfaces/src/ReflCatalogSearcher.cpp
+++ b/MantidQt/CustomInterfaces/src/Reflectometry/ReflCatalogSearcher.cpp
@@ -1,4 +1,4 @@
-#include "MantidQtCustomInterfaces/ReflCatalogSearcher.h"
+#include "MantidQtCustomInterfaces/Reflectometry/ReflCatalogSearcher.h"
 
 #include "MantidAPI/AlgorithmManager.h"
 #include "MantidAPI/CatalogManager.h"
diff --git a/MantidQt/CustomInterfaces/src/ReflGenerateNotebook.cpp b/MantidQt/CustomInterfaces/src/Reflectometry/ReflGenerateNotebook.cpp
similarity index 99%
rename from MantidQt/CustomInterfaces/src/ReflGenerateNotebook.cpp
rename to MantidQt/CustomInterfaces/src/Reflectometry/ReflGenerateNotebook.cpp
index 3b467ed2e6d08c2a5b3fb82f185dc0a3a8c35951..91036d8cda3f01f309c5121569622d73ddfc1bed 100644
--- a/MantidQt/CustomInterfaces/src/ReflGenerateNotebook.cpp
+++ b/MantidQt/CustomInterfaces/src/Reflectometry/ReflGenerateNotebook.cpp
@@ -1,7 +1,7 @@
-#include "MantidQtCustomInterfaces/ReflGenerateNotebook.h"
+#include "MantidQtCustomInterfaces/Reflectometry/ReflGenerateNotebook.h"
 #include "MantidAPI/NotebookWriter.h"
 #include "MantidQtCustomInterfaces/ParseKeyValueString.h"
-#include "MantidQtCustomInterfaces/ReflVectorString.h"
+#include "MantidQtCustomInterfaces/Reflectometry/ReflVectorString.h"
 
 #include <sstream>
 #include <fstream>
diff --git a/MantidQt/CustomInterfaces/src/ReflLegacyTransferStrategy.cpp b/MantidQt/CustomInterfaces/src/Reflectometry/ReflLegacyTransferStrategy.cpp
similarity index 96%
rename from MantidQt/CustomInterfaces/src/ReflLegacyTransferStrategy.cpp
rename to MantidQt/CustomInterfaces/src/Reflectometry/ReflLegacyTransferStrategy.cpp
index ca5d75ac4199cd782efe817f81c112d602247655..ad3c5e04f7f8c3fbf48f0e1be2f0e6b45ec5de57 100644
--- a/MantidQt/CustomInterfaces/src/ReflLegacyTransferStrategy.cpp
+++ b/MantidQt/CustomInterfaces/src/Reflectometry/ReflLegacyTransferStrategy.cpp
@@ -1,5 +1,5 @@
-#include "MantidQtCustomInterfaces/ReflLegacyTransferStrategy.h"
-#include "MantidQtCustomInterfaces/ReflTableSchema.h"
+#include "MantidQtCustomInterfaces/Reflectometry/ReflLegacyTransferStrategy.h"
+#include "MantidQtCustomInterfaces/Reflectometry/ReflTableSchema.h"
 #include "MantidKernel/ProgressBase.h"
 #include <algorithm>
 #include <boost/lexical_cast.hpp>
diff --git a/MantidQt/CustomInterfaces/src/ReflMainViewPresenter.cpp b/MantidQt/CustomInterfaces/src/Reflectometry/ReflMainViewPresenter.cpp
similarity index 98%
rename from MantidQt/CustomInterfaces/src/ReflMainViewPresenter.cpp
rename to MantidQt/CustomInterfaces/src/Reflectometry/ReflMainViewPresenter.cpp
index 17e3a11183f4001504ee64deaece348ddde29608..941b1f9608d19c25be2f10fed83a1f633ca66012 100644
--- a/MantidQt/CustomInterfaces/src/ReflMainViewPresenter.cpp
+++ b/MantidQt/CustomInterfaces/src/Reflectometry/ReflMainViewPresenter.cpp
@@ -1,4 +1,4 @@
-#include "MantidQtCustomInterfaces/ReflMainViewPresenter.h"
+#include "MantidQtCustomInterfaces/Reflectometry/ReflMainViewPresenter.h"
 #include "MantidAPI/AlgorithmManager.h"
 #include "MantidAPI/CatalogManager.h"
 #include "MantidAPI/ITableWorkspace.h"
@@ -13,16 +13,16 @@
 #include "MantidKernel/TimeSeriesProperty.h"
 #include "MantidKernel/UserCatalogInfo.h"
 #include "MantidKernel/Utils.h"
-#include "MantidQtCustomInterfaces/ReflNexusMeasurementSource.h"
+#include "MantidQtCustomInterfaces/Reflectometry/ReflNexusMeasurementItemSource.h"
 #include "MantidQtCustomInterfaces/ProgressableView.h"
-#include "MantidQtCustomInterfaces/ReflCatalogSearcher.h"
-#include "MantidQtCustomInterfaces/ReflLegacyTransferStrategy.h"
-#include "MantidQtCustomInterfaces/ReflMeasureTransferStrategy.h"
-#include "MantidQtCustomInterfaces/ReflMainView.h"
-#include "MantidQtCustomInterfaces/ReflSearchModel.h"
-#include "MantidQtCustomInterfaces/QReflTableModel.h"
-#include "MantidQtCustomInterfaces/QtReflOptionsDialog.h"
-#include "MantidQtCustomInterfaces/ReflGenerateNotebook.h"
+#include "MantidQtCustomInterfaces/Reflectometry/ReflCatalogSearcher.h"
+#include "MantidQtCustomInterfaces/Reflectometry/ReflLegacyTransferStrategy.h"
+#include "MantidQtCustomInterfaces/Reflectometry/ReflMeasureTransferStrategy.h"
+#include "MantidQtCustomInterfaces/Reflectometry/ReflMainView.h"
+#include "MantidQtCustomInterfaces/Reflectometry/ReflSearchModel.h"
+#include "MantidQtCustomInterfaces/Reflectometry/QReflTableModel.h"
+#include "MantidQtCustomInterfaces/Reflectometry/QtReflOptionsDialog.h"
+#include "MantidQtCustomInterfaces/Reflectometry/ReflGenerateNotebook.h"
 #include "MantidQtMantidWidgets/AlgorithmHintStrategy.h"
 #include "MantidQtCustomInterfaces/ParseKeyValueString.h"
 
@@ -1694,7 +1694,7 @@ ReflMainViewPresenter::getTransferStrategy() {
     // We are going to load from disk to pick up the meta data, so provide the
     // right repository to do this.
     auto source =
-        std::unique_ptr<ReflMeasurementSource>(new ReflNexusMeasurementSource);
+        std::unique_ptr<ReflMeasurementItemSource>(new ReflNexusMeasurementItemSource);
 
     // Finally make and return the Measure based transfer strategy.
     return std::unique_ptr<ReflTransferStrategy>(
@@ -1712,4 +1712,4 @@ ReflMainViewPresenter::getTransferStrategy() {
 const std::string ReflMainViewPresenter::MeasureTransferMethod = "Measurement";
 const std::string ReflMainViewPresenter::LegacyTransferMethod = "Description";
 }
-}
\ No newline at end of file
+}
diff --git a/MantidQt/CustomInterfaces/src/ReflMeasureTransferStrategy.cpp b/MantidQt/CustomInterfaces/src/Reflectometry/ReflMeasureTransferStrategy.cpp
similarity index 75%
rename from MantidQt/CustomInterfaces/src/ReflMeasureTransferStrategy.cpp
rename to MantidQt/CustomInterfaces/src/Reflectometry/ReflMeasureTransferStrategy.cpp
index 1def673c3950a68d036d170ca0eb7e6702258faf..914c4ec143b893f5733fe333a621e9d846f40fe1 100644
--- a/MantidQt/CustomInterfaces/src/ReflMeasureTransferStrategy.cpp
+++ b/MantidQt/CustomInterfaces/src/Reflectometry/ReflMeasureTransferStrategy.cpp
@@ -1,6 +1,6 @@
-#include "MantidQtCustomInterfaces/ReflMeasureTransferStrategy.h"
-#include "MantidQtCustomInterfaces/ReflMeasurementSource.h"
-#include "MantidQtCustomInterfaces/ReflTableSchema.h"
+#include "MantidQtCustomInterfaces/Reflectometry/ReflMeasureTransferStrategy.h"
+#include "MantidQtCustomInterfaces/Reflectometry/ReflMeasurementItemSource.h"
+#include "MantidQtCustomInterfaces/Reflectometry/ReflTableSchema.h"
 #include "MantidKernel/ICatalogInfo.h"
 #include "MantidKernel/ProgressBase.h"
 #include "MantidKernel/UserCatalogInfo.h"
@@ -23,14 +23,14 @@ namespace CustomInterfaces {
  */
 ReflMeasureTransferStrategy::ReflMeasureTransferStrategy(
     std::unique_ptr<ICatalogInfo> catInfo,
-    std::unique_ptr<ReflMeasurementSource> measurementSource)
+    std::unique_ptr<ReflMeasurementItemSource> measurementItemSource)
     : m_catInfo(std::move(catInfo)),
-      m_measurementSource(std::move(measurementSource)) {}
+      m_measurementItemSource(std::move(measurementItemSource)) {}
 
 ReflMeasureTransferStrategy::ReflMeasureTransferStrategy(
     const ReflMeasureTransferStrategy &other)
     : m_catInfo(other.m_catInfo->clone()),
-      m_measurementSource(other.m_measurementSource->clone())
+      m_measurementItemSource(other.m_measurementItemSource->clone())
 
 {}
 
@@ -43,8 +43,8 @@ std::vector<std::map<std::string, std::string>>
 MantidQt::CustomInterfaces::ReflMeasureTransferStrategy::transferRuns(
     SearchResultMap &searchResults, Mantid::Kernel::ProgressBase &progress) {
 
-  typedef std::vector<Measurement> VecSameMeasurement;
-  typedef std::map<Measurement::IDType, VecSameMeasurement>
+  typedef std::vector<MeasurementItem> VecSameMeasurement;
+  typedef std::map<MeasurementItem::IDType, VecSameMeasurement>
       MapGroupedMeasurement;
 
   MapGroupedMeasurement mapOfMeasurements;
@@ -55,7 +55,7 @@ MantidQt::CustomInterfaces::ReflMeasureTransferStrategy::transferRuns(
     const auto definedPath = m_catInfo->transformArchivePath(location);
 
     // This is where we read the meta data.
-    Measurement metaData = m_measurementSource->obtain(definedPath, fuzzyName);
+    MeasurementItem metaData = m_measurementItemSource->obtain(definedPath, fuzzyName);
 
     // If the measurement information is not consistent, or could not be
     // obtained. skip this measurement.
@@ -86,22 +86,22 @@ MantidQt::CustomInterfaces::ReflMeasureTransferStrategy::transferRuns(
     // Map keyed by subId to index of exisiting subid written.
     std::map<std::string, size_t> subIdMap;
     for (size_t i = 0; i < group->second.size(); ++i) {
-      const Measurement &measurement = group->second[i];
-      if (subIdMap.find(measurement.subId()) != subIdMap.end()) {
+      const MeasurementItem &measurementItem = group->second[i];
+      if (subIdMap.find(measurementItem.subId()) != subIdMap.end()) {
         // We already have that subid.
-        const size_t rowIndex = subIdMap[measurement.subId()];
+        const size_t rowIndex = subIdMap[measurementItem.subId()];
         std::string currentRuns = output[rowIndex][ReflTableSchema::RUNS];
         output[rowIndex][ReflTableSchema::RUNS] =
-            currentRuns + "+" + measurement.run();
+            currentRuns + "+" + measurementItem.run();
       } else {
         std::map<std::string, std::string> row;
-        row[ReflTableSchema::RUNS] = measurement.run();
-        row[ReflTableSchema::ANGLE] = measurement.angleStr();
+        row[ReflTableSchema::RUNS] = measurementItem.run();
+        row[ReflTableSchema::ANGLE] = measurementItem.angleStr();
         std::stringstream buffer;
         buffer << nextGroupId;
         row[ReflTableSchema::GROUP] = buffer.str();
         output.push_back(row);
-        subIdMap.insert(std::make_pair(measurement.subId(), output.size()-1 /*Record actual row index*/));
+        subIdMap.insert(std::make_pair(measurementItem.subId(), output.size()-1 /*Record actual row index*/));
       }
     }
     ++nextGroupId;
diff --git a/MantidQt/CustomInterfaces/src/ReflNexusMeasurementSource.cpp b/MantidQt/CustomInterfaces/src/Reflectometry/ReflNexusMeasurementItemSource.cpp
similarity index 77%
rename from MantidQt/CustomInterfaces/src/ReflNexusMeasurementSource.cpp
rename to MantidQt/CustomInterfaces/src/Reflectometry/ReflNexusMeasurementItemSource.cpp
index 987eb402fc91dd2445af0bc7880b74c6a646c50a..01706e0571c883f6b5d311c80271ebe693271fc7 100644
--- a/MantidQt/CustomInterfaces/src/ReflNexusMeasurementSource.cpp
+++ b/MantidQt/CustomInterfaces/src/Reflectometry/ReflNexusMeasurementItemSource.cpp
@@ -1,5 +1,5 @@
 
-#include "MantidQtCustomInterfaces/ReflNexusMeasurementSource.h"
+#include "MantidQtCustomInterfaces/Reflectometry/ReflNexusMeasurementItemSource.h"
 #include <Poco/File.h>
 #include <Poco/Exception.h>
 #include "MantidAPI/AlgorithmManager.h"
@@ -21,15 +21,15 @@ namespace CustomInterfaces {
 //----------------------------------------------------------------------------------------------
 /** Constructor
  */
-ReflNexusMeasurementSource::ReflNexusMeasurementSource() {}
+ReflNexusMeasurementItemSource::ReflNexusMeasurementItemSource() {}
 
 //----------------------------------------------------------------------------------------------
 /** Destructor
  */
-ReflNexusMeasurementSource::~ReflNexusMeasurementSource() {}
+ReflNexusMeasurementItemSource::~ReflNexusMeasurementItemSource() {}
 
-Measurement
-ReflNexusMeasurementSource::obtain(const std::string &definedPath,
+MeasurementItem
+ReflNexusMeasurementItemSource::obtain(const std::string &definedPath,
                                    const std::string &fuzzyName) const {
   std::string filenameArg = fuzzyName;
   if (!definedPath.empty()) {
@@ -60,13 +60,13 @@ ReflNexusMeasurementSource::obtain(const std::string &definedPath,
     algLoadRun->execute();
 
     auto run = hostWorkspace->run();
-    const std::string measurementId =
+    const std::string measurementItemId =
         run.getPropertyValueAsType<std::string>("measurement_id");
-    const std::string measurementSubId =
+    const std::string measurementItemSubId =
         run.getPropertyValueAsType<std::string>("measurement_subid");
-    const std::string measurementLabel =
+    const std::string measurementItemLabel =
         run.getPropertyValueAsType<std::string>("measurement_label");
-    const std::string measurementType =
+    const std::string measurementItemType =
         run.getPropertyValueAsType<std::string>("measurement_type");
     std::string runNumber;
     try {
@@ -88,8 +88,8 @@ ReflNexusMeasurementSource::obtain(const std::string &definedPath,
     } catch (Exception::NotFoundError &) {
     }
 
-    return Measurement(measurementId, measurementSubId, measurementLabel,
-                       measurementType, theta, runNumber);
+    return MeasurementItem(measurementItemId, measurementItemSubId, measurementItemLabel,
+                       measurementItemType, theta, runNumber);
 
   } catch (std::invalid_argument &ex) {
     std::stringstream buffer;
@@ -97,12 +97,12 @@ ReflNexusMeasurementSource::obtain(const std::string &definedPath,
            << std::endl;
     buffer << ex.what();
     const std::string message = buffer.str();
-    return Measurement::InvalidMeasurement(message);
+    return MeasurementItem::InvalidMeasurementItem(message);
   }
 }
 
-ReflNexusMeasurementSource *ReflNexusMeasurementSource::clone() const {
-  return new ReflNexusMeasurementSource(*this);
+ReflNexusMeasurementItemSource *ReflNexusMeasurementItemSource::clone() const {
+  return new ReflNexusMeasurementItemSource(*this);
 }
 
 } // namespace CustomInterfaces
diff --git a/MantidQt/CustomInterfaces/src/ReflSearchModel.cpp b/MantidQt/CustomInterfaces/src/Reflectometry/ReflSearchModel.cpp
similarity index 96%
rename from MantidQt/CustomInterfaces/src/ReflSearchModel.cpp
rename to MantidQt/CustomInterfaces/src/Reflectometry/ReflSearchModel.cpp
index 184fe19cc7efa4d78788301730a937cce5fdc2e9..8a4549ea9baf2eb9b3b0990d4f9cfd955c6ab277 100644
--- a/MantidQt/CustomInterfaces/src/ReflSearchModel.cpp
+++ b/MantidQt/CustomInterfaces/src/Reflectometry/ReflSearchModel.cpp
@@ -1,5 +1,5 @@
-#include "MantidQtCustomInterfaces/ReflSearchModel.h"
-#include "MantidQtCustomInterfaces/ReflTransferStrategy.h"
+#include "MantidQtCustomInterfaces/Reflectometry/ReflSearchModel.h"
+#include "MantidQtCustomInterfaces/Reflectometry/ReflTransferStrategy.h"
 #include "MantidAPI/ITableWorkspace.h"
 #include "MantidAPI/TableRow.h"
 
diff --git a/MantidQt/CustomInterfaces/src/ReflTableSchema.cpp b/MantidQt/CustomInterfaces/src/Reflectometry/ReflTableSchema.cpp
similarity index 93%
rename from MantidQt/CustomInterfaces/src/ReflTableSchema.cpp
rename to MantidQt/CustomInterfaces/src/Reflectometry/ReflTableSchema.cpp
index ccae82358661f179d46a02ad0601bc8f4ebf15dd..d0325ef1de808b33bd2d3eb5948111b375ef6f30 100644
--- a/MantidQt/CustomInterfaces/src/ReflTableSchema.cpp
+++ b/MantidQt/CustomInterfaces/src/Reflectometry/ReflTableSchema.cpp
@@ -1,4 +1,4 @@
-#include "MantidQtCustomInterfaces/ReflTableSchema.h"
+#include "MantidQtCustomInterfaces/Reflectometry/ReflTableSchema.h"
 #include <utility>
 
 namespace MantidQt {
diff --git a/MantidQt/CustomInterfaces/src/Tomography/TomographyIfaceModel.cpp b/MantidQt/CustomInterfaces/src/Tomography/TomographyIfaceModel.cpp
index 5aaaaccde66a10647182a685e42fefe0ca5570aa..05e7323bf9c9e59963d323d60a8b410e550d961f 100644
--- a/MantidQt/CustomInterfaces/src/Tomography/TomographyIfaceModel.cpp
+++ b/MantidQt/CustomInterfaces/src/Tomography/TomographyIfaceModel.cpp
@@ -1,5 +1,6 @@
 #include "MantidKernel/FacilityInfo.h"
 #include "MantidQtAPI/AlgorithmRunner.h"
+#include "MantidAPI/AlgorithmManager.h"
 #include "MantidQtCustomInterfaces/Tomography/TomographyIfaceModel.h"
 
 #include <QMutex>
@@ -568,7 +569,8 @@ void TomographyIfaceModel::splitCmdLine(const std::string &cmd,
 WorkspaceGroup_sptr
 TomographyIfaceModel::loadFITSImage(const std::string &path) {
   // get fits file into workspace and retrieve it from the ADS
-  auto alg = Algorithm::fromString("LoadFITS");
+  auto alg = AlgorithmManager::Instance().createUnmanaged("LoadFITS");
+  //Algorithm::fromString("LoadFITS");
   alg->initialize();
   alg->setPropertyValue("Filename", path);
   std::string wsName = "__fits_ws_tomography_gui";
diff --git a/MantidQt/CustomInterfaces/test/MeasurementTest.h b/MantidQt/CustomInterfaces/test/MeasurementItemTest.h
similarity index 67%
rename from MantidQt/CustomInterfaces/test/MeasurementTest.h
rename to MantidQt/CustomInterfaces/test/MeasurementItemTest.h
index f18ea5eb4618dc4d925d30459b9722359ada74ef..c9e3d01c241970841a71e0d2e9d4c78c38607494 100644
--- a/MantidQt/CustomInterfaces/test/MeasurementTest.h
+++ b/MantidQt/CustomInterfaces/test/MeasurementItemTest.h
@@ -1,22 +1,22 @@
-#ifndef MANTIDQT_CUSTOMINTERFACES_MEASUREMENTTEST_H_
-#define MANTIDQT_CUSTOMINTERFACES_MEASUREMENTTEST_H_
+#ifndef MANTIDQT_CUSTOMINTERFACES_MEASUREMENTITEMTEST_H_
+#define MANTIDQT_CUSTOMINTERFACES_MEASUREMENTITEMTEST_H_
 
 #include <cxxtest/TestSuite.h>
 
-#include "MantidQtCustomInterfaces/Measurement.h"
+#include "MantidQtCustomInterfaces/Reflectometry/MeasurementItem.h"
 
 using namespace MantidQt::CustomInterfaces;
 
-class MeasurementTest : public CxxTest::TestSuite {
+class MeasurementItemTest : public CxxTest::TestSuite {
 public:
   // This pair of boilerplate methods prevent the suite being created statically
   // This means the constructor isn't called when running other tests
-  static MeasurementTest *createSuite() { return new MeasurementTest(); }
-  static void destroySuite(MeasurementTest *suite) { delete suite; }
+  static MeasurementItemTest *createSuite() { return new MeasurementItemTest(); }
+  static void destroySuite(MeasurementItemTest *suite) { delete suite; }
 
   void test_invalid_construction_via_constructional_method() {
     std::string message = "Gave up";
-    auto measure = Measurement::InvalidMeasurement(message);
+    auto measure = MeasurementItem::InvalidMeasurementItem(message);
     TS_ASSERT(!measure.isUseable());
     TS_ASSERT_EQUALS(message, measure.whyUnuseable());
   }
@@ -29,7 +29,7 @@ public:
     const double angle = 0.1;
     const std::string run = "123";
 
-    Measurement measurement(measurementId, measurementSubId, measurementLabel,
+    MeasurementItem measurement(measurementId, measurementSubId, measurementLabel,
                             measurementType, angle, run);
 
     TS_ASSERT(measurement.isUseable());
@@ -43,7 +43,7 @@ public:
 
   void test_invalid_construction_when_measurementId_empty() {
 
-    Measurement measurement("", "measurementSubId", "measurementLabel",
+    MeasurementItem measurement("", "measurementSubId", "measurementLabel",
                             "measurementType", 0.1, "111");
 
     TS_ASSERT(!measurement.isUseable());
@@ -51,7 +51,7 @@ public:
 
   void test_invalid_construction_when_measurementSubId_empty() {
 
-    Measurement measurement("measurementId", "", "measurementLabel",
+    MeasurementItem measurement("measurementId", "", "measurementLabel",
                             "measurementType", 0.1, "111");
 
     TS_ASSERT(!measurement.isUseable());
@@ -59,18 +59,18 @@ public:
 
   void test_valid_construction_when_label_empty() {
 
-    Measurement measurement("measurementId", "measurementSubId", "",
+    MeasurementItem measurement("measurementId", "measurementSubId", "",
                             "measurementType", 0.1, "111");
 
     TSM_ASSERT("Empty labels are not terminal", measurement.isUseable());
   }
 
   void test_valid_construction_when_type_empty() {
-    Measurement measurement("measurementId", "measurementSubId",
+    MeasurementItem measurement("measurementId", "measurementSubId",
                             "measurementLabel", "", 0.1, "111");
 
     TSM_ASSERT("Empty type info is not terminal",measurement.isUseable());
   }
 };
 
-#endif /* MANTIDQT_CUSTOMINTERFACES_MEASUREMENTTEST_H_ */
+#endif /* MANTIDQT_CUSTOMINTERFACES_MEASUREMENTITEMTEST_H_ */
diff --git a/MantidQt/CustomInterfaces/test/ReflGenerateNotebookTest.h b/MantidQt/CustomInterfaces/test/ReflGenerateNotebookTest.h
index acd9b251dfbc858a692067b2c4dbd38484b9d6e9..205016eb9390e9f8afebfa94d0c2d4c65c18ad96 100644
--- a/MantidQt/CustomInterfaces/test/ReflGenerateNotebookTest.h
+++ b/MantidQt/CustomInterfaces/test/ReflGenerateNotebookTest.h
@@ -5,9 +5,9 @@
 #include <gmock/gmock.h>
 #include <gtest/gtest.h>
 
-#include "MantidQtCustomInterfaces/ReflGenerateNotebook.h"
-#include "MantidQtCustomInterfaces/ReflVectorString.h"
-#include "MantidQtCustomInterfaces/QReflTableModel.h"
+#include "MantidQtCustomInterfaces/Reflectometry/ReflGenerateNotebook.h"
+#include "MantidQtCustomInterfaces/Reflectometry/ReflVectorString.h"
+#include "MantidQtCustomInterfaces/Reflectometry/QReflTableModel.h"
 #include "MantidAPI/FrameworkManager.h"
 #include "MantidTestHelpers/WorkspaceCreationHelper.h"
 #include "MantidAPI/TableRow.h"
diff --git a/MantidQt/CustomInterfaces/test/ReflLegacyTransferStrategyTest.h b/MantidQt/CustomInterfaces/test/ReflLegacyTransferStrategyTest.h
index 1d21f0f0a1d59071c9220b720d742e56426bc8a3..1595323882bd3d8ad274126cd83bf8a1150c22d7 100644
--- a/MantidQt/CustomInterfaces/test/ReflLegacyTransferStrategyTest.h
+++ b/MantidQt/CustomInterfaces/test/ReflLegacyTransferStrategyTest.h
@@ -7,8 +7,8 @@
 #include <vector>
 #include <gmock/gmock.h>
 
-#include "MantidQtCustomInterfaces/ReflLegacyTransferStrategy.h"
-#include "MantidQtCustomInterfaces/ReflTableSchema.h"
+#include "MantidQtCustomInterfaces/Reflectometry/ReflLegacyTransferStrategy.h"
+#include "MantidQtCustomInterfaces/Reflectometry/ReflTableSchema.h"
 #include "ReflMainViewMockObjects.h"
 
 using namespace MantidQt::CustomInterfaces;
diff --git a/MantidQt/CustomInterfaces/test/ReflMainViewMockObjects.h b/MantidQt/CustomInterfaces/test/ReflMainViewMockObjects.h
index 38aee56b033b72f9e9defc7368e38f32af348d2e..2fc948796bc393e8cb55f14887712febc0dd27ab 100644
--- a/MantidQt/CustomInterfaces/test/ReflMainViewMockObjects.h
+++ b/MantidQt/CustomInterfaces/test/ReflMainViewMockObjects.h
@@ -3,10 +3,10 @@
 
 #include <gmock/gmock.h>
 #include "MantidQtCustomInterfaces/ProgressableView.h"
-#include "MantidQtCustomInterfaces/ReflMainView.h"
-#include "MantidQtCustomInterfaces/ReflSearchModel.h"
-#include "MantidQtCustomInterfaces/ReflTableSchema.h"
-#include "MantidQtCustomInterfaces/QReflTableModel.h"
+#include "MantidQtCustomInterfaces/Reflectometry/ReflMainView.h"
+#include "MantidQtCustomInterfaces/Reflectometry/ReflSearchModel.h"
+#include "MantidQtCustomInterfaces/Reflectometry/ReflTableSchema.h"
+#include "MantidQtCustomInterfaces/Reflectometry/QReflTableModel.h"
 #include "MantidAPI/TableRow.h"
 #include "MantidKernel/ICatalogInfo.h"
 #include "MantidKernel/ProgressBase.h"
diff --git a/MantidQt/CustomInterfaces/test/ReflMainViewPresenterTest.h b/MantidQt/CustomInterfaces/test/ReflMainViewPresenterTest.h
index ee704b312fbea317a6205fbc597589a70bfb3afb..c8d6be31c947d5b2c1a2dca5b3cc3444fed4fb5e 100644
--- a/MantidQt/CustomInterfaces/test/ReflMainViewPresenterTest.h
+++ b/MantidQt/CustomInterfaces/test/ReflMainViewPresenterTest.h
@@ -10,7 +10,7 @@
 #include "MantidAPI/FrameworkManager.h"
 #include "MantidAPI/TableRow.h"
 #include "MantidTestHelpers/WorkspaceCreationHelper.h"
-#include "MantidQtCustomInterfaces/ReflMainViewPresenter.h"
+#include "MantidQtCustomInterfaces/Reflectometry/ReflMainViewPresenter.h"
 
 #include "ReflMainViewMockObjects.h"
 
diff --git a/MantidQt/CustomInterfaces/test/ReflMeasureTransferStrategyTest.h b/MantidQt/CustomInterfaces/test/ReflMeasureTransferStrategyTest.h
index dd8e81a8b401ae23b47e6e3ab3d97aed0603c2e9..483cdc30aeaef5f2756557ba174864e01f5b44fe 100644
--- a/MantidQt/CustomInterfaces/test/ReflMeasureTransferStrategyTest.h
+++ b/MantidQt/CustomInterfaces/test/ReflMeasureTransferStrategyTest.h
@@ -3,9 +3,9 @@
 
 #include <cxxtest/TestSuite.h>
 #include "ReflMainViewMockObjects.h"
-#include "MantidQtCustomInterfaces/ReflMeasureTransferStrategy.h"
-#include "MantidQtCustomInterfaces/ReflMeasurementSource.h"
-#include "MantidQtCustomInterfaces/ReflTableSchema.h"
+#include "MantidQtCustomInterfaces/Reflectometry/ReflMeasureTransferStrategy.h"
+#include "MantidQtCustomInterfaces/Reflectometry/ReflMeasurementItemSource.h"
+#include "MantidQtCustomInterfaces/Reflectometry/ReflTableSchema.h"
 #include <memory>
 #include <gmock/gmock.h>
 #include <utility>
@@ -13,13 +13,13 @@
 using namespace testing;
 using namespace MantidQt::CustomInterfaces;
 
-class MockReflMeasurementSource
-    : public MantidQt::CustomInterfaces::ReflMeasurementSource {
+class MockReflMeasurementItemSource
+    : public MantidQt::CustomInterfaces::ReflMeasurementItemSource {
 public:
-  MOCK_CONST_METHOD2(obtain, MantidQt::CustomInterfaces::Measurement(
+  MOCK_CONST_METHOD2(obtain, MantidQt::CustomInterfaces::MeasurementItem(
                                  const std::string &, const std::string &));
-  MOCK_CONST_METHOD0(clone, MockReflMeasurementSource *());
-  ~MockReflMeasurementSource() {}
+  MOCK_CONST_METHOD0(clone, MockReflMeasurementItemSource *());
+  ~MockReflMeasurementItemSource() {}
 };
 
 class ReflMeasureTransferStrategyTest : public CxxTest::TestSuite {
@@ -36,17 +36,17 @@ public:
   void test_obtain_single_measurement() {
 
     // Search result inforation not used in the following since we mock the
-    // return from the measurementSource
+    // return from the measurementItemSource
     SearchResultMap data;
     data.insert(
         std::make_pair<std::string, SearchResult>("111", SearchResult()));
 
-    auto mockMeasurementSource = new MockReflMeasurementSource;
+    auto mockMeasurementItemSource = new MockReflMeasurementItemSource;
     // We expect that we are going to fetch the  measurement data for every
     // search result.
-    EXPECT_CALL(*mockMeasurementSource, obtain(_, _))
+    EXPECT_CALL(*mockMeasurementItemSource, obtain(_, _))
         .Times(Exactly(static_cast<int>(data.size())))
-        .WillRepeatedly(Return(Measurement("a", "s_a", "l", "t", 0, "111")));
+        .WillRepeatedly(Return(MeasurementItem("a", "s_a", "l", "t", 0, "111")));
 
     auto mockCatInfo = new MockICatalogInfo;
     // We expect that every location will be translated/transformed to make it
@@ -63,12 +63,12 @@ public:
     ReflMeasureTransferStrategy strategy(
         std::move(std::unique_ptr<MockICatalogInfo>(mockCatInfo)),
         std::move(
-            std::unique_ptr<MockReflMeasurementSource>(mockMeasurementSource)));
+            std::unique_ptr<MockReflMeasurementItemSource>(mockMeasurementItemSource)));
 
     strategy.transferRuns(data, progress);
 
     TS_ASSERT(Mock::VerifyAndClear(mockCatInfo));
-    TS_ASSERT(Mock::VerifyAndClear(mockMeasurementSource));
+    TS_ASSERT(Mock::VerifyAndClear(mockMeasurementItemSource));
   }
 
   void test_when_two_measurement_ids_match_group_them_but_not_others() {
@@ -83,14 +83,14 @@ public:
     data.insert(
         std::make_pair<std::string, SearchResult>("113", SearchResult()));
 
-    auto mockMeasurementSource = new MockReflMeasurementSource;
+    auto mockMeasurementItemSource = new MockReflMeasurementItemSource;
     // We are going to return three SearchResults two have the same measurement
     // id
-    EXPECT_CALL(*mockMeasurementSource, obtain(_, _))
+    EXPECT_CALL(*mockMeasurementItemSource, obtain(_, _))
         .Times(Exactly(static_cast<int>(data.size())))
-        .WillOnce(Return(Measurement("m1", "s1", "l1", "t1", 0.1, "111")))
-        .WillOnce(Return(Measurement("m1", "s2", "l1", "t1", 0.2, "122")))
-        .WillOnce(Return(Measurement("m2", "s2", "l1", "t1", 0.2, "123")));
+        .WillOnce(Return(MeasurementItem("m1", "s1", "l1", "t1", 0.1, "111")))
+        .WillOnce(Return(MeasurementItem("m1", "s2", "l1", "t1", 0.2, "122")))
+        .WillOnce(Return(MeasurementItem("m2", "s2", "l1", "t1", 0.2, "123")));
 
     auto mockCatInfo = new MockICatalogInfo;
     // We expect that every location will be translated/transformed to make it
@@ -108,7 +108,7 @@ public:
     ReflMeasureTransferStrategy strategy(
         std::move(std::unique_ptr<MockICatalogInfo>(mockCatInfo)),
         std::move(
-            std::unique_ptr<MockReflMeasurementSource>(mockMeasurementSource)));
+            std::unique_ptr<MockReflMeasurementItemSource>(mockMeasurementItemSource)));
 
     // Do the transfer
     auto transferResult = strategy.transferRuns(data, progress);
@@ -131,7 +131,7 @@ public:
                        transferResult[2][ReflTableSchema::GROUP]);
 
     TS_ASSERT(Mock::VerifyAndClear(mockCatInfo));
-    TS_ASSERT(Mock::VerifyAndClear(mockMeasurementSource));
+    TS_ASSERT(Mock::VerifyAndClear(mockMeasurementItemSource));
   }
 
   void test_when_two_measurement_sub_ids_match_combine_rows() {
@@ -146,13 +146,13 @@ public:
     data.insert(
         std::make_pair<std::string, SearchResult>("113", SearchResult()));
 
-    auto mockMeasurementSource = new MockReflMeasurementSource;
+    auto mockMeasurementItemSource = new MockReflMeasurementItemSource;
     // All 3 have same measurment id, but we also have 2 with same sub id.
-    EXPECT_CALL(*mockMeasurementSource, obtain(_, _))
+    EXPECT_CALL(*mockMeasurementItemSource, obtain(_, _))
         .Times(Exactly(static_cast<int>(data.size())))
-        .WillOnce(Return(Measurement("m1", "s1", "l1", "t1", 0.1, "111")))
-        .WillOnce(Return(Measurement("m1", "s1", "l1", "t1", 0.2, "122")))
-        .WillOnce(Return(Measurement("m1", "s2", "l1", "t1", 0.2, "123")));
+        .WillOnce(Return(MeasurementItem("m1", "s1", "l1", "t1", 0.1, "111")))
+        .WillOnce(Return(MeasurementItem("m1", "s1", "l1", "t1", 0.2, "122")))
+        .WillOnce(Return(MeasurementItem("m1", "s2", "l1", "t1", 0.2, "123")));
 
     auto mockCatInfo = new MockICatalogInfo;
     // We expect that every location will be translated/transformed to make it
@@ -170,7 +170,7 @@ public:
     ReflMeasureTransferStrategy strategy(
         std::move(std::unique_ptr<MockICatalogInfo>(mockCatInfo)),
         std::move(
-            std::unique_ptr<MockReflMeasurementSource>(mockMeasurementSource)));
+            std::unique_ptr<MockReflMeasurementItemSource>(mockMeasurementItemSource)));
 
     // Do the transfer
     auto transferResult = strategy.transferRuns(data, progress);
@@ -192,7 +192,7 @@ public:
     }
 
     TS_ASSERT(Mock::VerifyAndClear(mockCatInfo));
-    TS_ASSERT(Mock::VerifyAndClear(mockMeasurementSource));
+    TS_ASSERT(Mock::VerifyAndClear(mockMeasurementItemSource));
   }
   
     void test_complex_example_two_groups_of_two() {
@@ -209,14 +209,14 @@ public:
     data.insert(
         std::make_pair<std::string, SearchResult>("14916", SearchResult()));
 
-    auto mockMeasurementSource = new MockReflMeasurementSource;
+    auto mockMeasurementItemSource = new MockReflMeasurementItemSource;
     // All 3 have same measurment id, but we also have 2 with same sub id.
-    EXPECT_CALL(*mockMeasurementSource, obtain(_, _))
+    EXPECT_CALL(*mockMeasurementItemSource, obtain(_, _))
         .Times(Exactly(static_cast<int>(data.size())))
-        .WillOnce(Return(Measurement("m1", "s1", "l1", "t1", 0.1, "14913")))
-        .WillOnce(Return(Measurement("m1", "s1", "l1", "t1", 0.1, "14914")))
-        .WillOnce(Return(Measurement("m2", "s1", "l1", "t1", 0.2, "14915")))
-        .WillOnce(Return(Measurement("m2", "s1", "l1", "t1", 0.2, "14916")));
+        .WillOnce(Return(MeasurementItem("m1", "s1", "l1", "t1", 0.1, "14913")))
+        .WillOnce(Return(MeasurementItem("m1", "s1", "l1", "t1", 0.1, "14914")))
+        .WillOnce(Return(MeasurementItem("m2", "s1", "l1", "t1", 0.2, "14915")))
+        .WillOnce(Return(MeasurementItem("m2", "s1", "l1", "t1", 0.2, "14916")));
 
     auto mockCatInfo = new MockICatalogInfo;
     // We expect that every location will be translated/transformed to make it
@@ -234,7 +234,7 @@ public:
     ReflMeasureTransferStrategy strategy(
         std::move(std::unique_ptr<MockICatalogInfo>(mockCatInfo)),
         std::move(
-            std::unique_ptr<MockReflMeasurementSource>(mockMeasurementSource)));
+            std::unique_ptr<MockReflMeasurementItemSource>(mockMeasurementItemSource)));
 
     // Do the transfer
     auto transferResult = strategy.transferRuns(data, progress);
@@ -250,7 +250,7 @@ public:
                       transferResult[1][ReflTableSchema::RUNS]);
 
     TS_ASSERT(Mock::VerifyAndClear(mockCatInfo));
-    TS_ASSERT(Mock::VerifyAndClear(mockMeasurementSource));
+    TS_ASSERT(Mock::VerifyAndClear(mockMeasurementItemSource));
   }
 
 
@@ -261,12 +261,12 @@ public:
     data.insert(
         std::make_pair<std::string, SearchResult>("111", SearchResult()));
 
-    auto mockMeasurementSource = new MockReflMeasurementSource;
+    auto mockMeasurementItemSource = new MockReflMeasurementItemSource;
     // We expect that we are going to fetch the  measurement data for every
     // search result.
-    EXPECT_CALL(*mockMeasurementSource, obtain(_, _))
+    EXPECT_CALL(*mockMeasurementItemSource, obtain(_, _))
         .Times(Exactly(static_cast<int>(data.size())))
-        .WillRepeatedly(Return(Measurement::InvalidMeasurement("Abort!")));
+        .WillRepeatedly(Return(MeasurementItem::InvalidMeasurementItem("Abort!")));
 
     auto mockCatInfo = new MockICatalogInfo;
     // We expect that every location will be translated/transformed to make it
@@ -281,14 +281,14 @@ public:
     ReflMeasureTransferStrategy strategy(
         std::move(std::unique_ptr<MockICatalogInfo>(mockCatInfo)),
         std::move(
-            std::unique_ptr<MockReflMeasurementSource>(mockMeasurementSource)));
+            std::unique_ptr<MockReflMeasurementItemSource>(mockMeasurementItemSource)));
 
     auto result = strategy.transferRuns(data, progress);
 
     TSM_ASSERT_EQUALS("Measurements where invalid. Results should be empty.", 0,
                       result.size());
     TS_ASSERT(Mock::VerifyAndClear(mockCatInfo));
-    TS_ASSERT(Mock::VerifyAndClear(mockMeasurementSource));
+    TS_ASSERT(Mock::VerifyAndClear(mockMeasurementItemSource));
   }
 
   void test_clone() {
@@ -298,15 +298,15 @@ public:
     EXPECT_CALL(*pCatInfo, clone()).WillOnce(Return(new MockICatalogInfo));
 
     // Sub component Measurment source will be cloned
-    auto pMeasurementSource = new MockReflMeasurementSource;
-    EXPECT_CALL(*pMeasurementSource, clone())
-        .WillOnce(Return(new MockReflMeasurementSource));
+    auto pMeasurementItemSource = new MockReflMeasurementItemSource;
+    EXPECT_CALL(*pMeasurementItemSource, clone())
+        .WillOnce(Return(new MockReflMeasurementItemSource));
 
     // Create it
     ReflMeasureTransferStrategy strategy(
         std::move(std::unique_ptr<MockICatalogInfo>(pCatInfo)),
         std::move(
-            std::unique_ptr<MockReflMeasurementSource>(pMeasurementSource)));
+            std::unique_ptr<MockReflMeasurementItemSource>(pMeasurementItemSource)));
     // Clone it
     auto *clone = strategy.clone();
     TS_ASSERT(dynamic_cast<ReflMeasureTransferStrategy *>(clone));
@@ -317,8 +317,8 @@ public:
 
     ReflMeasureTransferStrategy strategy(
         std::unique_ptr<MockICatalogInfo>(new MockICatalogInfo),
-        std::unique_ptr<MockReflMeasurementSource>(
-            new MockReflMeasurementSource));
+        std::unique_ptr<MockReflMeasurementItemSource>(
+            new MockReflMeasurementItemSource));
 
     // ISIS nexus format files can have the right logs.
     TSM_ASSERT("Yes this transfer mechanism should know about nexus formats",
diff --git a/MantidQt/CustomInterfaces/test/ReflNexusMeasurementItemSourceTest.h b/MantidQt/CustomInterfaces/test/ReflNexusMeasurementItemSourceTest.h
new file mode 100644
index 0000000000000000000000000000000000000000..be7fc3d7c7c67310b2e7ccc9e37398bc812d44cf
--- /dev/null
+++ b/MantidQt/CustomInterfaces/test/ReflNexusMeasurementItemSourceTest.h
@@ -0,0 +1,56 @@
+#ifndef MANTIDQT_CUSTOMINTERFACES_REFLNEXUSMEASUREMENTITEMSOURCETEST_H_
+#define MANTIDQT_CUSTOMINTERFACES_REFLNEXUSMEASUREMENTITEMSOURCETEST_H_
+
+#include <cxxtest/TestSuite.h>
+#include "MantidQtCustomInterfaces/Reflectometry/ReflNexusMeasurementItemSource.h"
+#include "MantidAPI/FileFinder.h"
+#include <Poco/File.h>
+
+using namespace MantidQt::CustomInterfaces;
+
+class ReflNexusMeasurementItemSourceTest : public CxxTest::TestSuite {
+public:
+  // This pair of boilerplate methods prevent the suite being created statically
+  // This means the constructor isn't called when running other tests
+  static ReflNexusMeasurementItemSourceTest *createSuite() {
+    return new ReflNexusMeasurementItemSourceTest();
+  }
+  static void destroySuite(ReflNexusMeasurementItemSourceTest *suite) {
+    delete suite;
+  }
+
+  void test_obtain_via_full_path() {
+
+    std::string path =
+        Mantid::API::FileFinder::Instance().findRun("POLREF14966");
+    Poco::File file(path);
+    TSM_ASSERT("Test setup incorrect", !path.empty() && file.exists());
+
+    ReflNexusMeasurementItemSource source;
+    MeasurementItem measurementItem = source.obtain(path, "POLREF1111");
+    TS_ASSERT(measurementItem.isUseable());
+    TS_ASSERT(measurementItem.isUseable());
+    TS_ASSERT_EQUALS("34", measurementItem.id());
+    TS_ASSERT_EQUALS("0", measurementItem.subId());
+    TS_ASSERT_EQUALS(
+        "1111",
+        measurementItem
+            .run()); // Run number is taken from fuzzy because log is missing.
+    TS_ASSERT_EQUALS("", measurementItem.label());
+    TS_ASSERT_EQUALS("", measurementItem.label());
+  }
+
+  void test_obtain_via_fuzzy_path() {
+    ReflNexusMeasurementItemSource source;
+
+    MeasurementItem measurementItem = source.obtain("made_up", "POLREF14966");
+    TS_ASSERT(measurementItem.isUseable());
+    TS_ASSERT_EQUALS("34", measurementItem.id());
+    TS_ASSERT_EQUALS("0", measurementItem.subId());
+    TS_ASSERT_EQUALS("14966", measurementItem.run());
+    TS_ASSERT_EQUALS("", measurementItem.label());
+    TS_ASSERT_EQUALS("", measurementItem.label());
+  }
+};
+
+#endif /* MANTIDQT_CUSTOMINTERFACES_REFLNEXUSMEASUREMENTITEMSOURCETEST_H_ */
diff --git a/MantidQt/CustomInterfaces/test/ReflNexusMeasurementSourceTest.h b/MantidQt/CustomInterfaces/test/ReflNexusMeasurementSourceTest.h
deleted file mode 100644
index 88895772b14fe8cf588e3835bb2444acb29d9806..0000000000000000000000000000000000000000
--- a/MantidQt/CustomInterfaces/test/ReflNexusMeasurementSourceTest.h
+++ /dev/null
@@ -1,56 +0,0 @@
-#ifndef MANTIDQT_CUSTOMINTERFACES_REFLNEXUSMEASUREMENTSOURCETEST_H_
-#define MANTIDQT_CUSTOMINTERFACES_REFLNEXUSMEASUREMENTSOURCETEST_H_
-
-#include <cxxtest/TestSuite.h>
-#include "MantidQtCustomInterfaces/ReflNexusMeasurementSource.h"
-#include "MantidAPI/FileFinder.h"
-#include <Poco/File.h>
-
-using namespace MantidQt::CustomInterfaces;
-
-class ReflNexusMeasurementSourceTest : public CxxTest::TestSuite {
-public:
-  // This pair of boilerplate methods prevent the suite being created statically
-  // This means the constructor isn't called when running other tests
-  static ReflNexusMeasurementSourceTest *createSuite() {
-    return new ReflNexusMeasurementSourceTest();
-  }
-  static void destroySuite(ReflNexusMeasurementSourceTest *suite) {
-    delete suite;
-  }
-
-  void test_obtain_via_full_path() {
-
-    std::string path =
-        Mantid::API::FileFinder::Instance().findRun("POLREF14966");
-    Poco::File file(path);
-    TSM_ASSERT("Test setup incorrect", !path.empty() && file.exists());
-
-    ReflNexusMeasurementSource source;
-    Measurement measurement = source.obtain(path, "POLREF1111");
-    TS_ASSERT(measurement.isUseable());
-    TS_ASSERT(measurement.isUseable());
-    TS_ASSERT_EQUALS("34", measurement.id());
-    TS_ASSERT_EQUALS("0", measurement.subId());
-    TS_ASSERT_EQUALS(
-        "1111",
-        measurement
-            .run()); // Run number is taken from fuzzy because log is missing.
-    TS_ASSERT_EQUALS("", measurement.label());
-    TS_ASSERT_EQUALS("", measurement.label());
-  }
-
-  void test_obtain_via_fuzzy_path() {
-    ReflNexusMeasurementSource source;
-
-    Measurement measurement = source.obtain("made_up", "POLREF14966");
-    TS_ASSERT(measurement.isUseable());
-    TS_ASSERT_EQUALS("34", measurement.id());
-    TS_ASSERT_EQUALS("0", measurement.subId());
-    TS_ASSERT_EQUALS("14966", measurement.run());
-    TS_ASSERT_EQUALS("", measurement.label());
-    TS_ASSERT_EQUALS("", measurement.label());
-  }
-};
-
-#endif /* MANTIDQT_CUSTOMINTERFACES_REFLNEXUSMEASUREMENTSOURCETEST_H_ */
diff --git a/MantidQt/SliceViewer/src/DimensionSliceWidget.cpp b/MantidQt/SliceViewer/src/DimensionSliceWidget.cpp
index 9572cd4842eb5ff001fe9849a8321fed75d67e13..9ed368285f269422794401b62944dda0f37a105c 100644
--- a/MantidQt/SliceViewer/src/DimensionSliceWidget.cpp
+++ b/MantidQt/SliceViewer/src/DimensionSliceWidget.cpp
@@ -112,7 +112,8 @@ void DimensionSliceWidget::setShownDim(int dim)
   ui.btnY->setChecked( m_shownDim == 1 );
   ui.btnX->blockSignals(false);
   ui.btnY->blockSignals(false);
-  bool slicing = m_shownDim == -1;
+  /// Slice if dimension is not X or Y AND is not integrated
+  bool slicing = (m_shownDim == -1 && !m_dim->getIsIntegrated());
   ui.horizontalSlider->setVisible( slicing );
   ui.doubleSpinBox->setVisible( slicing );
   ui.lblUnits->setVisible( slicing );
diff --git a/Testing/Data/UnitTest/MDEvent_wo_MDFrames_w_QSample_flag.nxs.md5 b/Testing/Data/UnitTest/MDEvent_wo_MDFrames_w_QSample_flag.nxs.md5
new file mode 100644
index 0000000000000000000000000000000000000000..ab756c61aabf52bb8ae05e5c50f91bfba12ce20a
--- /dev/null
+++ b/Testing/Data/UnitTest/MDEvent_wo_MDFrames_w_QSample_flag.nxs.md5
@@ -0,0 +1 @@
+4ff5808a8bd608324b837786ab5f6b0c
diff --git a/Testing/Data/UnitTest/MDHisto_wo_MDFrames_w_HKL_flag.nxs.md5 b/Testing/Data/UnitTest/MDHisto_wo_MDFrames_w_HKL_flag.nxs.md5
new file mode 100644
index 0000000000000000000000000000000000000000..c0056abb8b9e5e398a863cb23c350d55a1ab2d3e
--- /dev/null
+++ b/Testing/Data/UnitTest/MDHisto_wo_MDFrames_w_HKL_flag.nxs.md5
@@ -0,0 +1 @@
+13a0674f6125d97b50922ef9e0f7be3c
diff --git a/Testing/Data/UnitTest/MDHisto_wo_MDFrames_w_HKL_flag_w_invalid_HKLUnits.nxs.md5 b/Testing/Data/UnitTest/MDHisto_wo_MDFrames_w_HKL_flag_w_invalid_HKLUnits.nxs.md5
new file mode 100644
index 0000000000000000000000000000000000000000..2167ff24141f360f9fb1bd2cde16fa44f3d8beea
--- /dev/null
+++ b/Testing/Data/UnitTest/MDHisto_wo_MDFrames_w_HKL_flag_w_invalid_HKLUnits.nxs.md5
@@ -0,0 +1 @@
+1127b87f1f64f236e53795f5b384e28b
diff --git a/Testing/Data/UnitTest/test_non_orthogonal.nxs.md5 b/Testing/Data/UnitTest/test_non_orthogonal.nxs.md5
new file mode 100644
index 0000000000000000000000000000000000000000..7ce9e77135016d88eac68bdcc09f38b40f8b1076
--- /dev/null
+++ b/Testing/Data/UnitTest/test_non_orthogonal.nxs.md5
@@ -0,0 +1 @@
+973a3e1536f3b2342f9a7334c697d041
diff --git a/Vates/VatesAPI/src/vtkDataSetToNonOrthogonalDataSet.cpp b/Vates/VatesAPI/src/vtkDataSetToNonOrthogonalDataSet.cpp
index e40454272fa1251ffe186781a04b9b196bca2956..88d1313cc177ae4a5f0d73c5a7e01fac70912801 100644
--- a/Vates/VatesAPI/src/vtkDataSetToNonOrthogonalDataSet.cpp
+++ b/Vates/VatesAPI/src/vtkDataSetToNonOrthogonalDataSet.cpp
@@ -66,7 +66,6 @@ void addChangeOfBasisMatrixToFieldData(
                   "the data set.\n");
   }
 }
-
 }
 
 namespace Mantid {
@@ -115,8 +114,7 @@ vtkDataSetToNonOrthogonalDataSet::~vtkDataSetToNonOrthogonalDataSet() {}
 void vtkDataSetToNonOrthogonalDataSet::execute() {
   // Downcast to a vtkPointSet
   vtkPointSet *data = vtkPointSet::SafeDownCast(m_dataSet);
-  if (NULL == data)
-  {
+  if (NULL == data) {
     throw std::runtime_error("VTK dataset does not inherit from vtkPointSet");
   }
 
@@ -159,7 +157,7 @@ void vtkDataSetToNonOrthogonalDataSet::execute() {
     }
     wMatArr = run.getPropertyValueAsType<std::vector<double>>("W_MATRIX");
     try {
-      API::CoordTransform const * transform = infoWs->getTransformToOriginal();
+      API::CoordTransform const *transform = infoWs->getTransformToOriginal();
       affMat = transform->makeAffineMatrix();
     } catch (std::runtime_error &) {
       // Create identity matrix of dimension+1
@@ -356,8 +354,7 @@ void vtkDataSetToNonOrthogonalDataSet::stripMatrix(Kernel::DblMatrix &mat) {
  * VTK dataset.
  * @param ugrid : The VTK dataset to add the metadata to
  */
-void vtkDataSetToNonOrthogonalDataSet::updateMetaData(vtkDataSet *ugrid)
-{
+void vtkDataSetToNonOrthogonalDataSet::updateMetaData(vtkDataSet *ugrid) {
   // Create and add the change of basis matrix
   addChangeOfBasisMatrixToFieldData(ugrid, m_basisX, m_basisY, m_basisZ,
                                     m_boundingBox);
diff --git a/Vates/VatesAPI/test/MDHWNexusLoadingPresenterTest.h b/Vates/VatesAPI/test/MDHWNexusLoadingPresenterTest.h
index 306a52a0b91eb59e596a2655b4537f678de726e9..04109bca40c6d3ebc9a197c9194cc99d76783f12 100644
--- a/Vates/VatesAPI/test/MDHWNexusLoadingPresenterTest.h
+++ b/Vates/VatesAPI/test/MDHWNexusLoadingPresenterTest.h
@@ -3,6 +3,17 @@
 
 #include <cxxtest/TestSuite.h>
 #include <vtkUnstructuredGrid.h>
+#include <vtkSmartPointer.h>
+#include <vtkMatrix4x4.h>
+#include <vtkPVChangeOfBasisHelper.h>
+#include <vtkDataArray.h>
+#include "MantidVatesAPI/vtkMD0DFactory.h"
+#include "MantidVatesAPI/vtkMDHistoLineFactory.h"
+#include "MantidVatesAPI/vtkMDHistoQuadFactory.h"
+#include "MantidVatesAPI/vtkMDHistoHexFactory.h"
+#include "MantidVatesAPI/vtkMDHistoHex4DFactory.h"
+#include "MantidVatesAPI/TimeToTimeStep.h"
+#include "MantidVatesAPI/IgnoreZerosThresholdRange.h"
 
 #include <gmock/gmock.h>
 #include <gtest/gtest.h>
@@ -12,186 +23,319 @@
 #include "MantidVatesAPI/MDHWNexusLoadingPresenter.h"
 #include "MantidVatesAPI/FilteringUpdateProgressAction.h"
 
+#include <limits>
+
 using namespace Mantid::VATES;
 using namespace testing;
 //=====================================================================================
 // Functional tests
 //=====================================================================================
-class MDHWNexusLoadingPresenterTest : public CxxTest::TestSuite
-{
+class MDHWNexusLoadingPresenterTest : public CxxTest::TestSuite {
 
 private:
-
-  // Helper method to return the full path to a real nexus file that is the correct format for this functionality.
-  static std::string getSuitableFile()
-  {
-    std::string temp = Mantid::API::FileFinder::Instance().getFullPath("SEQ_MDHW.nxs");
+  // Helper method to return the full path to a real nexus file that is the
+  // correct format for this functionality.
+  static std::string getSuitableFile() {
+    std::string temp =
+        Mantid::API::FileFinder::Instance().getFullPath("SEQ_MDHW.nxs");
     return temp;
   }
-  
-  // Helper method to return the full path to a real nexus file that is the wrong format for this functionality.
-  static std::string getUnhandledFile()
-  {
-    std::string temp = Mantid::API::FileFinder::Instance().getFullPath("CNCS_7860_event.nxs");
+
+  // Helper method to return the full path to a real nexus file that is the
+  // wrong format for this functionality.
+  static std::string getUnhandledFile() {
+    std::string temp =
+        Mantid::API::FileFinder::Instance().getFullPath("CNCS_7860_event.nxs");
     return temp;
   }
 
+  vtkDataSet *doExecute(std::string filename, bool performAsserts = true) {
+    // Setup view
+    MockMDLoadingView *view = new MockMDLoadingView;
+    EXPECT_CALL(*view, getTime()).WillRepeatedly(Return(0));
+    EXPECT_CALL(*view, getRecursionDepth()).Times(AtLeast(0));
+    EXPECT_CALL(*view, getLoadInMemory())
+        .Times(AtLeast(1))
+        .WillRepeatedly(testing::Return(true));
+    EXPECT_CALL(*view, updateAlgorithmProgress(_, _)).Times(AnyNumber());
+
+    // Setup rendering factory
+    MockvtkDataSetFactory factory;
+    EXPECT_CALL(factory, initialize(_)).Times(1);
+    EXPECT_CALL(factory, create(_))
+        .WillOnce(testing::Return(vtkUnstructuredGrid::New()));
+
+    // Setup progress updates objects
+    MockProgressAction mockLoadingProgressAction;
+    MockProgressAction mockDrawingProgressAction;
+
+    // Create the presenter and runit!
+    MDHWNexusLoadingPresenter presenter(view, filename);
+    presenter.executeLoadMetadata();
+    vtkDataSet *product = presenter.execute(&factory, mockLoadingProgressAction,
+                                            mockDrawingProgressAction);
+
+    TSM_ASSERT("Should have generated a vtkDataSet", NULL != product);
+    if (performAsserts) {
+      TSM_ASSERT_EQUALS("Wrong type of output generated", "vtkUnstructuredGrid",
+                        std::string(product->GetClassName()));
+      TSM_ASSERT("No field data!", NULL != product->GetFieldData());
+      TSM_ASSERT_EQUALS(
+          "Two arrays expected on field data, one for XML and one for JSON!", 2,
+          product->GetFieldData()->GetNumberOfArrays());
+      TS_ASSERT_THROWS_NOTHING(presenter.hasTDimensionAvailable());
+      TS_ASSERT_THROWS_NOTHING(presenter.getGeometryXML());
+      TS_ASSERT(!presenter.getWorkspaceTypeName().empty());
+
+      TS_ASSERT(Mock::VerifyAndClearExpectations(view));
+      TS_ASSERT(Mock::VerifyAndClearExpectations(&factory));
+    }
+    return product;
+  }
+
 public:
+  void testConstructWithEmptyFileThrows() {
+    TSM_ASSERT_THROWS("Should throw if an empty file string is given.",
+                      MDHWNexusLoadingPresenter(new MockMDLoadingView, ""),
+                      std::invalid_argument);
+  }
+
+  void testConstructWithNullViewThrows() {
+    MockMDLoadingView *pView = NULL;
 
-void testConstructWithEmptyFileThrows()
-{
-  TSM_ASSERT_THROWS("Should throw if an empty file string is given.", MDHWNexusLoadingPresenter(new MockMDLoadingView, ""), std::invalid_argument);
-}
-
-void testConstructWithNullViewThrows()
-{
-  MockMDLoadingView*  pView = NULL;
-
-  TSM_ASSERT_THROWS("Should throw if an empty file string is given.", MDHWNexusLoadingPresenter(pView, "some_file"), std::invalid_argument);
-}
-
-void testConstruct()
-{
-  TSM_ASSERT_THROWS_NOTHING("Object should be created without exception.", MDHWNexusLoadingPresenter(new MockMDLoadingView, getSuitableFile()));
-}
-
-void testCanReadFile()
-{
-  MDHWNexusLoadingPresenter presenter(new MockMDLoadingView, getUnhandledFile());
-  TSM_ASSERT("A file of this type cannot and should not be read by this presenter!.", !presenter.canReadFile());
-}
-
-void testExecution()
-{
-  //Setup view
-  MockMDLoadingView* view = new MockMDLoadingView;
-  EXPECT_CALL(*view, getTime()).WillRepeatedly(Return(0));
-  EXPECT_CALL(*view, getRecursionDepth()).Times(AtLeast(0));
-  EXPECT_CALL(*view, getLoadInMemory()).Times(AtLeast(1)).WillRepeatedly(testing::Return(true)); 
-  EXPECT_CALL(*view, updateAlgorithmProgress(_,_)).Times(AnyNumber());
-
-  //Setup rendering factory
-  MockvtkDataSetFactory factory;
-  EXPECT_CALL(factory, initialize(_)).Times(1);
-  EXPECT_CALL(factory, create(_)).WillOnce(testing::Return(vtkUnstructuredGrid::New()));
-
-  //Setup progress updates objects
-  MockProgressAction mockLoadingProgressAction;
-  MockProgressAction mockDrawingProgressAction;
-  
-  //Create the presenter and runit!
-  MDHWNexusLoadingPresenter presenter(view, getSuitableFile());
-  presenter.executeLoadMetadata();
-  vtkDataSet* product = presenter.execute(&factory, mockLoadingProgressAction, mockDrawingProgressAction);
-
-  TSM_ASSERT("Should have generated a vtkDataSet", NULL != product);
-  TSM_ASSERT_EQUALS("Wrong type of output generated", "vtkUnstructuredGrid", std::string(product->GetClassName()));
-  TSM_ASSERT("No field data!", NULL != product->GetFieldData());
-  TSM_ASSERT_EQUALS("Two arrays expected on field data, one for XML and one for JSON!", 2, product->GetFieldData()->GetNumberOfArrays());
-  TS_ASSERT_THROWS_NOTHING(presenter.hasTDimensionAvailable());
-  TS_ASSERT_THROWS_NOTHING(presenter.getGeometryXML());
-  TS_ASSERT(!presenter.getWorkspaceTypeName().empty());
-
-  TS_ASSERT(Mock::VerifyAndClearExpectations(view));
-  TS_ASSERT(Mock::VerifyAndClearExpectations(&factory));
-
-  product->Delete();
-}
-
-void testCallHasTDimThrows()
-{
-  MDHWNexusLoadingPresenter presenter(new MockMDLoadingView, getSuitableFile());
-  TSM_ASSERT_THROWS("Should throw. Execute not yet run.", presenter.hasTDimensionAvailable(), std::runtime_error);
-}
-
-void testCallGetTDimensionValuesThrows()
-{
-  MDHWNexusLoadingPresenter presenter(new MockMDLoadingView, getSuitableFile());
-  TSM_ASSERT_THROWS("Should throw. Execute not yet run.", presenter.getTimeStepValues(), std::runtime_error);
-}
-
-void testCallGetGeometryThrows()
-{
-  MDHWNexusLoadingPresenter presenter(new MockMDLoadingView, getSuitableFile());
-  TSM_ASSERT_THROWS("Should throw. Execute not yet run.", presenter.getGeometryXML(), std::runtime_error);
-}
-
-void testGetWorkspaceTypeName()
-{
-  MDHWNexusLoadingPresenter presenter(new MockMDLoadingView, getSuitableFile());
-  TSM_ASSERT_EQUALS("Characterisation Test Failed", "", presenter.getWorkspaceTypeName());
-}
-
-void testTimeLabel()
-{
-  // Setup view
-  MockMDLoadingView* view = new MockMDLoadingView;
-  EXPECT_CALL(*view, getTime()).WillRepeatedly(Return(0));
-  EXPECT_CALL(*view, getRecursionDepth()).Times(AtLeast(0));
-  EXPECT_CALL(*view, getLoadInMemory()).Times(AtLeast(1)).WillRepeatedly(testing::Return(true));
-  EXPECT_CALL(*view, updateAlgorithmProgress(_,_)).Times(AnyNumber());
-
-  // Setup rendering factory
-  MockvtkDataSetFactory factory;
-  EXPECT_CALL(factory, initialize(_)).Times(1);
-  EXPECT_CALL(factory, create(_)).WillOnce(testing::Return(vtkUnstructuredGrid::New()));
-
-  // Setup progress updates objects
-  MockProgressAction mockLoadingProgressAction;
-  MockProgressAction mockDrawingProgressAction;
-
-  //Create the presenter and runit!
-  MDHWNexusLoadingPresenter presenter(view, getSuitableFile());
-  presenter.executeLoadMetadata();
-  vtkDataSet* product = presenter.execute(&factory, mockLoadingProgressAction, mockDrawingProgressAction);
-  TSM_ASSERT_EQUALS("Time label should be exact.",
-                    presenter.getTimeStepLabel(), "DeltaE (DeltaE)");
-
-  TS_ASSERT(Mock::VerifyAndClearExpectations(view));
-  TS_ASSERT(Mock::VerifyAndClearExpectations(&factory));
-
-  product->Delete();
-}
-
-void testAxisLabels()
-{
-  //Setup view
-  MockMDLoadingView* view = new MockMDLoadingView;
-  EXPECT_CALL(*view, getTime()).WillRepeatedly(Return(0));
-  EXPECT_CALL(*view, getRecursionDepth()).Times(AtLeast(0));
-  EXPECT_CALL(*view, getLoadInMemory()).Times(AtLeast(1)).WillRepeatedly(testing::Return(true));
-  EXPECT_CALL(*view, updateAlgorithmProgress(_,_)).Times(AnyNumber());
-
-  //Setup rendering factory
-  MockvtkDataSetFactory factory;
-  EXPECT_CALL(factory, initialize(_)).Times(1);
-  EXPECT_CALL(factory, create(_)).WillOnce(testing::Return(vtkUnstructuredGrid::New()));
-
-  //Setup progress updates objects
-  MockProgressAction mockLoadingProgressAction;
-  MockProgressAction mockDrawingProgressAction;
-
-  //Create the presenter and runit!
-  MDHWNexusLoadingPresenter presenter(view, getSuitableFile());
-  presenter.executeLoadMetadata();
-  vtkDataSet* product = presenter.execute(&factory, mockLoadingProgressAction, mockDrawingProgressAction);
-  TSM_ASSERT_THROWS_NOTHING("Should pass", presenter.setAxisLabels(product));
-
-  TSM_ASSERT_EQUALS("X Label should match exactly",
-                    getStringFieldDataValue(product, "AxisTitleForX"),
-                    "[H,0,0] ($in$ $1.992$ $\\AA^{-1}$)");
-  TSM_ASSERT_EQUALS("Y Label should match exactly",
-                    getStringFieldDataValue(product, "AxisTitleForY"),
-                    "[0,K,0] ($in$ $1.992$ $\\AA^{-1}$)");
-  TSM_ASSERT_EQUALS("Z Label should match exactly",
-                    getStringFieldDataValue(product, "AxisTitleForZ"),
-                    "[0,0,L] ($in$ $1.087$ $\\AA^{-1}$)");
-
-  TS_ASSERT(Mock::VerifyAndClearExpectations(view));
-  TS_ASSERT(Mock::VerifyAndClearExpectations(&factory));
-
-  product->Delete();
-}
+    TSM_ASSERT_THROWS("Should throw if an empty file string is given.",
+                      MDHWNexusLoadingPresenter(pView, "some_file"),
+                      std::invalid_argument);
+  }
+
+  void testConstruct() {
+    TSM_ASSERT_THROWS_NOTHING(
+        "Object should be created without exception.",
+        MDHWNexusLoadingPresenter(new MockMDLoadingView, getSuitableFile()));
+  }
+
+  void testCanReadFile() {
+    MDHWNexusLoadingPresenter presenter(new MockMDLoadingView,
+                                        getUnhandledFile());
+    TSM_ASSERT(
+        "A file of this type cannot and should not be read by this presenter!.",
+        !presenter.canReadFile());
+  }
+
+  void testExecution() {
+    auto filename = getSuitableFile();
+    auto product = doExecute(filename);
+    product->Delete();
+  }
 
+  void testExecutionWithLegacyFile() {
+    // This is not a good unit test but almost an integration test to
+    // check if the COB Matrix is affected when loading legacy files.
+    // Move this to system tests if it becomes availbale for C++ code.
+
+    auto filename = Mantid::API::FileFinder::Instance().getFullPath(
+        "test_non_orthogonal.nxs");
+
+    // Setup progress updates objects
+    NiceMock<MockProgressAction> mockLoadingProgressAction;
+    NiceMock<MockProgressAction> mockDrawingProgressAction;
+
+    // Setup view
+    MockMDLoadingView *view = new MockMDLoadingView;
+    EXPECT_CALL(*view, getTime()).WillRepeatedly(Return(0));
+    EXPECT_CALL(*view, getRecursionDepth()).Times(AtLeast(0));
+    EXPECT_CALL(*view, getLoadInMemory())
+        .Times(AtLeast(0))
+        .WillRepeatedly(testing::Return(true));
+    EXPECT_CALL(*view, updateAlgorithmProgress(_, _)).Times(AnyNumber());
+
+    ThresholdRange_scptr thresholdRange(new IgnoreZerosThresholdRange());
+
+    // Create the presenter as in the vtkMDHWSource
+    auto normalizationOption = Mantid::VATES::VisualNormalization::AutoSelect;
+    MDHWNexusLoadingPresenter presenter(view, filename);
+    const double time = 0.0;
+    vtkMD0DFactory *zeroDFactory = new vtkMD0DFactory;
+    vtkMDHistoLineFactory *lineFactory =
+        new vtkMDHistoLineFactory(thresholdRange, normalizationOption);
+    vtkMDHistoQuadFactory *quadFactory =
+        new vtkMDHistoQuadFactory(thresholdRange, normalizationOption);
+    vtkMDHistoHexFactory *hexFactory =
+        new vtkMDHistoHexFactory(thresholdRange, normalizationOption);
+    vtkMDHistoHex4DFactory<TimeToTimeStep> *factory =
+        new vtkMDHistoHex4DFactory<TimeToTimeStep>(thresholdRange,
+                                                   normalizationOption, time);
+
+    factory->SetSuccessor(hexFactory);
+    hexFactory->SetSuccessor(quadFactory);
+    quadFactory->SetSuccessor(lineFactory);
+    lineFactory->SetSuccessor(zeroDFactory);
+
+    presenter.executeLoadMetadata();
+    vtkDataSet *product = presenter.execute(factory, mockLoadingProgressAction,
+                                            mockDrawingProgressAction);
+
+    // Set the COB
+    try {
+      presenter.makeNonOrthogonal(product);
+    } catch (...) {
+      // Add the standard change of basis matrix and set the boundaries
+      presenter.setDefaultCOBandBoundaries(product);
+    }
+
+    // Assert that the COB matrix is a skewed matrix with the values below.
+    double expectedElements[16] = {
+        1.0, 0.50029480938126836, -0.0001890681732465397, 0.0, 0.0,
+        0.86585512859032043, 0.0015546654605598377, 0.0, 0.0, 0.0,
+        0.99999877363351386, 0.0, 0.0, 0.0, 0.0, 1.0};
+    vtkSmartPointer<vtkMatrix4x4> cobMatrix =
+        vtkPVChangeOfBasisHelper::GetChangeOfBasisMatrix(product);
+
+    TS_ASSERT_DELTA(cobMatrix->GetElement(0, 0), expectedElements[0],
+                    std::numeric_limits<double>::epsilon());
+
+    TS_ASSERT_DELTA(cobMatrix->GetElement(0, 1), expectedElements[1],
+                    std::numeric_limits<double>::epsilon());
+    TS_ASSERT_DELTA(cobMatrix->GetElement(0, 2), expectedElements[2],
+                    std::numeric_limits<double>::epsilon());
+    TS_ASSERT_DELTA(cobMatrix->GetElement(0, 3), expectedElements[3],
+                    std::numeric_limits<double>::epsilon());
+
+    TS_ASSERT_DELTA(cobMatrix->GetElement(1, 0), expectedElements[4],
+                    std::numeric_limits<double>::epsilon());
+    TS_ASSERT_DELTA(cobMatrix->GetElement(1, 1), expectedElements[5],
+                    std::numeric_limits<double>::epsilon());
+    TS_ASSERT_DELTA(cobMatrix->GetElement(1, 2), expectedElements[6],
+                    std::numeric_limits<double>::epsilon());
+    TS_ASSERT_DELTA(cobMatrix->GetElement(1, 3), expectedElements[7],
+                    std::numeric_limits<double>::epsilon());
+
+    TS_ASSERT_DELTA(cobMatrix->GetElement(2, 0), expectedElements[8],
+                    std::numeric_limits<double>::epsilon());
+    TS_ASSERT_DELTA(cobMatrix->GetElement(2, 1), expectedElements[9],
+                    std::numeric_limits<double>::epsilon());
+    TS_ASSERT_DELTA(cobMatrix->GetElement(2, 2), expectedElements[10],
+                    std::numeric_limits<double>::epsilon());
+    TS_ASSERT_DELTA(cobMatrix->GetElement(2, 3), expectedElements[11],
+                    std::numeric_limits<double>::epsilon());
+
+    TS_ASSERT_DELTA(cobMatrix->GetElement(3, 0), expectedElements[12],
+                    std::numeric_limits<double>::epsilon());
+    TS_ASSERT_DELTA(cobMatrix->GetElement(3, 1), expectedElements[13],
+                    std::numeric_limits<double>::epsilon());
+    TS_ASSERT_DELTA(cobMatrix->GetElement(3, 2), expectedElements[14],
+                    std::numeric_limits<double>::epsilon());
+    TS_ASSERT_DELTA(cobMatrix->GetElement(3, 3), expectedElements[15],
+                    std::numeric_limits<double>::epsilon());
+    product->Delete();
+    // Deleting factory should delete the whole chain since it is connected
+    // via smart pointers
+    delete factory;
+  }
+
+  void testCallHasTDimThrows() {
+    MDHWNexusLoadingPresenter presenter(new MockMDLoadingView,
+                                        getSuitableFile());
+    TSM_ASSERT_THROWS("Should throw. Execute not yet run.",
+                      presenter.hasTDimensionAvailable(), std::runtime_error);
+  }
+
+  void testCallGetTDimensionValuesThrows() {
+    MDHWNexusLoadingPresenter presenter(new MockMDLoadingView,
+                                        getSuitableFile());
+    TSM_ASSERT_THROWS("Should throw. Execute not yet run.",
+                      presenter.getTimeStepValues(), std::runtime_error);
+  }
+
+  void testCallGetGeometryThrows() {
+    MDHWNexusLoadingPresenter presenter(new MockMDLoadingView,
+                                        getSuitableFile());
+    TSM_ASSERT_THROWS("Should throw. Execute not yet run.",
+                      presenter.getGeometryXML(), std::runtime_error);
+  }
+
+  void testGetWorkspaceTypeName() {
+    MDHWNexusLoadingPresenter presenter(new MockMDLoadingView,
+                                        getSuitableFile());
+    TSM_ASSERT_EQUALS("Characterisation Test Failed", "",
+                      presenter.getWorkspaceTypeName());
+  }
+
+  void testTimeLabel() {
+    // Setup view
+    MockMDLoadingView *view = new MockMDLoadingView;
+    EXPECT_CALL(*view, getTime()).WillRepeatedly(Return(0));
+    EXPECT_CALL(*view, getRecursionDepth()).Times(AtLeast(0));
+    EXPECT_CALL(*view, getLoadInMemory())
+        .Times(AtLeast(1))
+        .WillRepeatedly(testing::Return(true));
+    EXPECT_CALL(*view, updateAlgorithmProgress(_, _)).Times(AnyNumber());
+
+    // Setup rendering factory
+    MockvtkDataSetFactory factory;
+    EXPECT_CALL(factory, initialize(_)).Times(1);
+    EXPECT_CALL(factory, create(_))
+        .WillOnce(testing::Return(vtkUnstructuredGrid::New()));
+
+    // Setup progress updates objects
+    MockProgressAction mockLoadingProgressAction;
+    MockProgressAction mockDrawingProgressAction;
+
+    // Create the presenter and runit!
+    MDHWNexusLoadingPresenter presenter(view, getSuitableFile());
+    presenter.executeLoadMetadata();
+    vtkDataSet *product = presenter.execute(&factory, mockLoadingProgressAction,
+                                            mockDrawingProgressAction);
+    TSM_ASSERT_EQUALS("Time label should be exact.",
+                      presenter.getTimeStepLabel(), "DeltaE (DeltaE)");
+
+    TS_ASSERT(Mock::VerifyAndClearExpectations(view));
+    TS_ASSERT(Mock::VerifyAndClearExpectations(&factory));
+
+    product->Delete();
+  }
+
+  void testAxisLabels() {
+    // Setup view
+    MockMDLoadingView *view = new MockMDLoadingView;
+    EXPECT_CALL(*view, getTime()).WillRepeatedly(Return(0));
+    EXPECT_CALL(*view, getRecursionDepth()).Times(AtLeast(0));
+    EXPECT_CALL(*view, getLoadInMemory())
+        .Times(AtLeast(1))
+        .WillRepeatedly(testing::Return(true));
+    EXPECT_CALL(*view, updateAlgorithmProgress(_, _)).Times(AnyNumber());
+
+    // Setup rendering factory
+    MockvtkDataSetFactory factory;
+    EXPECT_CALL(factory, initialize(_)).Times(1);
+    EXPECT_CALL(factory, create(_))
+        .WillOnce(testing::Return(vtkUnstructuredGrid::New()));
+
+    // Setup progress updates objects
+    MockProgressAction mockLoadingProgressAction;
+    MockProgressAction mockDrawingProgressAction;
+
+    // Create the presenter and runit!
+    MDHWNexusLoadingPresenter presenter(view, getSuitableFile());
+    presenter.executeLoadMetadata();
+    vtkDataSet *product = presenter.execute(&factory, mockLoadingProgressAction,
+                                            mockDrawingProgressAction);
+    TSM_ASSERT_THROWS_NOTHING("Should pass", presenter.setAxisLabels(product));
+
+    TSM_ASSERT_EQUALS("X Label should match exactly",
+                      getStringFieldDataValue(product, "AxisTitleForX"),
+                      "[H,0,0] ($in$ $1.992$ $\\AA^{-1}$)");
+    TSM_ASSERT_EQUALS("Y Label should match exactly",
+                      getStringFieldDataValue(product, "AxisTitleForY"),
+                      "[0,K,0] ($in$ $1.992$ $\\AA^{-1}$)");
+    TSM_ASSERT_EQUALS("Z Label should match exactly",
+                      getStringFieldDataValue(product, "AxisTitleForZ"),
+                      "[0,0,L] ($in$ $1.087$ $\\AA^{-1}$)");
+
+    TS_ASSERT(Mock::VerifyAndClearExpectations(view));
+    TS_ASSERT(Mock::VerifyAndClearExpectations(&factory));
+
+    product->Delete();
+  }
 };
 #endif
diff --git a/buildconfig/Jenkins/systemtests.bat b/buildconfig/Jenkins/systemtests.bat
index 0671670f715f3631332c9c085e25355240614872..9d19f91e2d53b337ab3d3713ccb26524d62e6016 100755
--- a/buildconfig/Jenkins/systemtests.bat
+++ b/buildconfig/Jenkins/systemtests.bat
@@ -11,8 +11,7 @@ setlocal enableextensions enabledelayedexpansion
 :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
 :: Print out the versions of things we are using
 :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
-set CMAKE_BIN_DIR=C:\Program Files (x86)\CMake 2.8\bin
-"%CMAKE_BIN_DIR%\cmake" --version 
+call cmake --version 
 echo %sha1%
 
 :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
@@ -37,17 +36,21 @@ cd %WORKSPACE%\build
 :: We use the special flag that only creates the targets for the data
 :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
 if not EXIST %WORKSPACE%\build\CMakeCache.txt (
-  "%CMAKE_BIN_DIR%\cmake" -DMANTID_DATA_STORE=!MANTID_DATA_STORE! -DDATA_TARGETS_ONLY=ON ..
+  call cmake -DMANTID_DATA_STORE=!MANTID_DATA_STORE! -DDATA_TARGETS_ONLY=ON ..
+  if ERRORLEVEL 1 exit /b %ERRORLEVEL%
 ) else (
   :: This ensures that any new data files are picked up by the cmake globbing
-  "%CMAKE_BIN_DIR%\cmake" .
+  call cmake .
+  if ERRORLEVEL 1 exit /b %ERRORLEVEL%
 )
 
 :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
 :: Build step
 :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
 msbuild /nologo /nr:false /p:Configuration=Release StandardTestData.vcxproj
+if ERRORLEVEL 1 exit /b %ERRORLEVEL%
 msbuild /nologo /nr:false /p:Configuration=Release SystemTestData.vcxproj
+if ERRORLEVEL 1 exit /b %ERRORLEVEL%
 
 :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
 :: Run the tests
@@ -64,4 +67,3 @@ echo usagereports.enabled = 0 >> %USERPROPS%
 set PKGDIR=%WORKSPACE%\build
 set PATH=C:\MantidInstall\bin;C:\MantidInstall\plugins;%PATH%
 python %WORKSPACE%\Testing\SystemTests\scripts\InstallerTests.py -o -d %PKGDIR%
-
diff --git a/docs/source/algorithms/ExportGeometry-v1.rst b/docs/source/algorithms/ExportGeometry-v1.rst
new file mode 100644
index 0000000000000000000000000000000000000000..6678c67a61cbe224696c7001f06c8fb7c62db886
--- /dev/null
+++ b/docs/source/algorithms/ExportGeometry-v1.rst
@@ -0,0 +1,53 @@
+
+.. algorithm::
+
+.. summary::
+
+.. alias::
+
+.. properties::
+
+Description
+-----------
+
+This algorithm is intended to write out portions of an instrument's
+geometry. The resulting file is mean to be copied by-hand into a
+geometry file. The main use of this is if the instrument geometry is
+calibrated in mantid, this algorithm can be used ot help get the
+information back into the initial instrument definition file.
+
+Usage
+-----
+
+.. testcode:: ExportGeometry
+
+   LoadEmptyInstrument(Filename="NOMAD_Definition.xml",
+                       OutputWorkspace="NOM_geom")
+   import mantid
+   filename=mantid.config.getString("defaultsave.directory")+"NOMgeometry.xml"
+   ExportGeometry(InputWorkspace="NOM_geom",
+                  Components="bank46,bank47",
+                  Filename=filename)
+   import os
+   if os.path.isfile(filename):
+       print "File created: True"
+
+.. testcleanup:: ExportGeometry
+
+   DeleteWorkspace("NOM_geom")
+   import mantid
+   filename=mantid.config.getString("defaultsave.directory")+"NOMgeometry.xml"
+   import os
+   if os.path.isfile(filename):
+       os.remove(filename)
+
+
+Output:
+
+.. testoutput:: ExportGeometry
+
+   File created: True
+
+.. categories::
+
+.. sourcelink::
diff --git a/installers/WinInstaller/scons-local/scons-LICENSE b/installers/WinInstaller/scons-local/scons-LICENSE
index 4df86d1d480dd5117d82f34dfef4e113b5f5d419..bd5632d16c5aa28436e086780b3d2a1a51cd4b77 100644
--- a/installers/WinInstaller/scons-local/scons-LICENSE
+++ b/installers/WinInstaller/scons-local/scons-LICENSE
@@ -3,7 +3,7 @@
         This copyright and license do not apply to any other software
         with which this software may have been included.
 
-Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+Copyright (c) 2001 - 2015 The SCons Foundation
 
 Permission is hereby granted, free of charge, to any person obtaining
 a copy of this software and associated documentation files (the
diff --git a/installers/WinInstaller/scons-local/scons-README b/installers/WinInstaller/scons-local/scons-README
index f1d59d4b4287c3b3ee6cf9c38362e2b60e09f1b6..40a1a194d18bffdb557da13ce14b62a48c4072a2 100644
--- a/installers/WinInstaller/scons-local/scons-README
+++ b/installers/WinInstaller/scons-local/scons-README
@@ -1,4 +1,4 @@
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 
                  SCons - a software construction tool
 
@@ -202,3 +202,4 @@ With plenty of help from the SCons Development team:
         Anthony Roach
         Terrel Shumway
 
+
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Platform/posix.py b/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Platform/posix.py
deleted file mode 100644
index cff1f93a422112641eefb1f8ccfc777b1dd839e7..0000000000000000000000000000000000000000
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Platform/posix.py
+++ /dev/null
@@ -1,263 +0,0 @@
-"""SCons.Platform.posix
-
-Platform-specific initialization for POSIX (Linux, UNIX, etc.) systems.
-
-There normally shouldn't be any need to import this module directly.  It
-will usually be imported through the generic SCons.Platform.Platform()
-selection method.
-"""
-
-#
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
-#
-# Permission is hereby granted, free of charge, to any person obtaining
-# a copy of this software and associated documentation files (the
-# "Software"), to deal in the Software without restriction, including
-# without limitation the rights to use, copy, modify, merge, publish,
-# distribute, sublicense, and/or sell copies of the Software, and to
-# permit persons to whom the Software is furnished to do so, subject to
-# the following conditions:
-#
-# The above copyright notice and this permission notice shall be included
-# in all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
-# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
-# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-#
-
-__revision__ = "src/engine/SCons/Platform/posix.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
-
-import errno
-import os
-import os.path
-import subprocess
-import sys
-import select
-
-import SCons.Util
-from SCons.Platform import TempFileMunge
-
-exitvalmap = {
-    2 : 127,
-    13 : 126,
-}
-
-def escape(arg):
-    "escape shell special characters"
-    slash = '\\'
-    special = '"$()'
-
-    arg = arg.replace(slash, slash+slash)
-    for c in special:
-        arg = arg.replace(c, slash+c)
-
-    return '"' + arg + '"'
-
-def exec_system(l, env):
-    stat = os.system(' '.join(l))
-    if stat & 0xff:
-        return stat | 0x80
-    return stat >> 8
-
-def exec_spawnvpe(l, env):
-    stat = os.spawnvpe(os.P_WAIT, l[0], l, env)
-    # os.spawnvpe() returns the actual exit code, not the encoding
-    # returned by os.waitpid() or os.system().
-    return stat
-
-def exec_fork(l, env): 
-    pid = os.fork()
-    if not pid:
-        # Child process.
-        exitval = 127
-        try:
-            os.execvpe(l[0], l, env)
-        except OSError, e:
-            exitval = exitvalmap.get(e[0], e[0])
-            sys.stderr.write("scons: %s: %s\n" % (l[0], e[1]))
-        os._exit(exitval)
-    else:
-        # Parent process.
-        pid, stat = os.waitpid(pid, 0)
-        if stat & 0xff:
-            return stat | 0x80
-        return stat >> 8
-
-def _get_env_command(sh, escape, cmd, args, env):
-    s = ' '.join(args)
-    if env:
-        l = ['env', '-'] + \
-            [escape(t[0])+'='+escape(t[1]) for t in env.items()] + \
-            [sh, '-c', escape(s)]
-        s = ' '.join(l)
-    return s
-
-def env_spawn(sh, escape, cmd, args, env):
-    return exec_system([_get_env_command( sh, escape, cmd, args, env)], env)
-
-def spawnvpe_spawn(sh, escape, cmd, args, env):
-    return exec_spawnvpe([sh, '-c', ' '.join(args)], env)
-
-def fork_spawn(sh, escape, cmd, args, env):
-    return exec_fork([sh, '-c', ' '.join(args)], env)
-
-def process_cmd_output(cmd_stdout, cmd_stderr, stdout, stderr):
-    stdout_eof = stderr_eof = 0
-    while not (stdout_eof and stderr_eof):
-        try:
-            (i,o,e) = select.select([cmd_stdout, cmd_stderr], [], [])
-            if cmd_stdout in i:
-                str = cmd_stdout.read()
-                if len(str) == 0:
-                    stdout_eof = 1
-                elif stdout is not None:
-                    stdout.write(str)
-            if cmd_stderr in i:
-                str = cmd_stderr.read()
-                if len(str) == 0:
-                    #sys.__stderr__.write( "stderr_eof=1\n" )
-                    stderr_eof = 1
-                else:
-                    #sys.__stderr__.write( "str(stderr) = %s\n" % str )
-                    stderr.write(str)
-        except select.error, (_errno, _strerror):
-            if _errno != errno.EINTR:
-                raise
-
-def exec_popen3(l, env, stdout, stderr):
-    proc = subprocess.Popen(' '.join(l),
-                            stdout=stdout,
-                            stderr=stderr,
-                            shell=True)
-    stat = proc.wait()
-    if stat & 0xff:
-        return stat | 0x80
-    return stat >> 8
-
-def exec_piped_fork(l, env, stdout, stderr):
-    # spawn using fork / exec and providing a pipe for the command's
-    # stdout / stderr stream
-    if stdout != stderr:
-        (rFdOut, wFdOut) = os.pipe()
-        (rFdErr, wFdErr) = os.pipe()
-    else:
-        (rFdOut, wFdOut) = os.pipe()
-        rFdErr = rFdOut
-        wFdErr = wFdOut
-    # do the fork
-    pid = os.fork()
-    if not pid:
-        # Child process
-        os.close( rFdOut )
-        if rFdOut != rFdErr:
-            os.close( rFdErr )
-        os.dup2( wFdOut, 1 ) # is there some symbolic way to do that ?
-        os.dup2( wFdErr, 2 )
-        os.close( wFdOut )
-        if stdout != stderr:
-            os.close( wFdErr )
-        exitval = 127
-        try:
-            os.execvpe(l[0], l, env)
-        except OSError, e:
-            exitval = exitvalmap.get(e[0], e[0])
-            stderr.write("scons: %s: %s\n" % (l[0], e[1]))
-        os._exit(exitval)
-    else:
-        # Parent process
-        pid, stat = os.waitpid(pid, 0)
-        os.close( wFdOut )
-        if stdout != stderr:
-            os.close( wFdErr )
-        childOut = os.fdopen( rFdOut )
-        if stdout != stderr:
-            childErr = os.fdopen( rFdErr )
-        else:
-            childErr = childOut
-        process_cmd_output(childOut, childErr, stdout, stderr)
-        os.close( rFdOut )
-        if stdout != stderr:
-            os.close( rFdErr )
-        if stat & 0xff:
-            return stat | 0x80
-        return stat >> 8
-
-def piped_env_spawn(sh, escape, cmd, args, env, stdout, stderr):
-    # spawn using Popen3 combined with the env command
-    # the command name and the command's stdout is written to stdout
-    # the command's stderr is written to stderr
-    return exec_popen3([_get_env_command(sh, escape, cmd, args, env)],
-                       env, stdout, stderr)
-
-def piped_fork_spawn(sh, escape, cmd, args, env, stdout, stderr):
-    # spawn using fork / exec and providing a pipe for the command's
-    # stdout / stderr stream
-    return exec_piped_fork([sh, '-c', ' '.join(args)],
-                           env, stdout, stderr)
-
-
-
-def generate(env):
-    # If os.spawnvpe() exists, we use it to spawn commands.  Otherwise
-    # if the env utility exists, we use os.system() to spawn commands,
-    # finally we fall back on os.fork()/os.exec().  
-    #
-    # os.spawnvpe() is prefered because it is the most efficient.  But
-    # for Python versions without it, os.system() is prefered because it
-    # is claimed that it works better with threads (i.e. -j) and is more
-    # efficient than forking Python.
-    #
-    # NB: Other people on the scons-users mailing list have claimed that
-    # os.fork()/os.exec() works better than os.system().  There may just
-    # not be a default that works best for all users.
-
-    if 'spawnvpe' in os.__dict__:
-        spawn = spawnvpe_spawn
-    elif env.Detect('env'):
-        spawn = env_spawn
-    else:
-        spawn = fork_spawn
-
-    if env.Detect('env'):
-        pspawn = piped_env_spawn
-    else:
-        pspawn = piped_fork_spawn
-
-    if 'ENV' not in env:
-        env['ENV']        = {}
-    env['ENV']['PATH']    = '/usr/local/bin:/opt/bin:/bin:/usr/bin'
-    env['OBJPREFIX']      = ''
-    env['OBJSUFFIX']      = '.o'
-    env['SHOBJPREFIX']    = '$OBJPREFIX'
-    env['SHOBJSUFFIX']    = '$OBJSUFFIX'
-    env['PROGPREFIX']     = ''
-    env['PROGSUFFIX']     = ''
-    env['LIBPREFIX']      = 'lib'
-    env['LIBSUFFIX']      = '.a'
-    env['SHLIBPREFIX']    = '$LIBPREFIX'
-    env['SHLIBSUFFIX']    = '.so'
-    env['LIBPREFIXES']    = [ '$LIBPREFIX' ]
-    env['LIBSUFFIXES']    = [ '$LIBSUFFIX', '$SHLIBSUFFIX' ]
-    env['PSPAWN']         = pspawn
-    env['SPAWN']          = spawn
-    env['SHELL']          = 'sh'
-    env['ESCAPE']         = escape
-    env['TEMPFILE']       = TempFileMunge
-    env['TEMPFILEPREFIX'] = '@'
-    #Based on LINUX: ARG_MAX=ARG_MAX=131072 - 3000 for environment expansion
-    #Note: specific platforms might rise or lower this value
-    env['MAXLINELENGTH']  = 128072
-
-    # This platform supports RPATH specifications.
-    env['__RPATH'] = '$_RPATH'
-
-# Local Variables:
-# tab-width:4
-# indent-tabs-mode:nil
-# End:
-# vim: set expandtab tabstop=4 shiftwidth=4:
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/dmd.py b/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/dmd.py
deleted file mode 100644
index 839020f0cc39a18fd3dd31c6d55d9615cde19f8a..0000000000000000000000000000000000000000
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/dmd.py
+++ /dev/null
@@ -1,240 +0,0 @@
-"""SCons.Tool.dmd
-
-Tool-specific initialization for the Digital Mars D compiler.
-(http://digitalmars.com/d)
-
-Coded by Andy Friesen (andy@ikagames.com)
-15 November 2003
-
-Amended by Russel Winder (russel@russel.org.uk)
-2010-02-07
-
-There are a number of problems with this script at this point in time.
-The one that irritates me the most is the Windows linker setup.  The D
-linker doesn't have a way to add lib paths on the commandline, as far
-as I can see.  You have to specify paths relative to the SConscript or
-use absolute paths.  To hack around it, add '#/blah'.  This will link
-blah.lib from the directory where SConstruct resides.
-
-Compiler variables:
-    DC - The name of the D compiler to use.  Defaults to dmd or gdmd,
-    whichever is found.
-    DPATH - List of paths to search for import modules.
-    DVERSIONS - List of version tags to enable when compiling.
-    DDEBUG - List of debug tags to enable when compiling.
-
-Linker related variables:
-    LIBS - List of library files to link in.
-    DLINK - Name of the linker to use.  Defaults to dmd or gdmd.
-    DLINKFLAGS - List of linker flags.
-
-Lib tool variables:
-    DLIB - Name of the lib tool to use.  Defaults to lib.
-    DLIBFLAGS - List of flags to pass to the lib tool.
-    LIBS - Same as for the linker. (libraries to pull into the .lib)
-"""
-
-#
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
-#
-# Permission is hereby granted, free of charge, to any person obtaining
-# a copy of this software and associated documentation files (the
-# "Software"), to deal in the Software without restriction, including
-# without limitation the rights to use, copy, modify, merge, publish,
-# distribute, sublicense, and/or sell copies of the Software, and to
-# permit persons to whom the Software is furnished to do so, subject to
-# the following conditions:
-#
-# The above copyright notice and this permission notice shall be included
-# in all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
-# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
-# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-#
-
-__revision__ = "src/engine/SCons/Tool/dmd.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
-
-import os
-
-import SCons.Action
-import SCons.Builder
-import SCons.Defaults
-import SCons.Scanner.D
-import SCons.Tool
-
-# Adapted from c++.py
-def isD(source):
-    if not source:
-        return 0
-
-    for s in source:
-        if s.sources:
-            ext = os.path.splitext(str(s.sources[0]))[1]
-            if ext == '.d':
-                return 1
-    return 0
-
-smart_link = {}
-
-smart_lib = {}
-
-def generate(env):
-    global smart_link
-    global smart_lib
-
-    static_obj, shared_obj = SCons.Tool.createObjBuilders(env)
-
-    DAction = SCons.Action.Action('$DCOM', '$DCOMSTR')
-
-    static_obj.add_action('.d', DAction)
-    shared_obj.add_action('.d', DAction)
-    static_obj.add_emitter('.d', SCons.Defaults.StaticObjectEmitter)
-    shared_obj.add_emitter('.d', SCons.Defaults.SharedObjectEmitter)
-
-    dc = env.Detect(['dmd', 'gdmd'])
-    env['DC'] = dc
-    env['DCOM'] = '$DC $_DINCFLAGS $_DVERFLAGS $_DDEBUGFLAGS $_DFLAGS -c -of$TARGET $SOURCES'
-    env['_DINCFLAGS'] = '$( ${_concat(DINCPREFIX, DPATH, DINCSUFFIX, __env__, RDirs, TARGET, SOURCE)}  $)'
-    env['_DVERFLAGS'] = '$( ${_concat(DVERPREFIX, DVERSIONS, DVERSUFFIX, __env__)}  $)'
-    env['_DDEBUGFLAGS'] = '$( ${_concat(DDEBUGPREFIX, DDEBUG, DDEBUGSUFFIX, __env__)} $)'
-    env['_DFLAGS'] = '$( ${_concat(DFLAGPREFIX, DFLAGS, DFLAGSUFFIX, __env__)} $)'
-
-    env['DPATH'] = ['#/']
-    env['DFLAGS'] = []
-    env['DVERSIONS'] = []
-    env['DDEBUG'] = []
-
-    if dc:
-        # Add the path to the standard library.
-        # This is merely for the convenience of the dependency scanner.
-        dmd_path = env.WhereIs(dc)
-        if dmd_path:
-            x = dmd_path.rindex(dc)
-            phobosDir = dmd_path[:x] + '/../src/phobos'
-            if os.path.isdir(phobosDir):
-                env.Append(DPATH = [phobosDir])
-
-    env['DINCPREFIX'] = '-I'
-    env['DINCSUFFIX'] = ''
-    env['DVERPREFIX'] = '-version='
-    env['DVERSUFFIX'] = ''
-    env['DDEBUGPREFIX'] = '-debug='
-    env['DDEBUGSUFFIX'] = ''
-    env['DFLAGPREFIX'] = '-'
-    env['DFLAGSUFFIX'] = ''
-    env['DFILESUFFIX'] = '.d'
-
-    # Need to use the Digital Mars linker/lib on windows.
-    # *nix can just use GNU link.
-    if env['PLATFORM'] == 'win32':
-        env['DLINK'] = '$DC'
-        env['DLINKCOM'] = '$DLINK -of$TARGET $SOURCES $DFLAGS $DLINKFLAGS $_DLINKLIBFLAGS'
-        env['DLIB'] = 'lib'
-        env['DLIBCOM'] = '$DLIB $_DLIBFLAGS -c $TARGET $SOURCES $_DLINKLIBFLAGS'
-
-        env['_DLINKLIBFLAGS'] = '$( ${_concat(DLIBLINKPREFIX, LIBS, DLIBLINKSUFFIX, __env__, RDirs, TARGET, SOURCE)} $)'
-        env['_DLIBFLAGS'] = '$( ${_concat(DLIBFLAGPREFIX, DLIBFLAGS, DLIBFLAGSUFFIX, __env__)} $)'
-        env['DLINKFLAGS'] = []
-        env['DLIBLINKPREFIX'] = ''
-        env['DLIBLINKSUFFIX'] = '.lib'
-        env['DLIBFLAGPREFIX'] = '-'
-        env['DLIBFLAGSUFFIX'] = ''
-        env['DLINKFLAGPREFIX'] = '-'
-        env['DLINKFLAGSUFFIX'] = ''
-
-        SCons.Tool.createStaticLibBuilder(env)
-
-        # Basically, we hijack the link and ar builders with our own.
-        # these builders check for the presence of D source, and swap out
-        # the system's defaults for the Digital Mars tools.  If there's no D
-        # source, then we silently return the previous settings.
-        linkcom = env.get('LINKCOM')
-        try:
-            env['SMART_LINKCOM'] = smart_link[linkcom]
-        except KeyError:
-            def _smartLink(source, target, env, for_signature,
-                           defaultLinker=linkcom):
-                if isD(source):
-                    # XXX I'm not sure how to add a $DLINKCOMSTR variable
-                    # so that it works with this _smartLink() logic,
-                    # and I don't have a D compiler/linker to try it out,
-                    # so we'll leave it alone for now.
-                    return '$DLINKCOM'
-                else:
-                    return defaultLinker
-            env['SMART_LINKCOM'] = smart_link[linkcom] = _smartLink
-
-        arcom = env.get('ARCOM')
-        try:
-            env['SMART_ARCOM'] = smart_lib[arcom]
-        except KeyError:
-            def _smartLib(source, target, env, for_signature,
-                         defaultLib=arcom):
-                if isD(source):
-                    # XXX I'm not sure how to add a $DLIBCOMSTR variable
-                    # so that it works with this _smartLib() logic, and
-                    # I don't have a D compiler/archiver to try it out,
-                    # so we'll leave it alone for now.
-                    return '$DLIBCOM'
-                else:
-                    return defaultLib
-            env['SMART_ARCOM'] = smart_lib[arcom] = _smartLib
-
-        # It is worth noting that the final space in these strings is
-        # absolutely pivotal.  SCons sees these as actions and not generators
-        # if it is not there. (very bad)
-        env['ARCOM'] = '$SMART_ARCOM '
-        env['LINKCOM'] = '$SMART_LINKCOM '
-    else: # assuming linux
-        linkcom = env.get('LINKCOM')
-        try:
-            env['SMART_LINKCOM'] = smart_link[linkcom]
-        except KeyError:
-            def _smartLink(source, target, env, for_signature,
-                           defaultLinker=linkcom, dc=dc):
-                if isD(source):
-                    try:
-                        libs = env['LIBS']
-                    except KeyError:
-                        libs = []
-                    if dc == 'dmd':
-                        # TODO: This assumes that the dmd executable is in the
-                        # bin directory and that the libraries are in a peer
-                        # directory lib.  This true of the Digital Mars
-                        # distribution but . . .
-                        import glob
-                        dHome = env.WhereIs(dc).replace('/dmd' , '/..')
-                        if glob.glob(dHome + '/lib/*phobos2*'):
-                            if 'phobos2' not in libs:
-                                env.Append(LIBPATH = [dHome + '/lib'])
-                                env.Append(LIBS = ['phobos2'])
-                                # TODO: Find out when there will be a
-                                # 64-bit version of D.
-                                env.Append(LINKFLAGS = ['-m32'])
-                        else:
-                            if 'phobos' not in libs:
-                                env.Append(LIBS = ['phobos'])
-                    elif dc is 'gdmd':
-                        env.Append(LIBS = ['gphobos'])
-                    if 'pthread' not in libs:
-                        env.Append(LIBS = ['pthread'])
-                    if 'm' not in libs:
-                        env.Append(LIBS = ['m'])
-                return defaultLinker
-            env['SMART_LINKCOM'] = smart_link[linkcom] = _smartLink
-
-        env['LINKCOM'] = '$SMART_LINKCOM '
-
-def exists(env):
-    return env.Detect(['dmd', 'gdmd'])
-
-# Local Variables:
-# tab-width:4
-# indent-tabs-mode:nil
-# End:
-# vim: set expandtab tabstop=4 shiftwidth=4:
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/link.py b/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/link.py
deleted file mode 100644
index 13a671d767e1379bb0be28e24a626537fb0400bf..0000000000000000000000000000000000000000
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/link.py
+++ /dev/null
@@ -1,122 +0,0 @@
-"""SCons.Tool.link
-
-Tool-specific initialization for the generic Posix linker.
-
-There normally shouldn't be any need to import this module directly.
-It will usually be imported through the generic SCons.Tool.Tool()
-selection method.
-
-"""
-
-#
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
-#
-# Permission is hereby granted, free of charge, to any person obtaining
-# a copy of this software and associated documentation files (the
-# "Software"), to deal in the Software without restriction, including
-# without limitation the rights to use, copy, modify, merge, publish,
-# distribute, sublicense, and/or sell copies of the Software, and to
-# permit persons to whom the Software is furnished to do so, subject to
-# the following conditions:
-#
-# The above copyright notice and this permission notice shall be included
-# in all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
-# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
-# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-#
-
-__revision__ = "src/engine/SCons/Tool/link.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
-
-import SCons.Defaults
-import SCons.Tool
-import SCons.Util
-import SCons.Warnings
-
-from SCons.Tool.FortranCommon import isfortran
-
-cplusplus = __import__('c++', globals(), locals(), [])
-
-issued_mixed_link_warning = False
-
-def smart_link(source, target, env, for_signature):
-    has_cplusplus = cplusplus.iscplusplus(source)
-    has_fortran = isfortran(env, source)
-    if has_cplusplus and has_fortran:
-        global issued_mixed_link_warning
-        if not issued_mixed_link_warning:
-            msg = "Using $CXX to link Fortran and C++ code together.\n\t" + \
-              "This may generate a buggy executable if the '%s'\n\t" + \
-              "compiler does not know how to deal with Fortran runtimes."
-            SCons.Warnings.warn(SCons.Warnings.FortranCxxMixWarning,
-                                msg % env.subst('$CXX'))
-            issued_mixed_link_warning = True
-        return '$CXX'
-    elif has_fortran:
-        return '$FORTRAN'
-    elif has_cplusplus:
-        return '$CXX'
-    return '$CC'
-
-def shlib_emitter(target, source, env):
-    for tgt in target:
-        tgt.attributes.shared = 1
-    return (target, source)
-
-def generate(env):
-    """Add Builders and construction variables for gnulink to an Environment."""
-    SCons.Tool.createSharedLibBuilder(env)
-    SCons.Tool.createProgBuilder(env)
-
-    env['SHLINK']      = '$LINK'
-    env['SHLINKFLAGS'] = SCons.Util.CLVar('$LINKFLAGS -shared')
-    env['SHLINKCOM']   = '$SHLINK -o $TARGET $SHLINKFLAGS $__RPATH $SOURCES $_LIBDIRFLAGS $_LIBFLAGS'
-    # don't set up the emitter, cause AppendUnique will generate a list
-    # starting with None :-(
-    env.Append(SHLIBEMITTER = [shlib_emitter])
-    env['SMARTLINK']   = smart_link
-    env['LINK']        = "$SMARTLINK"
-    env['LINKFLAGS']   = SCons.Util.CLVar('')
-    # __RPATH is only set to something ($_RPATH typically) on platforms that support it.
-    env['LINKCOM']     = '$LINK -o $TARGET $LINKFLAGS $__RPATH $SOURCES $_LIBDIRFLAGS $_LIBFLAGS'
-    env['LIBDIRPREFIX']='-L'
-    env['LIBDIRSUFFIX']=''
-    env['_LIBFLAGS']='${_stripixes(LIBLINKPREFIX, LIBS, LIBLINKSUFFIX, LIBPREFIXES, LIBSUFFIXES, __env__)}'
-    env['LIBLINKPREFIX']='-l'
-    env['LIBLINKSUFFIX']=''
-
-    if env['PLATFORM'] == 'hpux':
-        env['SHLIBSUFFIX'] = '.sl'
-    elif env['PLATFORM'] == 'aix':
-        env['SHLIBSUFFIX'] = '.a'
-
-    # For most platforms, a loadable module is the same as a shared
-    # library.  Platforms which are different can override these, but
-    # setting them the same means that LoadableModule works everywhere.
-    SCons.Tool.createLoadableModuleBuilder(env)
-    env['LDMODULE'] = '$SHLINK'
-    # don't set up the emitter, cause AppendUnique will generate a list
-    # starting with None :-(
-    env.Append(LDMODULEEMITTER='$SHLIBEMITTER')
-    env['LDMODULEPREFIX'] = '$SHLIBPREFIX' 
-    env['LDMODULESUFFIX'] = '$SHLIBSUFFIX' 
-    env['LDMODULEFLAGS'] = '$SHLINKFLAGS'
-    env['LDMODULECOM'] = '$LDMODULE -o $TARGET $LDMODULEFLAGS $__RPATH $SOURCES $_LIBDIRFLAGS $_LIBFLAGS'
-
-
-
-def exists(env):
-    # This module isn't really a Tool on its own, it's common logic for
-    # other linkers.
-    return None
-
-# Local Variables:
-# tab-width:4
-# indent-tabs-mode:nil
-# End:
-# vim: set expandtab tabstop=4 shiftwidth=4:
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Action.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Action.py
similarity index 97%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Action.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Action.py
index a648c6937614c5eeb3946c3e76fe834317b7da2d..7acde466dc5dd2ac34ef6aba28779284ffae1180 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Action.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Action.py
@@ -76,7 +76,7 @@ way for wrapping up the functions.
 
 """
 
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -97,9 +97,7 @@ way for wrapping up the functions.
 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
-__revision__ = "src/engine/SCons/Action.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
-
-import SCons.compat
+__revision__ = "src/engine/SCons/Action.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import dis
 import os
@@ -109,9 +107,9 @@ import re
 import sys
 import subprocess
 
+import SCons.Debug
 from SCons.Debug import logInstanceCreation
 import SCons.Errors
-import SCons.Executor
 import SCons.Util
 import SCons.Subst
 
@@ -336,7 +334,7 @@ def _do_create_keywords(args, kw):
                 'You must either pass a string or a callback which '
                 'accepts (target, source, env) as parameters.')
         if len(args) > 1:
-            kw['varlist'] = args[1:] + kw['varlist']
+            kw['varlist'] = tuple(SCons.Util.flatten(args[1:])) + kw['varlist']
     if kw.get('strfunction', _null) is not _null \
                       and kw.get('cmdstr', _null) is not _null:
         raise SCons.Errors.UserError(
@@ -356,21 +354,6 @@ def _do_create_action(act, kw):
     if isinstance(act, ActionBase):
         return act
 
-    if is_List(act):
-        return CommandAction(act, **kw)
-
-    if callable(act):
-        try:
-            gen = kw['generator']
-            del kw['generator']
-        except KeyError:
-            gen = 0
-        if gen:
-            action_type = CommandGeneratorAction
-        else:
-            action_type = FunctionAction
-        return action_type(act, kw)
-
     if is_String(act):
         var=SCons.Util.get_environment_var(act)
         if var:
@@ -387,6 +370,22 @@ def _do_create_action(act, kw):
         # The list of string commands may include a LazyAction, so we
         # reprocess them via _do_create_list_action.
         return _do_create_list_action(commands, kw)
+    
+    if is_List(act):
+        return CommandAction(act, **kw)
+
+    if callable(act):
+        try:
+            gen = kw['generator']
+            del kw['generator']
+        except KeyError:
+            gen = 0
+        if gen:
+            action_type = CommandGeneratorAction
+        else:
+            action_type = FunctionAction
+        return action_type(act, kw)
+
     # Catch a common error case with a nice message:
     if isinstance(act, int) or isinstance(act, float):
         raise TypeError("Don't know how to create an Action from a number (%s)"%act)
@@ -439,7 +438,8 @@ class ActionBase(object):
         vl = self.get_varlist(target, source, env)
         if is_String(vl): vl = (vl,)
         for v in vl:
-            result.append(env.subst('${'+v+'}'))
+            # do the subst this way to ignore $(...$) parts:
+            result.append(env.subst_target_source('${'+v+'}', SCons.Subst.SUBST_SIG, target, source))
         return ''.join(result)
 
     def __add__(self, other):
@@ -540,7 +540,7 @@ class _ActionAction(ActionBase):
         if chdir:
             save_cwd = os.getcwd()
             try:
-                chdir = str(chdir.abspath)
+                chdir = str(chdir.get_abspath())
             except AttributeError:
                 if not is_String(chdir):
                     if executor:
@@ -677,12 +677,13 @@ def _subproc(scons_env, cmd, error = 'ignore', **kw):
         # return a dummy Popen instance that only returns error
         class dummyPopen(object):
             def __init__(self, e): self.exception = e
-            def communicate(self): return ('','')
+            def communicate(self,input=None): return ('','')
             def wait(self): return -self.exception.errno
             stdin = None
             class f(object):
                 def read(self): return ''
                 def readline(self): return ''
+                def __iter__(self): return iter(())
             stdout = stderr = f()
         return dummyPopen(e)
 
@@ -698,7 +699,7 @@ class CommandAction(_ActionAction):
         # factory above does).  cmd will be passed to
         # Environment.subst_list() for substituting environment
         # variables.
-        if __debug__: logInstanceCreation(self, 'Action.CommandAction')
+        if SCons.Debug.track_instances: logInstanceCreation(self, 'Action.CommandAction')
 
         _ActionAction.__init__(self, **kw)
         if is_List(cmd):
@@ -855,7 +856,7 @@ class CommandAction(_ActionAction):
 class CommandGeneratorAction(ActionBase):
     """Class for command-generator actions."""
     def __init__(self, generator, kw):
-        if __debug__: logInstanceCreation(self, 'Action.CommandGeneratorAction')
+        if SCons.Debug.track_instances: logInstanceCreation(self, 'Action.CommandGeneratorAction')
         self.generator = generator
         self.gen_kw = kw
         self.varlist = kw.get('varlist', ())
@@ -944,7 +945,7 @@ class CommandGeneratorAction(ActionBase):
 class LazyAction(CommandGeneratorAction, CommandAction):
 
     def __init__(self, var, kw):
-        if __debug__: logInstanceCreation(self, 'Action.LazyAction')
+        if SCons.Debug.track_instances: logInstanceCreation(self, 'Action.LazyAction')
         #FUTURE CommandAction.__init__(self, '${'+var+'}', **kw)
         CommandAction.__init__(self, '${'+var+'}', **kw)
         self.var = SCons.Util.to_String(var)
@@ -986,7 +987,7 @@ class FunctionAction(_ActionAction):
     """Class for Python function actions."""
 
     def __init__(self, execfunction, kw):
-        if __debug__: logInstanceCreation(self, 'Action.FunctionAction')
+        if SCons.Debug.track_instances: logInstanceCreation(self, 'Action.FunctionAction')
 
         self.execfunction = execfunction
         try:
@@ -1108,7 +1109,7 @@ class FunctionAction(_ActionAction):
 class ListAction(ActionBase):
     """Class for lists of other actions."""
     def __init__(self, actionlist):
-        if __debug__: logInstanceCreation(self, 'Action.ListAction')
+        if SCons.Debug.track_instances: logInstanceCreation(self, 'Action.ListAction')
         def list_of_actions(x):
             if isinstance(x, ActionBase):
                 return x
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Builder.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Builder.py
similarity index 97%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Builder.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Builder.py
index 5a8aff1aacff8610facd1016718ce8066b18de0b..4c68d5c3a2ed8f207ddd17be0c13b87e0eac0092 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Builder.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Builder.py
@@ -76,7 +76,7 @@ There are the following methods for internal use within this module:
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -97,17 +97,16 @@ There are the following methods for internal use within this module:
 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
-__revision__ = "src/engine/SCons/Builder.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Builder.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import collections
 
 import SCons.Action
+import SCons.Debug
 from SCons.Debug import logInstanceCreation
 from SCons.Errors import InternalError, UserError
 import SCons.Executor
 import SCons.Memoize
-import SCons.Node
-import SCons.Node.FS
 import SCons.Util
 import SCons.Warnings
 
@@ -225,7 +224,7 @@ class OverrideWarner(collections.UserDict):
     """
     def __init__(self, dict):
         collections.UserDict.__init__(self, dict)
-        if __debug__: logInstanceCreation(self, 'Builder.OverrideWarner')
+        if SCons.Debug.track_instances: logInstanceCreation(self, 'Builder.OverrideWarner')
         self.already_warned = None
     def warn(self):
         if self.already_warned:
@@ -353,11 +352,6 @@ class BuilderBase(object):
     nodes (files) from input nodes (files).
     """
 
-    if SCons.Memoize.use_memoizer:
-        __metaclass__ = SCons.Memoize.Memoized_Metaclass
-
-    memoizer_counters = []
-
     def __init__(self,  action = None,
                         prefix = '',
                         suffix = '',
@@ -376,7 +370,7 @@ class BuilderBase(object):
                         src_builder = None,
                         ensure_suffix = False,
                         **overrides):
-        if __debug__: logInstanceCreation(self, 'Builder.BuilderBase')
+        if SCons.Debug.track_instances: logInstanceCreation(self, 'Builder.BuilderBase')
         self._memo = {}
         self.action = action
         self.multi = multi
@@ -759,8 +753,7 @@ class BuilderBase(object):
     def _get_src_builders_key(self, env):
         return id(env)
 
-    memoizer_counters.append(SCons.Memoize.CountDict('get_src_builders', _get_src_builders_key))
-
+    @SCons.Memoize.CountDictCall(_get_src_builders_key)
     def get_src_builders(self, env):
         """
         Returns the list of source Builders for this Builder.
@@ -796,8 +789,7 @@ class BuilderBase(object):
     def _subst_src_suffixes_key(self, env):
         return id(env)
 
-    memoizer_counters.append(SCons.Memoize.CountDict('subst_src_suffixes', _subst_src_suffixes_key))
-
+    @SCons.Memoize.CountDictCall(_subst_src_suffixes_key)
     def subst_src_suffixes(self, env):
         """
         The suffix list may contain construction variable expansions,
@@ -847,7 +839,7 @@ class CompositeBuilder(SCons.Util.Proxy):
     """
 
     def __init__(self, builder, cmdgen):
-        if __debug__: logInstanceCreation(self, 'Builder.CompositeBuilder')
+        if SCons.Debug.track_instances: logInstanceCreation(self, 'Builder.CompositeBuilder')
         SCons.Util.Proxy.__init__(self, builder)
 
         # cmdgen should always be an instance of DictCmdGenerator.
@@ -861,7 +853,7 @@ class CompositeBuilder(SCons.Util.Proxy):
         self.set_src_suffix(self.cmdgen.src_suffixes())
 
 def is_a_Builder(obj):
-    """"Returns True iff the specified obj is one of our Builder classes.
+    """"Returns True if the specified obj is one of our Builder classes.
 
     The test is complicated a bit by the fact that CompositeBuilder
     is a proxy, not a subclass of BuilderBase.
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/CacheDir.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/CacheDir.py
similarity index 90%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/CacheDir.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/CacheDir.py
index ec7e9eebfc7a40977948674421faa6c308847d1f..9e3ec6b229e7143a9d4c004cd8ad52b65ddf271d 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/CacheDir.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/CacheDir.py
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -21,7 +21,7 @@
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/CacheDir.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/CacheDir.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 __doc__ = """
 CacheDir support
@@ -37,6 +37,7 @@ cache_enabled = True
 cache_debug = False
 cache_force = False
 cache_show = False
+cache_readonly = False
 
 def CacheRetrieveFunc(target, source, env):
     t = target[0]
@@ -49,11 +50,11 @@ def CacheRetrieveFunc(target, source, env):
     cd.CacheDebug('CacheRetrieve(%s):  retrieving from %s\n', t, cachefile)
     if SCons.Action.execute_actions:
         if fs.islink(cachefile):
-            fs.symlink(fs.readlink(cachefile), t.path)
+            fs.symlink(fs.readlink(cachefile), t.get_internal_path())
         else:
-            env.copy_from_cache(cachefile, t.path)
+            env.copy_from_cache(cachefile, t.get_internal_path())
         st = fs.stat(cachefile)
-        fs.chmod(t.path, stat.S_IMODE(st[stat.ST_MODE]) | stat.S_IWRITE)
+        fs.chmod(t.get_internal_path(), stat.S_IMODE(st[stat.ST_MODE]) | stat.S_IWRITE)
     return 0
 
 def CacheRetrieveString(target, source, env):
@@ -62,7 +63,7 @@ def CacheRetrieveString(target, source, env):
     cd = env.get_CacheDir()
     cachedir, cachefile = cd.cachepath(t)
     if t.fs.exists(cachefile):
-        return "Retrieved `%s' from cache" % t.path
+        return "Retrieved `%s' from cache" % t.get_internal_path()
     return None
 
 CacheRetrieve = SCons.Action.Action(CacheRetrieveFunc, CacheRetrieveString)
@@ -70,6 +71,8 @@ CacheRetrieve = SCons.Action.Action(CacheRetrieveFunc, CacheRetrieveString)
 CacheRetrieveSilent = SCons.Action.Action(CacheRetrieveFunc, None)
 
 def CachePushFunc(target, source, env):
+    if cache_readonly: return
+
     t = target[0]
     if t.nocache:
         return
@@ -103,12 +106,12 @@ def CachePushFunc(target, source, env):
                 raise SCons.Errors.EnvironmentError(msg)
 
     try:
-        if fs.islink(t.path):
-            fs.symlink(fs.readlink(t.path), tempfile)
+        if fs.islink(t.get_internal_path()):
+            fs.symlink(fs.readlink(t.get_internal_path()), tempfile)
         else:
-            fs.copy2(t.path, tempfile)
+            fs.copy2(t.get_internal_path(), tempfile)
         fs.rename(tempfile, cachefile)
-        st = fs.stat(t.path)
+        st = fs.stat(t.get_internal_path())
         fs.chmod(cachefile, stat.S_IMODE(st[stat.ST_MODE]) | stat.S_IWRITE)
     except EnvironmentError:
         # It's possible someone else tried writing the file at the
@@ -150,6 +153,9 @@ class CacheDir(object):
     def is_enabled(self):
         return (cache_enabled and not self.path is None)
 
+    def is_readonly(self):
+        return cache_readonly
+
     def cachepath(self, node):
         """
         """
@@ -201,7 +207,7 @@ class CacheDir(object):
         return False
 
     def push(self, node):
-        if not self.is_enabled():
+        if self.is_readonly() or not self.is_enabled():
             return
         return CachePush(node, [], node.get_build_env())
 
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Conftest.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Conftest.py
similarity index 99%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Conftest.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Conftest.py
index d4662780c609ed63596dff33d7e1aedefb20df28..e9702ff000dd72fba79b651fb168e5687080e7cc 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Conftest.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Conftest.py
@@ -156,7 +156,7 @@ def CheckCC(context):
     too, so that it can test against non working flags.
 
     """
-    context.Display("Checking whether the C compiler works")
+    context.Display("Checking whether the C compiler works... ")
     text = """
 int main()
 {
@@ -176,7 +176,7 @@ def CheckSHCC(context):
     too, so that it can test against non working flags.
 
     """
-    context.Display("Checking whether the (shared) C compiler works")
+    context.Display("Checking whether the (shared) C compiler works... ")
     text = """
 int foo()
 {
@@ -196,7 +196,7 @@ def CheckCXX(context):
     too, so that it can test against non working flags.
 
     """
-    context.Display("Checking whether the C++ compiler works")
+    context.Display("Checking whether the C++ compiler works... ")
     text = """
 int main()
 {
@@ -216,7 +216,7 @@ def CheckSHCXX(context):
     too, so that it can test against non working flags.
 
     """
-    context.Display("Checking whether the (shared) C++ compiler works")
+    context.Display("Checking whether the (shared) C++ compiler works... ")
     text = """
 int main()
 {
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Debug.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Debug.py
similarity index 87%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Debug.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Debug.py
index 5f1b87c13290625258841093a99538202c521cda..0aa077d1ab1cbd20787cec5a881f66fc0c1070ca 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Debug.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Debug.py
@@ -6,7 +6,7 @@ needed by most users.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -28,13 +28,18 @@ needed by most users.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Debug.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Debug.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import os
 import sys
 import time
 import weakref
+import inspect
 
+# Global variable that gets set to 'True' by the Main script,
+# when the creation of class instances should get tracked.
+track_instances = False
+# List of currently tracked classes
 tracked_classes = {}
 
 def logInstanceCreation(instance, name=None):
@@ -42,7 +47,12 @@ def logInstanceCreation(instance, name=None):
         name = instance.__class__.__name__
     if name not in tracked_classes:
         tracked_classes[name] = []
-    tracked_classes[name].append(weakref.ref(instance))
+    if hasattr(instance, '__dict__'):
+        tracked_classes[name].append(weakref.ref(instance))
+    else:
+        # weakref doesn't seem to work when the instance
+        # contains only slots...
+        tracked_classes[name].append(instance)
 
 def string_to_classes(s):
     if s == '*':
@@ -62,7 +72,10 @@ def listLoggedInstances(classes, file=sys.stdout):
     for classname in string_to_classes(classes):
         file.write('\n%s:\n' % classname)
         for ref in tracked_classes[classname]:
-            obj = ref()
+            if inspect.isclass(ref):
+                obj = ref()
+            else:
+                obj = ref
             if obj is not None:
                 file.write('    %s\n' % repr(obj))
 
@@ -109,14 +122,15 @@ else:
             return res[4]
 
 # returns caller's stack
-def caller_stack(*backlist):
+def caller_stack():
     import traceback
-    if not backlist:
-        backlist = [0]
+    tb = traceback.extract_stack()
+    # strip itself and the caller from the output
+    tb = tb[:-2]
     result = []
-    for back in backlist:
-        tb = traceback.extract_stack(limit=3+back)
-        key = tb[0][:3]
+    for back in tb:
+        # (filename, line number, function name, text)
+        key = back[:3]
         result.append('%s:%d(%s)' % func_shorten(key))
     return result
 
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Defaults.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Defaults.py
similarity index 94%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Defaults.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Defaults.py
index 96760cedc7e543c65a6c8e176b0caebad7a52c90..b4cbb9a094401acbfab0b8b7b399e69b48c38369 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Defaults.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Defaults.py
@@ -10,7 +10,7 @@ from distutils.msvccompiler.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -33,7 +33,7 @@ from distutils.msvccompiler.
 #
 from __future__ import division
 
-__revision__ = "src/engine/SCons/Defaults.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Defaults.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 
 import os
@@ -144,6 +144,9 @@ ShCAction = SCons.Action.Action("$SHCCCOM", "$SHCCCOMSTR")
 CXXAction = SCons.Action.Action("$CXXCOM", "$CXXCOMSTR")
 ShCXXAction = SCons.Action.Action("$SHCXXCOM", "$SHCXXCOMSTR")
 
+DAction = SCons.Action.Action("$DCOM", "$DCOMSTR")
+ShDAction = SCons.Action.Action("$SHDCOM", "$SHDCOMSTR")
+
 ASAction = SCons.Action.Action("$ASCOM", "$ASCOMSTR")
 ASPPAction = SCons.Action.Action("$ASPPCOM", "$ASPPCOMSTR")
 
@@ -178,20 +181,36 @@ def chmod_strfunc(dest, mode):
 
 Chmod = ActionFactory(chmod_func, chmod_strfunc)
 
-def copy_func(dest, src):
+def copy_func(dest, src, symlinks=True):
+    """
+    If symlinks (is true), then a symbolic link will be
+    shallow copied and recreated as a symbolic link; otherwise, copying
+    a symbolic link will be equivalent to copying the symbolic link's
+    final target regardless of symbolic link depth.
+    """
+
+    dest = str(dest)
+    src = str(src)
+
     SCons.Node.FS.invalidate_node_memos(dest)
     if SCons.Util.is_List(src) and os.path.isdir(dest):
         for file in src:
             shutil.copy2(file, dest)
         return 0
+    elif os.path.islink(src):
+        if symlinks:
+            return os.symlink(os.readlink(src), dest)
+        else:
+            return copy_func(dest, os.path.realpath(src))
     elif os.path.isfile(src):
         return shutil.copy2(src, dest)
     else:
-        return shutil.copytree(src, dest, 1)
+        return shutil.copytree(src, dest, symlinks)
 
-Copy = ActionFactory(copy_func,
-                     lambda dest, src: 'Copy("%s", "%s")' % (dest, src),
-                     convert=str)
+Copy = ActionFactory(
+    copy_func,
+    lambda dest, src, symlinks=True: 'Copy("%s", "%s")' % (dest, src)
+)
 
 def delete_func(dest, must_exist=0):
     SCons.Node.FS.invalidate_node_memos(dest)
@@ -321,7 +340,7 @@ def _stripixes(prefix, itms, suffix, stripprefixes, stripsuffixes, env, c=None):
     where it finds them.  This is used by tools (like the GNU linker)
     that need to turn something like 'libfoo.a' into '-lfoo'.
     """
-    
+
     if not itms:
         return itms
 
@@ -335,7 +354,7 @@ def _stripixes(prefix, itms, suffix, stripprefixes, stripsuffixes, env, c=None):
             c = env_c
         else:
             c = _concat_ixes
-    
+
     stripprefixes = list(map(env.subst, SCons.Util.flatten(stripprefixes)))
     stripsuffixes = list(map(env.subst, SCons.Util.flatten(stripsuffixes)))
 
@@ -413,7 +432,7 @@ def _defines(prefix, defs, suffix, env, c=_concat_ixes):
     """
 
     return c(prefix, env.subst_path(processDefines(defs)), suffix, env)
-    
+
 class NullCmdGenerator(object):
     """This is a callable class that can be used in place of other
     command generators if you don't want them to do anything.
@@ -449,7 +468,7 @@ class Variable_Method_Caller(object):
         self.method = method
     def __call__(self, *args, **kw):
         try: 1//0
-        except ZeroDivisionError: 
+        except ZeroDivisionError:
             # Don't start iterating with the current stack-frame to
             # prevent creating reference cycles (f_back is safe).
             frame = sys.exc_info()[2].tb_frame.f_back
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Environment.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Environment.py
similarity index 96%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Environment.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Environment.py
index addf782a338a58560079552bd49ec5e653014a38..865c821640e90d7592db033a97d21f779660973b 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Environment.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Environment.py
@@ -10,7 +10,7 @@ Environment
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -31,7 +31,7 @@ Environment
 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
-__revision__ = "src/engine/SCons/Environment.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Environment.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 
 import copy
@@ -43,6 +43,7 @@ from collections import UserDict
 
 import SCons.Action
 import SCons.Builder
+import SCons.Debug
 from SCons.Debug import logInstanceCreation
 import SCons.Defaults
 import SCons.Errors
@@ -364,13 +365,10 @@ class SubstitutionEnvironment(object):
     class actually becomes useful.)
     """
 
-    if SCons.Memoize.use_memoizer:
-        __metaclass__ = SCons.Memoize.Memoized_Metaclass
-
     def __init__(self, **kw):
         """Initialization of an underlying SubstitutionEnvironment class.
         """
-        if __debug__: logInstanceCreation(self, 'Environment.SubstitutionEnvironment')
+        if SCons.Debug.track_instances: logInstanceCreation(self, 'Environment.SubstitutionEnvironment')
         self.fs = SCons.Node.FS.get_default_fs()
         self.ans = SCons.Node.Alias.default_ans
         self.lookup_list = SCons.Node.arg2nodes_lookups
@@ -704,7 +702,7 @@ class SubstitutionEnvironment(object):
             #  -symbolic       (linker global binding)
             #  -R dir          (deprecated linker rpath)
             # IBM compilers may also accept -qframeworkdir=foo
-    
+
             params = shlex.split(arg)
             append_next_arg_to = None   # for multi-word args
             for arg in params:
@@ -718,6 +716,9 @@ class SubstitutionEnvironment(object):
                        t = ('-isysroot', arg)
                        dict['CCFLAGS'].append(t)
                        dict['LINKFLAGS'].append(t)
+                   elif append_next_arg_to == '-isystem':
+                       t = ('-isystem', arg)
+                       dict['CCFLAGS'].append(t)
                    elif append_next_arg_to == '-arch':
                        t = ('-arch', arg)
                        dict['CCFLAGS'].append(t)
@@ -790,11 +791,11 @@ class SubstitutionEnvironment(object):
                 elif arg[0] == '+':
                     dict['CCFLAGS'].append(arg)
                     dict['LINKFLAGS'].append(arg)
-                elif arg in ['-include', '-isysroot', '-arch']:
+                elif arg in ['-include', '-isysroot', '-isystem', '-arch']:
                     append_next_arg_to = arg
                 else:
                     dict['CCFLAGS'].append(arg)
-    
+
         for arg in flags:
             do_parse(arg)
         return dict
@@ -858,7 +859,7 @@ class SubstitutionEnvironment(object):
 
 #     def MergeShellPaths(self, args, prepend=1):
 #         """
-#         Merge the dict in args into the shell environment in env['ENV'].  
+#         Merge the dict in args into the shell environment in env['ENV'].
 #         Shell path elements are appended or prepended according to prepend.
 
 #         Uses Pre/AppendENVPath, so it always appends or prepends uniquely.
@@ -898,8 +899,6 @@ class Base(SubstitutionEnvironment):
     Environment.
     """
 
-    memoizer_counters = []
-
     #######################################################################
     # This is THE class for interacting with the SCons build engine,
     # and it contains a lot of stuff, so we're going to try to keep this
@@ -931,7 +930,7 @@ class Base(SubstitutionEnvironment):
         initialize things in a very specific order that doesn't work
         with the much simpler base class initialization.
         """
-        if __debug__: logInstanceCreation(self, 'Environment.Base')
+        if SCons.Debug.track_instances: logInstanceCreation(self, 'Environment.Base')
         self._memo = {}
         self.fs = SCons.Node.FS.get_default_fs()
         self.ans = SCons.Node.Alias.default_ans
@@ -961,14 +960,14 @@ class Base(SubstitutionEnvironment):
             platform = SCons.Platform.Platform(platform)
         self._dict['PLATFORM'] = str(platform)
         platform(self)
-        
+
         self._dict['HOST_OS']      = self._dict.get('HOST_OS',None)
         self._dict['HOST_ARCH']    = self._dict.get('HOST_ARCH',None)
-        
+
         # Now set defaults for TARGET_{OS|ARCH}
-        self._dict['TARGET_OS']      = self._dict.get('HOST_OS',None)
-        self._dict['TARGET_ARCH']    = self._dict.get('HOST_ARCH',None)
-        
+        self._dict['TARGET_OS']      = self._dict.get('TARGET_OS',None)
+        self._dict['TARGET_ARCH']    = self._dict.get('TARGET_ARCH',None)
+
 
         # Apply the passed-in and customizable variables to the
         # environment before calling the tools, because they may use
@@ -1067,8 +1066,7 @@ class Base(SubstitutionEnvironment):
             factory = getattr(self.fs, name)
         return factory
 
-    memoizer_counters.append(SCons.Memoize.CountValue('_gsm'))
-
+    @SCons.Memoize.CountMethodCall
     def _gsm(self):
         try:
             return self._memo['_gsm']
@@ -1157,7 +1155,7 @@ class Base(SubstitutionEnvironment):
             # "continue" statements whenever we finish processing an item,
             # but Python 1.5.2 apparently doesn't let you use "continue"
             # within try:-except: blocks, so we have to nest our code.
-            try:                
+            try:
                 if key == 'CPPDEFINES' and SCons.Util.is_String(self._dict[key]):
                     self._dict[key] = [self._dict[key]]
                 orig = self._dict[key]
@@ -1205,10 +1203,16 @@ class Base(SubstitutionEnvironment):
                     # based on what we think the value looks like.
                     if SCons.Util.is_List(val):
                         if key == 'CPPDEFINES':
-                            orig = orig.items()
+                            tmp = []
+                            for (k, v) in orig.iteritems():
+                                if v is not None:
+                                    tmp.append((k, v))
+                                else:
+                                    tmp.append((k,))
+                            orig = tmp
                             orig += val
                             self._dict[key] = orig
-                        else:    
+                        else:
                             for v in val:
                                 orig[v] = None
                     else:
@@ -1231,7 +1235,7 @@ class Base(SubstitutionEnvironment):
             path = str(self.fs.Dir(path))
         return path
 
-    def AppendENVPath(self, name, newpath, envname = 'ENV', 
+    def AppendENVPath(self, name, newpath, envname = 'ENV',
                       sep = os.pathsep, delete_existing=1):
         """Append path elements to the path 'name' in the 'ENV'
         dictionary for this environment.  Will only add any particular
@@ -1285,11 +1289,18 @@ class Base(SubstitutionEnvironment):
                         else:
                             tmp.append((i,))
                     val = tmp
+                    # Construct a list of (key, value) tuples.
                     if SCons.Util.is_Dict(dk):
-                        dk = dk.items()
+                        tmp = []
+                        for (k, v) in dk.iteritems():
+                            if v is not None:
+                                tmp.append((k, v))
+                            else:
+                                tmp.append((k,))
+                        dk = tmp
                     elif SCons.Util.is_String(dk):
                         dk = [(dk,)]
-                    else:                    
+                    else:
                         tmp = []
                         for i in dk:
                             if SCons.Util.is_List(i):
@@ -1326,15 +1337,22 @@ class Base(SubstitutionEnvironment):
                             else:
                                 tmp.append((i,))
                         dk = tmp
+                        # Construct a list of (key, value) tuples.
                         if SCons.Util.is_Dict(val):
-                            val = val.items()
+                            tmp = []
+                            for (k, v) in val.iteritems():
+                                if v is not None:
+                                    tmp.append((k, v))
+                                else:
+                                    tmp.append((k,))
+                            val = tmp
                         elif SCons.Util.is_String(val):
                             val = [(val,)]
                         if delete_existing:
                             dk = filter(lambda x, val=val: x not in val, dk)
                             self._dict[key] = dk + val
                         else:
-                            dk = [x for x in dk if x not in val]                
+                            dk = [x for x in dk if x not in val]
                             self._dict[key] = dk + val
                     else:
                         # By elimination, val is not a list.  Since dk is a
@@ -1350,7 +1368,13 @@ class Base(SubstitutionEnvironment):
                         if SCons.Util.is_String(dk):
                             dk = [dk]
                         elif SCons.Util.is_Dict(dk):
-                            dk = dk.items()
+                            tmp = []
+                            for (k, v) in dk.iteritems():
+                                if v is not None:
+                                    tmp.append((k, v))
+                                else:
+                                    tmp.append((k,))
+                            dk = tmp
                         if SCons.Util.is_String(val):
                             if val in dk:
                                 val = []
@@ -1377,11 +1401,9 @@ class Base(SubstitutionEnvironment):
         (like a function).  There are no references to any mutable
         objects in the original Environment.
         """
-        try:
-            builders = self._dict['BUILDERS']
-        except KeyError:
-            pass
-            
+
+        builders = self._dict.get('BUILDERS', {})
+
         clone = copy.copy(self)
         # BUILDERS is not safe to do a simple copy
         clone._dict = semi_deepcopy_dict(self._dict, ['BUILDERS'])
@@ -1409,12 +1431,12 @@ class Base(SubstitutionEnvironment):
         apply_tools(clone, tools, toolpath)
 
         # apply them again in case the tools overwrote them
-        clone.Replace(**new)        
+        clone.Replace(**new)
 
         # Finally, apply any flags to be merged in
         if parse_flags: clone.MergeFlags(parse_flags)
 
-        if __debug__: logInstanceCreation(self, 'Environment.EnvironmentClone')
+        if SCons.Debug.track_instances: logInstanceCreation(self, 'Environment.EnvironmentClone')
         return clone
 
     def Copy(self, *args, **kw):
@@ -1500,8 +1522,8 @@ class Base(SubstitutionEnvironment):
 
     def Dump(self, key = None):
         """
-        Using the standard Python pretty printer, dump the contents of the
-        scons build environment to stdout.
+        Using the standard Python pretty printer, return the contents of the
+        scons build environment as a string.
 
         If the key passed in is anything other than None, then that will
         be used as an index into the build environment dictionary and
@@ -1774,7 +1796,7 @@ class Base(SubstitutionEnvironment):
         self.Replace(**kw)
 
     def _find_toolpath_dir(self, tp):
-        return self.fs.Dir(self.subst(tp)).srcnode().abspath
+        return self.fs.Dir(self.subst(tp)).srcnode().get_abspath()
 
     def Tool(self, tool, toolpath=None, **kw):
         if SCons.Util.is_String(tool):
@@ -1802,8 +1824,8 @@ class Base(SubstitutionEnvironment):
                 pass
         elif SCons.Util.is_String(pathext):
             pathext = self.subst(pathext)
-        prog = self.subst(prog)
-        path = SCons.Util.WhereIs(prog, path, pathext, reject)
+        prog = SCons.Util.CLVar(self.subst(prog)) # support "program --with-args"
+        path = SCons.Util.WhereIs(prog[0], path, pathext, reject)
         if path: return path
         return None
 
@@ -2052,8 +2074,8 @@ class Base(SubstitutionEnvironment):
         else:
             return result[0]
 
-    def Glob(self, pattern, ondisk=True, source=False, strings=False):
-        return self.fs.Glob(self.subst(pattern), ondisk, source, strings)
+    def Glob(self, pattern, ondisk=True, source=False, strings=False, exclude=None):
+        return self.fs.Glob(self.subst(pattern), ondisk, source, strings, exclude)
 
     def Ignore(self, target, dependency):
         """Ignore a dependency."""
@@ -2086,6 +2108,14 @@ class Base(SubstitutionEnvironment):
             t.set_precious()
         return tlist
 
+    def Pseudo(self, *targets):
+        tlist = []
+        for t in targets:
+            tlist.extend(self.arg2nodes(t, self.fs.Entry))
+        for t in tlist:
+            t.set_pseudo()
+        return tlist
+
     def Repository(self, *dirs, **kw):
         dirs = self.arg2nodes(list(dirs), self.fs.Dir)
         self.fs.Repository(*dirs, **kw)
@@ -2140,7 +2170,7 @@ class Base(SubstitutionEnvironment):
     def SourceCode(self, entry, builder):
         """Arrange for a source code builder for (part of) a tree."""
         msg = """SourceCode() has been deprecated and there is no replacement.
-\tIf you need this function, please contact dev@scons.tigris.org."""
+\tIf you need this function, please contact scons-dev@scons.org"""
         SCons.Warnings.warn(SCons.Warnings.DeprecatedSourceCodeWarning, msg)
         entries = self.arg2nodes(entry, self.fs.Entry)
         for entry in entries:
@@ -2247,6 +2277,7 @@ class Base(SubstitutionEnvironment):
             install._UNIQUE_INSTALLED_FILES = SCons.Util.uniquer_hashables(install._INSTALLED_FILES)
         return install._UNIQUE_INSTALLED_FILES
 
+
 class OverrideEnvironment(Base):
     """A proxy that overrides variables in a wrapped construction
     environment by returning values from an overrides dictionary in
@@ -2269,7 +2300,7 @@ class OverrideEnvironment(Base):
     """
 
     def __init__(self, subject, overrides={}):
-        if __debug__: logInstanceCreation(self, 'Environment.OverrideEnvironment')
+        if SCons.Debug.track_instances: logInstanceCreation(self, 'Environment.OverrideEnvironment')
         self.__dict__['__subject'] = subject
         self.__dict__['overrides'] = overrides
 
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Errors.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Errors.py
similarity index 97%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Errors.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Errors.py
index 8541c68ab4c967118772e24231142015d364dd8b..998a70d9f9e9bcd869c69d30a3056a67e0d85c08 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Errors.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Errors.py
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -28,7 +28,7 @@ and user errors in SCons.
 
 """
 
-__revision__ = "src/engine/SCons/Errors.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Errors.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import SCons.Util
 
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Executor.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Executor.py
similarity index 84%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Executor.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Executor.py
index 9ea6e631d47425ecc5d7684b7f95222065ace4ee..3211fd11d2c1e2fe37baabad21f447106446b251 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Executor.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Executor.py
@@ -6,7 +6,7 @@ Nodes.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -27,10 +27,11 @@ Nodes.
 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
-__revision__ = "src/engine/SCons/Executor.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Executor.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import collections
 
+import SCons.Debug
 from SCons.Debug import logInstanceCreation
 import SCons.Errors
 import SCons.Memoize
@@ -39,6 +40,10 @@ import SCons.Memoize
 class Batch(object):
     """Remembers exact association between targets
     and sources of executor."""
+    
+    __slots__ = ('targets',
+                 'sources')
+    
     def __init__(self, targets=[], sources=[]):
         self.targets = targets
         self.sources = sources
@@ -108,6 +113,48 @@ def rfile(node):
         return rfile()
 
 
+def execute_nothing(obj, target, kw):
+    return 0
+
+def execute_action_list(obj, target, kw):
+    """Actually execute the action list."""
+    env = obj.get_build_env()
+    kw = obj.get_kw(kw)
+    status = 0
+    for act in obj.get_action_list():
+        #args = (self.get_all_targets(), self.get_all_sources(), env)
+        args = ([], [], env)
+        status = act(*args, **kw)
+        if isinstance(status, SCons.Errors.BuildError):
+            status.executor = obj
+            raise status
+        elif status:
+            msg = "Error %s" % status
+            raise SCons.Errors.BuildError(
+                errstr=msg, 
+                node=obj.batches[0].targets,
+                executor=obj, 
+                action=act)
+    return status
+
+_do_execute_map = {0 : execute_nothing,
+                   1 : execute_action_list}
+
+
+def execute_actions_str(obj):
+    env = obj.get_build_env()
+    return "\n".join([action.genstring(obj.get_all_targets(),
+                                       obj.get_all_sources(),
+                                       env)
+                      for action in obj.get_action_list()])
+
+def execute_null_str(obj):
+    return ''
+
+_execute_str_map = {0 : execute_null_str,
+                    1 : execute_actions_str}
+
+
 class Executor(object):
     """A class for controlling instances of executing an action.
 
@@ -116,14 +163,25 @@ class Executor(object):
     and sources for later processing as needed.
     """
 
-    if SCons.Memoize.use_memoizer:
-        __metaclass__ = SCons.Memoize.Memoized_Metaclass
-
-    memoizer_counters = []
+    __slots__ = ('pre_actions',
+                 'post_actions',
+                 'env',
+                 'overridelist',
+                 'batches',
+                 'builder_kw',
+                 '_memo',
+                 'lvars',
+                 '_changed_sources_list',
+                 '_changed_targets_list',
+                 '_unchanged_sources_list',
+                 '_unchanged_targets_list',
+                 'action_list',
+                 '_do_execute',
+                 '_execute_str')
 
     def __init__(self, action, env=None, overridelist=[{}],
                  targets=[], sources=[], builder_kw={}):
-        if __debug__: logInstanceCreation(self, 'Executor.Executor')
+        if SCons.Debug.track_instances: logInstanceCreation(self, 'Executor.Executor')
         self.set_action_list(action)
         self.pre_actions = []
         self.post_actions = []
@@ -134,6 +192,8 @@ class Executor(object):
         else:
             self.batches = []
         self.builder_kw = builder_kw
+        self._do_execute = 1
+        self._execute_str = 1
         self._memo = {}
 
     def get_lvars(self):
@@ -229,6 +289,8 @@ class Executor(object):
         self.action_list = action
 
     def get_action_list(self):
+        if self.action_list is None:
+            return []
         return self.pre_actions + self.action_list + self.post_actions
 
     def get_all_targets(self):
@@ -267,7 +329,8 @@ class Executor(object):
         """
         result = SCons.Util.UniqueList([])
         for target in self.get_all_targets():
-            result.extend(target.prerequisites)
+            if target.prerequisites is not None:
+                result.extend(target.prerequisites)
         return result
 
     def get_action_side_effects(self):
@@ -280,8 +343,7 @@ class Executor(object):
             result.extend(target.side_effects)
         return result
 
-    memoizer_counters.append(SCons.Memoize.CountValue('get_build_env'))
-
+    @SCons.Memoize.CountMethodCall
     def get_build_env(self):
         """Fetch or create the appropriate build Environment
         for this Executor.
@@ -326,36 +388,12 @@ class Executor(object):
         result['executor'] = self
         return result
 
-    def do_nothing(self, target, kw):
-        return 0
-
-    def do_execute(self, target, kw):
-        """Actually execute the action list."""
-        env = self.get_build_env()
-        kw = self.get_kw(kw)
-        status = 0
-        for act in self.get_action_list():
-            #args = (self.get_all_targets(), self.get_all_sources(), env)
-            args = ([], [], env)
-            status = act(*args, **kw)
-            if isinstance(status, SCons.Errors.BuildError):
-                status.executor = self
-                raise status
-            elif status:
-                msg = "Error %s" % status
-                raise SCons.Errors.BuildError(
-                    errstr=msg, 
-                    node=self.batches[0].targets,
-                    executor=self, 
-                    action=act)
-        return status
-
     # use extra indirection because with new-style objects (Python 2.2
     # and above) we can't override special methods, and nullify() needs
     # to be able to do this.
 
     def __call__(self, target, **kw):
-        return self.do_execute(target, kw)
+        return _do_execute_map[self._do_execute](self, target, kw)
 
     def cleanup(self):
         self._memo = {}
@@ -399,24 +437,15 @@ class Executor(object):
 
     # another extra indirection for new-style objects and nullify...
 
-    def my_str(self):
-        env = self.get_build_env()
-        return "\n".join([action.genstring(self.get_all_targets(),
-                                           self.get_all_sources(),
-                                           env)
-                          for action in self.get_action_list()])
-
-
     def __str__(self):
-        return self.my_str()
+        return _execute_str_map[self._execute_str](self)
 
     def nullify(self):
         self.cleanup()
-        self.do_execute = self.do_nothing
-        self.my_str     = lambda: ''
-
-    memoizer_counters.append(SCons.Memoize.CountValue('get_contents'))
+        self._do_execute = 0
+        self._execute_str = 0
 
+    @SCons.Memoize.CountMethodCall
     def get_contents(self):
         """Fetch the signature contents.  This is the main reason this
         class exists, so we can compute this once and cache it regardless
@@ -489,8 +518,7 @@ class Executor(object):
     def _get_unignored_sources_key(self, node, ignore=()):
         return (node,) + tuple(ignore)
 
-    memoizer_counters.append(SCons.Memoize.CountDict('get_unignored_sources', _get_unignored_sources_key))
-
+    @SCons.Memoize.CountDictCall(_get_unignored_sources_key)
     def get_unignored_sources(self, node, ignore=()):
         key = (node,) + tuple(ignore)
         try:
@@ -550,19 +578,20 @@ def AddBatchExecutor(key, executor):
 nullenv = None
 
 
+import SCons.Util
+class NullEnvironment(SCons.Util.Null):
+    import SCons.CacheDir
+    _CacheDir_path = None
+    _CacheDir = SCons.CacheDir.CacheDir(None)
+    def get_CacheDir(self):
+        return self._CacheDir
+
+
 def get_NullEnvironment():
     """Use singleton pattern for Null Environments."""
     global nullenv
 
-    import SCons.Util
-    class NullEnvironment(SCons.Util.Null):
-        import SCons.CacheDir
-        _CacheDir_path = None
-        _CacheDir = SCons.CacheDir.CacheDir(None)
-        def get_CacheDir(self):
-            return self._CacheDir
-
-    if not nullenv:
+    if nullenv is None:
         nullenv = NullEnvironment()
     return nullenv
 
@@ -570,12 +599,29 @@ class Null(object):
     """A null Executor, with a null build Environment, that does
     nothing when the rest of the methods call it.
 
-    This might be able to disapper when we refactor things to
+    This might be able to disappear when we refactor things to
     disassociate Builders from Nodes entirely, so we're not
     going to worry about unit tests for this--at least for now.
     """
+    
+    __slots__ = ('pre_actions',
+                 'post_actions',
+                 'env',
+                 'overridelist',
+                 'batches',
+                 'builder_kw',
+                 '_memo',
+                 'lvars',
+                 '_changed_sources_list',
+                 '_changed_targets_list',
+                 '_unchanged_sources_list',
+                 '_unchanged_targets_list',
+                 'action_list',
+                 '_do_execute',
+                 '_execute_str')
+    
     def __init__(self, *args, **kw):
-        if __debug__: logInstanceCreation(self, 'Executor.Null')
+        if SCons.Debug.track_instances: logInstanceCreation(self, 'Executor.Null')
         self.batches = [Batch(kw['targets'][:], [])]
     def get_build_env(self):
         return get_NullEnvironment()
@@ -625,7 +671,6 @@ class Null(object):
         self._morph()
         self.set_action_list(action)
 
-
 # Local Variables:
 # tab-width:4
 # indent-tabs-mode:nil
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Job.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Job.py
similarity index 98%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Job.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Job.py
index 342f55e98b375f6f85976fcb9ce5dcdde83b17a8..60aa0ae1385bb2f3d44c2dbeffe6277ceb73cbbf 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Job.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Job.py
@@ -7,7 +7,7 @@ stop, and wait on jobs.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -29,7 +29,7 @@ stop, and wait on jobs.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Job.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Job.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import SCons.compat
 
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Memoize.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Memoize.py
similarity index 60%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Memoize.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Memoize.py
index 9850a841f4649eac43cbd93d9c4e9eee1860b47c..77a8e161e2ea0fb71933f64f176d93e7674e9979 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Memoize.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Memoize.py
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -21,21 +21,21 @@
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Memoize.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Memoize.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 __doc__ = """Memoizer
 
-A metaclass implementation to count hits and misses of the computed
+A decorator-based implementation to count hits and misses of the computed
 values that various methods cache in memory.
 
 Use of this modules assumes that wrapped methods be coded to cache their
-values in a consistent way.  Here is an example of wrapping a method
-that returns a computed value, with no input parameters:
+values in a consistent way. In particular, it requires that the class uses a
+dictionary named "_memo" to store the cached values.
 
-    memoizer_counters = []                                      # Memoization
-
-    memoizer_counters.append(SCons.Memoize.CountValue('foo'))   # Memoization
+Here is an example of wrapping a method that returns a computed value,
+with no input parameters:
 
+    @SCons.Memoize.CountMethodCall
     def foo(self):
 
         try:                                                    # Memoization
@@ -55,8 +55,7 @@ based on one or more input arguments:
     def _bar_key(self, argument):                               # Memoization
         return argument                                         # Memoization
 
-    memoizer_counters.append(SCons.Memoize.CountDict('bar', _bar_key)) # Memoization
-
+    @SCons.Memoize.CountDictCall(_bar_key)
     def bar(self, argument):
 
         memo_key = argument                                     # Memoization
@@ -77,10 +76,6 @@ based on one or more input arguments:
 
         return result
 
-At one point we avoided replicating this sort of logic in all the methods
-by putting it right into this module, but we've moved away from that at
-present (see the "Historical Note," below.).
-
 Deciding what to cache is tricky, because different configurations
 can have radically different performance tradeoffs, and because the
 tradeoffs involved are often so non-obvious.  Consequently, deciding
@@ -102,51 +97,37 @@ cache return values from a method that's being called a lot:
         input arguments, you don't need to use all of the arguments
         if some of them don't affect the return values.
 
-Historical Note:  The initial Memoizer implementation actually handled
-the caching of values for the wrapped methods, based on a set of generic
-algorithms for computing hashable values based on the method's arguments.
-This collected caching logic nicely, but had two drawbacks:
-
-    Running arguments through a generic key-conversion mechanism is slower
-    (and less flexible) than just coding these things directly.  Since the
-    methods that need memoized values are generally performance-critical,
-    slowing them down in order to collect the logic isn't the right
-    tradeoff.
-
-    Use of the memoizer really obscured what was being called, because
-    all the memoized methods were wrapped with re-used generic methods.
-    This made it more difficult, for example, to use the Python profiler
-    to figure out how to optimize the underlying methods.
 """
 
-import types
-
 # A flag controlling whether or not we actually use memoization.
 use_memoizer = None
 
-CounterList = []
+# Global list of counter objects
+CounterList = {}
 
 class Counter(object):
     """
     Base class for counting memoization hits and misses.
 
-    We expect that the metaclass initialization will have filled in
-    the .name attribute that represents the name of the function
-    being counted.
+    We expect that the initialization in a matching decorator will
+    fill in the correct class name and method name that represents
+    the name of the function being counted.
     """
-    def __init__(self, method_name):
+    def __init__(self, cls_name, method_name):
         """
         """
+        self.cls_name = cls_name
         self.method_name = method_name
         self.hit = 0
         self.miss = 0
-        CounterList.append(self)
+    def key(self):
+        return self.cls_name+'.'+self.method_name
     def display(self):
         fmt = "    %7d hits %7d misses    %s()"
-        print fmt % (self.hit, self.miss, self.name)
+        print fmt % (self.hit, self.miss, self.key())
     def __cmp__(self, other):
         try:
-            return cmp(self.name, other.name)
+            return cmp(self.key(), other.key())
         except AttributeError:
             return 0
 
@@ -154,45 +135,39 @@ class CountValue(Counter):
     """
     A counter class for simple, atomic memoized values.
 
-    A CountValue object should be instantiated in a class for each of
+    A CountValue object should be instantiated in a decorator for each of
     the class's methods that memoizes its return value by simply storing
     the return value in its _memo dictionary.
-
-    We expect that the metaclass initialization will fill in the
-    .underlying_method attribute with the method that we're wrapping.
-    We then call the underlying_method method after counting whether
-    its memoized value has already been set (a hit) or not (a miss).
     """
-    def __call__(self, *args, **kw):
+    def count(self, *args, **kw):
+        """ Counts whether the memoized value has already been
+            set (a hit) or not (a miss).
+        """
         obj = args[0]
         if self.method_name in obj._memo:
             self.hit = self.hit + 1
         else:
             self.miss = self.miss + 1
-        return self.underlying_method(*args, **kw)
 
 class CountDict(Counter):
     """
     A counter class for memoized values stored in a dictionary, with
     keys based on the method's input arguments.
 
-    A CountDict object is instantiated in a class for each of the
+    A CountDict object is instantiated in a decorator for each of the
     class's methods that memoizes its return value in a dictionary,
     indexed by some key that can be computed from one or more of
     its input arguments.
-
-    We expect that the metaclass initialization will fill in the
-    .underlying_method attribute with the method that we're wrapping.
-    We then call the underlying_method method after counting whether the
-    computed key value is already present in the memoization dictionary
-    (a hit) or not (a miss).
     """
-    def __init__(self, method_name, keymaker):
+    def __init__(self, cls_name, method_name, keymaker):
         """
         """
-        Counter.__init__(self, method_name)
+        Counter.__init__(self, cls_name, method_name)
         self.keymaker = keymaker
-    def __call__(self, *args, **kw):
+    def count(self, *args, **kw):
+        """ Counts whether the computed key value is already present
+           in the memoization dictionary (a hit) or not (a miss).
+        """
         obj = args[0]
         try:
             memo_dict = obj._memo[self.method_name]
@@ -204,39 +179,65 @@ class CountDict(Counter):
                 self.hit = self.hit + 1
             else:
                 self.miss = self.miss + 1
-        return self.underlying_method(*args, **kw)
-
-class Memoizer(object):
-    """Object which performs caching of method calls for its 'primary'
-    instance."""
-
-    def __init__(self):
-        pass
 
 def Dump(title=None):
+    """ Dump the hit/miss count for all the counters
+        collected so far.
+    """
     if title:
         print title
-    CounterList.sort()
-    for counter in CounterList:
-        counter.display()
-
-class Memoized_Metaclass(type):
-    def __init__(cls, name, bases, cls_dict):
-        super(Memoized_Metaclass, cls).__init__(name, bases, cls_dict)
-
-        for counter in cls_dict.get('memoizer_counters', []):
-            method_name = counter.method_name
-
-            counter.name = cls.__name__ + '.' + method_name
-            counter.underlying_method = cls_dict[method_name]
-
-            replacement_method = types.MethodType(counter, None, cls)
-            setattr(cls, method_name, replacement_method)
+    for counter in sorted(CounterList):
+        CounterList[counter].display()
 
 def EnableMemoization():
     global use_memoizer
     use_memoizer = 1
 
+def CountMethodCall(fn):
+    """ Decorator for counting memoizer hits/misses while retrieving
+        a simple value in a class method. It wraps the given method
+        fn and uses a CountValue object to keep track of the
+        caching statistics.
+        Wrapping gets enabled by calling EnableMemoization().
+    """
+    if use_memoizer:
+        def wrapper(self, *args, **kwargs):
+            global CounterList
+            key = self.__class__.__name__+'.'+fn.__name__
+            if key not in CounterList:
+                CounterList[key] = CountValue(self.__class__.__name__, fn.__name__)
+            CounterList[key].count(self, *args, **kwargs)
+            return fn(self, *args, **kwargs)
+        wrapper.__name__= fn.__name__
+        return wrapper
+    else:
+        return fn
+
+def CountDictCall(keyfunc):
+    """ Decorator for counting memoizer hits/misses while accessing
+        dictionary values with a key-generating function. Like
+        CountMethodCall above, it wraps the given method
+        fn and uses a CountDict object to keep track of the
+        caching statistics. The dict-key function keyfunc has to
+        get passed in the decorator call and gets stored in the
+        CountDict instance.
+        Wrapping gets enabled by calling EnableMemoization().
+    """
+    def decorator(fn):
+        if use_memoizer:
+            def wrapper(self, *args, **kwargs):
+                global CounterList
+                key = self.__class__.__name__+'.'+fn.__name__
+                if key not in CounterList:
+                    CounterList[key] = CountDict(self.__class__.__name__, fn.__name__, keyfunc)
+                CounterList[key].count(self, *args, **kwargs)
+                return fn(self, *args, **kwargs)
+            wrapper.__name__= fn.__name__
+            return wrapper
+        else:
+            return fn
+    return decorator
+
 # Local Variables:
 # tab-width:4
 # indent-tabs-mode:nil
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Node/Alias.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Node/Alias.py
similarity index 73%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Node/Alias.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Node/Alias.py
index fbef1fdd14793f99cce56f0df18b1ab4e7ce4f6a..7e13b00d879413e27de16ee2590b2e77c7ae1f56 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Node/Alias.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Node/Alias.py
@@ -8,7 +8,7 @@ This creates a hash of global Aliases (dummy targets).
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -30,7 +30,7 @@ This creates a hash of global Aliases (dummy targets).
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Node/Alias.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Node/Alias.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import collections
 
@@ -56,13 +56,47 @@ class AliasNameSpace(collections.UserDict):
             return None
 
 class AliasNodeInfo(SCons.Node.NodeInfoBase):
-    current_version_id = 1
+    __slots__ = ('csig',)
+    current_version_id = 2
     field_list = ['csig']
     def str_to_node(self, s):
         return default_ans.Alias(s)
 
+    def __getstate__(self):
+        """
+        Return all fields that shall be pickled. Walk the slots in the class
+        hierarchy and add those to the state dictionary. If a '__dict__' slot is
+        available, copy all entries to the dictionary. Also include the version
+        id, which is fixed for all instances of a class.
+        """
+        state = getattr(self, '__dict__', {}).copy()
+        for obj in type(self).mro():
+            for name in getattr(obj,'__slots__',()):
+                if hasattr(self, name):
+                    state[name] = getattr(self, name)
+
+        state['_version_id'] = self.current_version_id
+        try:
+            del state['__weakref__']
+        except KeyError:
+            pass
+
+        return state
+
+    def __setstate__(self, state):
+        """
+        Restore the attributes from a pickled state.
+        """
+        # TODO check or discard version
+        del state['_version_id']
+        for key, value in state.items():
+            if key not in ('__weakref__',):
+                setattr(self, key, value)
+          
+
 class AliasBuildInfo(SCons.Node.BuildInfoBase):
-    current_version_id = 1
+    __slots__ = ()
+    current_version_id = 2
 
 class Alias(SCons.Node.Node):
 
@@ -72,7 +106,9 @@ class Alias(SCons.Node.Node):
     def __init__(self, name):
         SCons.Node.Node.__init__(self)
         self.name = name
-
+        self.changed_since_last_build = 1
+        self.store_info = 0
+        
     def str_for_display(self):
         return '"' + self.__str__() + '"'
 
@@ -105,13 +141,6 @@ class Alias(SCons.Node.Node):
     #
     #
 
-    def changed_since_last_build(self, target, prev_ni):
-        cur_csig = self.get_csig()
-        try:
-            return cur_csig != prev_ni.csig
-        except AttributeError:
-            return 1
-
     def build(self):
         """A "builder" for aliases."""
         pass
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Node/FS.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Node/FS.py
similarity index 82%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Node/FS.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Node/FS.py
index 3f3cf2870c1fcebc94e8728202a1e80b355a474f..b6a1bb52a2cdc4fe452a5979bf9dcc2ec4429409 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Node/FS.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Node/FS.py
@@ -11,7 +11,7 @@ that can be used by scripts or modules looking for the canonical default.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -32,7 +32,7 @@ that can be used by scripts or modules looking for the canonical default.
 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
-__revision__ = "src/engine/SCons/Node/FS.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Node/FS.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import fnmatch
 import os
@@ -44,6 +44,7 @@ import time
 import codecs
 
 import SCons.Action
+import SCons.Debug
 from SCons.Debug import logInstanceCreation
 import SCons.Errors
 import SCons.Memoize
@@ -55,10 +56,23 @@ import SCons.Warnings
 
 from SCons.Debug import Trace
 
-do_store_info = True
 print_duplicate = 0
 
 
+def sconsign_none(node):
+    raise NotImplementedError
+
+def sconsign_dir(node):
+    """Return the .sconsign file info for this directory,
+    creating it first if necessary."""
+    if not node._sconsign:
+        import SCons.SConsign
+        node._sconsign = SCons.SConsign.ForDirectory(node)
+    return node._sconsign
+
+_sconsign_map = {0 : sconsign_none,
+                 1 : sconsign_dir}
+
 class EntryProxyAttributeError(AttributeError):
     """
     An AttributeError subclass for recording and displaying the name
@@ -267,8 +281,8 @@ def LinkFunc(target, source, env):
     # who want to move their soft-linked src-trees around. Those
     # people should use the 'hard-copy' mode, softlinks cannot be
     # used for that; at least I have no idea how ...
-    src = source[0].abspath
-    dest = target[0].abspath
+    src = source[0].get_abspath()
+    dest = target[0].get_abspath()
     dir, file = os.path.split(dest)
     if dir and not target[0].fs.isdir(dir):
         os.makedirs(dir)
@@ -301,7 +315,7 @@ LocalCopy = SCons.Action.Action(LinkFunc, LocalString)
 
 def UnlinkFunc(target, source, env):
     t = target[0]
-    t.fs.unlink(t.abspath)
+    t.fs.unlink(t.get_abspath())
     return 0
 
 Unlink = SCons.Action.Action(UnlinkFunc, None)
@@ -309,7 +323,7 @@ Unlink = SCons.Action.Action(UnlinkFunc, None)
 def MkdirFunc(target, source, env):
     t = target[0]
     if not t.exists():
-        t.fs.mkdir(t.abspath)
+        t.fs.mkdir(t.get_abspath())
     return 0
 
 Mkdir = SCons.Action.Action(MkdirFunc, None, presub=None)
@@ -402,7 +416,7 @@ def do_diskcheck_match(node, predicate, errorfmt):
     except (AttributeError, KeyError):
         pass
     if result:
-        raise TypeError(errorfmt % node.abspath)
+        raise TypeError(errorfmt % node.get_abspath())
 
 def ignore_diskcheck_match(node, predicate, errorfmt):
     pass
@@ -572,7 +586,20 @@ class Base(SCons.Node.Node):
     object identity comparisons.
     """
 
-    memoizer_counters = []
+    __slots__ = ['name',
+                 'fs',
+                 '_abspath',
+                 '_labspath',
+                 '_path',
+                 '_tpath',
+                 '_path_elements',
+                 'dir',
+                 'cwd',
+                 'duplicate',
+                 '_local',
+                 'sbuilder',
+                 '_proxy',
+                 '_func_sconsign']
 
     def __init__(self, name, directory, fs):
         """Initialize a generic Node.FS.Base object.
@@ -581,7 +608,7 @@ class Base(SCons.Node.Node):
         our relative and absolute paths, identify our parent
         directory, and indicate that this node should use
         signatures."""
-        if __debug__: logInstanceCreation(self, 'Node.FS.Base')
+        if SCons.Debug.track_instances: logInstanceCreation(self, 'Node.FS.Base')
         SCons.Node.Node.__init__(self)
 
         # Filenames and paths are probably reused and are intern'ed to
@@ -590,27 +617,26 @@ class Base(SCons.Node.Node):
         #: Filename with extension as it was specified when the object was
         #: created; to obtain filesystem path, use Python str() function
         self.name = SCons.Util.silent_intern(name)
-        #: Cached filename extension
-        self.suffix = SCons.Util.silent_intern(SCons.Util.splitext(name)[1])
         self.fs = fs #: Reference to parent Node.FS object
 
         assert directory, "A directory must be provided"
 
-        self.abspath = SCons.Util.silent_intern(directory.entry_abspath(name))
-        self.labspath = SCons.Util.silent_intern(directory.entry_labspath(name))
-        if directory.path == '.':
-            self.path = SCons.Util.silent_intern(name)
-        else:
-            self.path = SCons.Util.silent_intern(directory.entry_path(name))
-        if directory.tpath == '.':
-            self.tpath = SCons.Util.silent_intern(name)
-        else:
-            self.tpath = SCons.Util.silent_intern(directory.entry_tpath(name))
-        self.path_elements = directory.path_elements + [self]
+        self._abspath = None
+        self._labspath = None
+        self._path = None
+        self._tpath = None
+        self._path_elements = None
 
         self.dir = directory
         self.cwd = None # will hold the SConscript directory for target nodes
         self.duplicate = directory.duplicate
+        self.changed_since_last_build = 2
+        self._func_sconsign = 0
+        self._func_exists = 2
+        self._func_rexists = 2
+        self._func_get_contents = 0
+        self._func_target_from_source = 1
+        self.store_info = 1
 
     def str_for_display(self):
         return '"' + self.__str__() + '"'
@@ -623,17 +649,38 @@ class Base(SCons.Node.Node):
         if isinstance(self, klass) or klass is Entry:
             return
         raise TypeError("Tried to lookup %s '%s' as a %s." %\
-              (self.__class__.__name__, self.path, klass.__name__))
+              (self.__class__.__name__, self.get_internal_path(), klass.__name__))
 
     def get_dir(self):
         return self.dir
 
     def get_suffix(self):
-        return self.suffix
+        return SCons.Util.splitext(self.name)[1]
 
     def rfile(self):
         return self
 
+    def __getattr__(self, attr):
+        """ Together with the node_bwcomp dict defined below,
+            this method provides a simple backward compatibility
+            layer for the Node attributes 'abspath', 'labspath',
+            'path', 'tpath', 'suffix' and 'path_elements'. These Node
+            attributes used to be directly available in v2.3 and earlier, but
+            have been replaced by getter methods that initialize the
+            single variables lazily when required, in order to save memory.
+            The redirection to the getters lets older Tools and
+            SConstruct continue to work without any additional changes,
+            fully transparent to the user. 
+            Note, that __getattr__ is only called as fallback when the
+            requested attribute can't be found, so there should be no
+            speed performance penalty involved for standard builds.
+        """
+        if attr in node_bwcomp:
+            return node_bwcomp[attr](self)
+        
+        raise AttributeError("%r object has no attribute %r" %
+                         (self.__class__, attr))
+
     def __str__(self):
         """A Node.FS.Base object's string representation is its path
         name."""
@@ -642,8 +689,7 @@ class Base(SCons.Node.Node):
             return self._save_str()
         return self._get_str()
 
-    memoizer_counters.append(SCons.Memoize.CountValue('_save_str'))
-
+    @SCons.Memoize.CountMethodCall
     def _save_str(self):
         try:
             return self._memo['_save_str']
@@ -680,21 +726,20 @@ class Base(SCons.Node.Node):
 
     rstr = __str__
 
-    memoizer_counters.append(SCons.Memoize.CountValue('stat'))
-
+    @SCons.Memoize.CountMethodCall
     def stat(self):
         try: return self._memo['stat']
         except KeyError: pass
-        try: result = self.fs.stat(self.abspath)
+        try: result = self.fs.stat(self.get_abspath())
         except os.error: result = None
         self._memo['stat'] = result
         return result
 
     def exists(self):
-        return self.stat() is not None
+        return SCons.Node._exists_map[self._func_exists](self)
 
     def rexists(self):
-        return self.rfile().exists()
+        return SCons.Node._rexists_map[self._func_rexists](self)
 
     def getmtime(self):
         st = self.stat()
@@ -716,7 +761,7 @@ class Base(SCons.Node.Node):
 
     if hasattr(os, 'symlink'):
         def islink(self):
-            try: st = self.fs.lstat(self.abspath)
+            try: st = self.fs.lstat(self.get_abspath())
             except os.error: return 0
             return stat.S_ISLNK(st[stat.ST_MODE])
     else:
@@ -751,7 +796,7 @@ class Base(SCons.Node.Node):
             dir = self.fs.getcwd()
         if self == dir:
             return '.'
-        path_elems = self.path_elements
+        path_elems = self.get_path_elements()
         pathname = ''
         try: i = path_elems.index(dir)
         except ValueError: 
@@ -784,7 +829,26 @@ class Base(SCons.Node.Node):
 
     def get_abspath(self):
         """Get the absolute path of the file."""
-        return self.abspath
+        return self.dir.entry_abspath(self.name)
+
+    def get_labspath(self):
+        """Get the absolute path of the file."""
+        return self.dir.entry_labspath(self.name)
+
+    def get_internal_path(self):
+        if self.dir._path == '.':
+            return self.name
+        else:
+            return self.dir.entry_path(self.name)
+        
+    def get_tpath(self):
+        if self.dir._tpath == '.':
+            return self.name
+        else:
+            return self.dir.entry_tpath(self.name)
+        
+    def get_path_elements(self):
+        return self.dir._path_elements + [self]
 
     def for_signature(self):
         # Return just our name.  Even an absolute path would not work,
@@ -810,13 +874,12 @@ class Base(SCons.Node.Node):
         files that need different behavior.  See Tool/swig.py for
         an example.
         """
-        return self.dir.Entry(prefix + splitext(self.name)[0] + suffix)
+        return SCons.Node._target_from_source_map[self._func_target_from_source](self, prefix, suffix, splitext)
 
     def _Rfindalldirs_key(self, pathlist):
         return pathlist
 
-    memoizer_counters.append(SCons.Memoize.CountDict('Rfindalldirs', _Rfindalldirs_key))
-
+    @SCons.Memoize.CountDictCall(_Rfindalldirs_key)
     def Rfindalldirs(self, pathlist):
         """
         Return all of the directories for a given path list, including
@@ -855,8 +918,7 @@ class Base(SCons.Node.Node):
         cwd = self.cwd or self.fs._cwd
         return cwd.Rfindalldirs(pathlist)
 
-    memoizer_counters.append(SCons.Memoize.CountValue('rentry'))
-
+    @SCons.Memoize.CountMethodCall
     def rentry(self):
         try:
             return self._memo['rentry']
@@ -877,6 +939,17 @@ class Base(SCons.Node.Node):
 
     def _glob1(self, pattern, ondisk=True, source=False, strings=False):
         return []
+    
+# Dict that provides a simple backward compatibility
+# layer for the Node attributes 'abspath', 'labspath',
+# 'path', 'tpath' and 'path_elements'.
+# @see Base.__getattr__ above
+node_bwcomp = {'abspath' : Base.get_abspath,
+               'labspath' : Base.get_labspath,
+               'path' : Base.get_internal_path,
+               'tpath' : Base.get_tpath,
+               'path_elements' : Base.get_path_elements,
+               'suffix' : Base.get_suffix}
 
 class Entry(Base):
     """This is the class for generic Node.FS entries--that is, things
@@ -886,6 +959,28 @@ class Entry(Base):
     time comes, and then call the same-named method in the transformed
     class."""
 
+    __slots__ = ['scanner_paths',
+                 'cachedir_csig',
+                 'cachesig',
+                 'repositories',
+                 'srcdir',
+                 'entries',
+                 'searched',
+                 '_sconsign',
+                 'variant_dirs',
+                 'root',
+                 'dirname',
+                 'on_disk_entries',
+                 'sccs_dir',
+                 'rcs_dir',
+                 'released_target_info',
+                 'contentsig']
+
+    def __init__(self, name, directory, fs):
+        Base.__init__(self, name, directory, fs)
+        self._func_exists = 3
+        self._func_get_contents = 1 
+
     def diskcheck_match(self):
         pass
 
@@ -916,7 +1011,7 @@ class Entry(Base):
                 self.__class__ = Dir
                 self._morph()
             elif must_exist:
-                msg = "No such file or directory: '%s'" % self.abspath
+                msg = "No such file or directory: '%s'" % self.get_abspath()
                 raise SCons.Errors.UserError(msg)
             else:
                 self.__class__ = File
@@ -938,17 +1033,7 @@ class Entry(Base):
     def get_contents(self):
         """Fetch the contents of the entry.  Returns the exact binary
         contents of the file."""
-        try:
-            self = self.disambiguate(must_exist=1)
-        except SCons.Errors.UserError:
-            # There was nothing on disk with which to disambiguate
-            # this entry.  Leave it as an Entry, but return a null
-            # string so calls to get_contents() in emitters and the
-            # like (e.g. in qt.py) don't have to disambiguate by hand
-            # or catch the exception.
-            return ''
-        else:
-            return self.get_contents()
+        return SCons.Node._get_contents_map[self._func_get_contents](self)
 
     def get_text_contents(self):
         """Fetch the decoded text contents of a Unicode encoded Entry.
@@ -988,10 +1073,7 @@ class Entry(Base):
     # to make various tests pass.
 
     def exists(self):
-        """Return if the Entry exists.  Check the file system to see
-        what we should turn into first.  Assume a file if there's no
-        directory."""
-        return self.disambiguate().exists()
+        return SCons.Node._exists_map[self._func_exists](self)
 
     def rel_path(self, other):
         d = self.disambiguate()
@@ -1002,9 +1084,6 @@ class Entry(Base):
     def new_ninfo(self):
         return self.disambiguate().new_ninfo()
 
-    def changed_since_last_build(self, target, prev_ni):
-        return self.disambiguate().changed_since_last_build(target, prev_ni)
-
     def _glob1(self, pattern, ondisk=True, source=False, strings=False):
         return self.disambiguate()._glob1(pattern, ondisk, source, strings)
 
@@ -1018,9 +1097,6 @@ _classEntry = Entry
 
 class LocalFS(object):
 
-    if SCons.Memoize.use_memoizer:
-        __metaclass__ = SCons.Memoize.Memoized_Metaclass
-
     # This class implements an abstraction layer for operations involving
     # a local file system.  Essentially, this wraps any function in
     # the os, os.path or shutil modules that we use to actually go do
@@ -1100,8 +1176,6 @@ class LocalFS(object):
 
 class FS(LocalFS):
 
-    memoizer_counters = []
-
     def __init__(self, path = None):
         """Initialize the Node.FS subsystem.
 
@@ -1111,7 +1185,7 @@ class FS(LocalFS):
 
         The path argument must be a valid absolute path.
         """
-        if __debug__: logInstanceCreation(self, 'Node.FS')
+        if SCons.Debug.track_instances: logInstanceCreation(self, 'Node.FS')
 
         self._memo = {}
 
@@ -1127,8 +1201,8 @@ class FS(LocalFS):
         self.defaultDrive = _my_normcase(_my_splitdrive(self.pathTop)[0])
 
         self.Top = self.Dir(self.pathTop)
-        self.Top.path = '.'
-        self.Top.tpath = '.'
+        self.Top._path = '.'
+        self.Top._tpath = '.'
         self._cwd = self.Top
 
         DirNodeInfo.fs = self
@@ -1159,7 +1233,7 @@ class FS(LocalFS):
             if dir is not None:
                 self._cwd = dir
                 if change_os_dir:
-                    os.chdir(dir.abspath)
+                    os.chdir(dir.get_abspath())
         except OSError:
             self._cwd = curr
             raise
@@ -1248,9 +1322,9 @@ class FS(LocalFS):
             
             # The path is relative to the top-level SCons directory.
             if p in ('', '.'):
-                p = directory.labspath
+                p = directory.get_labspath()
             else:
-                p = directory.labspath + '/' + p
+                p = directory.get_labspath() + '/' + p
         else:
             if do_splitdrive:
                 drive, p = _my_splitdrive(p)
@@ -1284,9 +1358,9 @@ class FS(LocalFS):
                     directory = self._cwd
 
                 if p in ('', '.'):
-                    p = directory.labspath
+                    p = directory.get_labspath()
                 else:
-                    p = directory.labspath + '/' + p
+                    p = directory.get_labspath() + '/' + p
 
                 if drive:
                     root = self.get_root(drive)
@@ -1392,7 +1466,7 @@ class FS(LocalFS):
                 if start_dir.is_under(bd):
                     # If already in the build-dir location, don't reflect
                     return [orig], fmt % str(orig)
-                p = os.path.join(bd.path, *tail)
+                p = os.path.join(bd._path, *tail)
                 targets.append(self.Entry(p))
             tail = [dir.name] + tail
             dir = dir.up()
@@ -1400,7 +1474,7 @@ class FS(LocalFS):
             message = fmt % ' '.join(map(str, targets))
         return targets, message
 
-    def Glob(self, pathname, ondisk=True, source=True, strings=False, cwd=None):
+    def Glob(self, pathname, ondisk=True, source=True, strings=False, exclude=None, cwd=None):
         """
         Globs
 
@@ -1408,11 +1482,12 @@ class FS(LocalFS):
         """
         if cwd is None:
             cwd = self.getcwd()
-        return cwd.glob(pathname, ondisk, source, strings)
+        return cwd.glob(pathname, ondisk, source, strings, exclude)
 
 class DirNodeInfo(SCons.Node.NodeInfoBase):
+    __slots__ = ()
     # This should get reset by the FS initialization.
-    current_version_id = 1
+    current_version_id = 2
 
     fs = None
 
@@ -1424,11 +1499,12 @@ class DirNodeInfo(SCons.Node.NodeInfoBase):
             if drive:
                 root = self.fs.get_root(drive)
         if not os.path.isabs(s):
-            s = top.labspath + '/' + s
+            s = top.get_labspath() + '/' + s
         return root._lookup_abs(s, Entry)
 
 class DirBuildInfo(SCons.Node.BuildInfoBase):
-    current_version_id = 1
+    __slots__ = ()
+    current_version_id = 2
 
 glob_magic_check = re.compile('[*?[]')
 
@@ -1439,13 +1515,28 @@ class Dir(Base):
     """A class for directories in a file system.
     """
 
-    memoizer_counters = []
+    __slots__ = ['scanner_paths',
+                 'cachedir_csig',
+                 'cachesig',
+                 'repositories',
+                 'srcdir',
+                 'entries',
+                 'searched',
+                 '_sconsign',
+                 'variant_dirs',
+                 'root',
+                 'dirname',
+                 'on_disk_entries',
+                 'sccs_dir',
+                 'rcs_dir',
+                 'released_target_info',
+                 'contentsig']
 
     NodeInfo = DirNodeInfo
     BuildInfo = DirBuildInfo
 
     def __init__(self, name, directory, fs):
-        if __debug__: logInstanceCreation(self, 'Node.FS.Dir')
+        if SCons.Debug.track_instances: logInstanceCreation(self, 'Node.FS.Dir')
         Base.__init__(self, name, directory, fs)
         self._morph()
 
@@ -1469,6 +1560,22 @@ class Dir(Base):
         self._sconsign = None
         self.variant_dirs = []
         self.root = self.dir.root
+        self.changed_since_last_build = 3
+        self._func_sconsign = 1
+        self._func_exists = 2
+        self._func_get_contents = 2
+        
+        self._abspath = SCons.Util.silent_intern(self.dir.entry_abspath(self.name))
+        self._labspath = SCons.Util.silent_intern(self.dir.entry_labspath(self.name))
+        if self.dir._path == '.':
+            self._path = SCons.Util.silent_intern(self.name)
+        else:
+            self._path = SCons.Util.silent_intern(self.dir.entry_path(self.name))
+        if self.dir._tpath == '.':
+            self._tpath = SCons.Util.silent_intern(self.name)
+        else:
+            self._tpath = SCons.Util.silent_intern(self.dir.entry_tpath(self.name))
+        self._path_elements = self.dir._path_elements + [self]
 
         # For directories, we make a difference between the directory
         # 'name' and the directory 'dirname'. The 'name' attribute is
@@ -1561,8 +1668,7 @@ class Dir(Base):
             return self.srcdir.get_all_rdirs() + self.repositories
         return self.repositories
 
-    memoizer_counters.append(SCons.Memoize.CountValue('get_all_rdirs'))
-
+    @SCons.Memoize.CountMethodCall
     def get_all_rdirs(self):
         try:
             return list(self._memo['get_all_rdirs'])
@@ -1588,7 +1694,7 @@ class Dir(Base):
     def addRepository(self, dir):
         if dir != self and not dir in self.repositories:
             self.repositories.append(dir)
-            dir.tpath = '.'
+            dir._tpath = '.'
             self.__clearRepositoryCache()
 
     def up(self):
@@ -1597,8 +1703,7 @@ class Dir(Base):
     def _rel_path_key(self, other):
         return str(other)
 
-    memoizer_counters.append(SCons.Memoize.CountDict('rel_path', _rel_path_key))
-
+    @SCons.Memoize.CountDictCall(_rel_path_key)
     def rel_path(self, other):
         """Return a path to "other" relative to this directory.
         """
@@ -1627,7 +1732,7 @@ class Dir(Base):
         if self is other:
             result = '.'
 
-        elif not other in self.path_elements:
+        elif not other in self._path_elements:
             try:
                 other_dir = other.get_dir()
             except AttributeError:
@@ -1642,10 +1747,10 @@ class Dir(Base):
                     else:
                         result = dir_rel_path + OS_SEP + other.name
         else:
-            i = self.path_elements.index(other) + 1
+            i = self._path_elements.index(other) + 1
 
-            path_elems = ['..'] * (len(self.path_elements) - i) \
-                         + [n.name for n in other.path_elements[i:]]
+            path_elems = ['..'] * (len(self._path_elements) - i) \
+                         + [n.name for n in other._path_elements[i:]]
              
             result = OS_SEP.join(path_elems)
 
@@ -1712,7 +1817,7 @@ class Dir(Base):
             if p is None:
                 # Don't use while: - else: for this condition because
                 # if so, then parent is None and has no .path attribute.
-                raise SCons.Errors.StopError(parent.path)
+                raise SCons.Errors.StopError(parent._path)
             parent = p
         listDirs.reverse()
         for dirnode in listDirs:
@@ -1752,10 +1857,7 @@ class Dir(Base):
     def get_contents(self):
         """Return content signatures and names of all our children
         separated by new-lines. Ensure that the nodes are sorted."""
-        contents = []
-        for node in sorted(self.children(), key=lambda t: t.name):
-            contents.append('%s %s\n' % (node.get_csig(), node.name))
-        return ''.join(contents)
+        return SCons.Node._get_contents_map[self._func_get_contents](self)
 
     def get_csig(self):
         """Compute the content signature for Directory nodes. In
@@ -1769,8 +1871,6 @@ class Dir(Base):
     def do_duplicate(self, src):
         pass
 
-    changed_since_last_build = SCons.Node.Node.state_has_changed
-
     def is_up_to_date(self):
         """If any child is not up-to-date, then this directory isn't,
         either."""
@@ -1794,12 +1894,8 @@ class Dir(Base):
         return self
 
     def sconsign(self):
-        """Return the .sconsign file info for this directory,
-        creating it first if necessary."""
-        if not self._sconsign:
-            import SCons.SConsign
-            self._sconsign = SCons.SConsign.ForDirectory(self)
-        return self._sconsign
+        """Return the .sconsign file info for this directory. """
+        return _sconsign_map[self._func_sconsign](self)
 
     def srcnode(self):
         """Dir has a special need for srcnode()...if we
@@ -1816,45 +1912,94 @@ class Dir(Base):
                 stamp = kid.get_timestamp()
         return stamp
 
+    def get_abspath(self):
+        """Get the absolute path of the file."""
+        return self._abspath
+
+    def get_labspath(self):
+        """Get the absolute path of the file."""
+        return self._labspath
+
+    def get_internal_path(self):
+        return self._path
+        
+    def get_tpath(self):
+        return self._tpath
+        
+    def get_path_elements(self):
+        return self._path_elements
+
     def entry_abspath(self, name):
-        return self.abspath + OS_SEP + name
+        return self._abspath + OS_SEP + name
 
     def entry_labspath(self, name):
-        return self.labspath + '/' + name
+        return self._labspath + '/' + name
 
     def entry_path(self, name):
-        return self.path + OS_SEP + name
+        return self._path + OS_SEP + name
 
     def entry_tpath(self, name):
-        return self.tpath + OS_SEP + name
+        return self._tpath + OS_SEP + name
 
     def entry_exists_on_disk(self, name):
+        """ Searches through the file/dir entries of the current
+            directory, and returns True if a physical entry with the given
+            name could be found.
+            
+            @see rentry_exists_on_disk
+        """
         try:
             d = self.on_disk_entries
         except AttributeError:
             d = {}
             try:
-                entries = os.listdir(self.abspath)
+                entries = os.listdir(self._abspath)
             except OSError:
                 pass
             else:
                 for entry in map(_my_normcase, entries):
                     d[entry] = True
             self.on_disk_entries = d
-        if sys.platform == 'win32':
+        if sys.platform == 'win32' or sys.platform == 'cygwin':
             name = _my_normcase(name)
             result = d.get(name)
             if result is None:
                 # Belt-and-suspenders for Windows:  check directly for
                 # 8.3 file names that don't show up in os.listdir().
-                result = os.path.exists(self.abspath + OS_SEP + name)
+                result = os.path.exists(self._abspath + OS_SEP + name)
                 d[name] = result
             return result
         else:
             return name in d
 
-    memoizer_counters.append(SCons.Memoize.CountValue('srcdir_list'))
+    def rentry_exists_on_disk(self, name):
+        """ Searches through the file/dir entries of the current
+            *and* all its remote directories (repos), and returns
+            True if a physical entry with the given name could be found.
+            The local directory (self) gets searched first, so
+            repositories take a lower precedence regarding the
+            searching order.
+            
+            @see entry_exists_on_disk
+        """
+        
+        rentry_exists = self.entry_exists_on_disk(name)
+        if not rentry_exists:
+            # Search through the repository folders
+            norm_name = _my_normcase(name)
+            for rdir in self.get_all_rdirs():
+                try:
+                    node = rdir.entries[norm_name]
+                    if node:
+                        rentry_exists = True
+                        break
+                except KeyError:
+                    if rdir.entry_exists_on_disk(name):
+                        rentry_exists = True
+                        break
+        return rentry_exists
 
+    @SCons.Memoize.CountMethodCall
     def srcdir_list(self):
         try:
             return self._memo['srcdir_list']
@@ -1895,8 +2040,7 @@ class Dir(Base):
     def _srcdir_find_file_key(self, filename):
         return filename
 
-    memoizer_counters.append(SCons.Memoize.CountDict('srcdir_find_file', _srcdir_find_file_key))
-
+    @SCons.Memoize.CountDictCall(_srcdir_find_file_key)
     def srcdir_find_file(self, filename):
         try:
             memo_dict = self._memo['srcdir_find_file']
@@ -1986,7 +2130,7 @@ class Dir(Base):
         for dirname in [n for n in names if isinstance(entries[n], Dir)]:
             entries[dirname].walk(func, arg)
 
-    def glob(self, pathname, ondisk=True, source=False, strings=False):
+    def glob(self, pathname, ondisk=True, source=False, strings=False, exclude=None):
         """
         Returns a list of Nodes (or strings) matching a specified
         pathname pattern.
@@ -2014,24 +2158,31 @@ class Dir(Base):
         The "strings" argument, when true, returns the matches as strings,
         not Nodes.  The strings are path names relative to this directory.
 
+        The "exclude" argument, if not None, must be a pattern or a list
+        of patterns following the same UNIX shell semantics.
+        Elements matching a least one pattern of this list will be excluded
+        from the result.
+
         The underlying algorithm is adapted from the glob.glob() function
         in the Python library (but heavily modified), and uses fnmatch()
         under the covers.
         """
         dirname, basename = os.path.split(pathname)
         if not dirname:
-            return sorted(self._glob1(basename, ondisk, source, strings),
-                          key=lambda t: str(t))
-        if has_glob_magic(dirname):
-            list = self.glob(dirname, ondisk, source, strings=False)
+            result = self._glob1(basename, ondisk, source, strings)
         else:
-            list = [self.Dir(dirname, create=True)]
-        result = []
-        for dir in list:
-            r = dir._glob1(basename, ondisk, source, strings)
-            if strings:
-                r = [os.path.join(str(dir), x) for x in r]
-            result.extend(r)
+            if has_glob_magic(dirname):
+                list = self.glob(dirname, ondisk, source, False, exclude)
+            else:
+                list = [self.Dir(dirname, create=True)]
+            result = []
+            for dir in list:
+                r = dir._glob1(basename, ondisk, source, strings)
+                if strings:
+                    r = [os.path.join(str(dir), x) for x in r]
+                result.extend(r)
+        if exclude:
+            result = filter(lambda x: not any(fnmatch.fnmatch(str(x), e) for e in SCons.Util.flatten(exclude)), result)
         return sorted(result, key=lambda a: str(a))
 
     def _glob1(self, pattern, ondisk=True, source=False, strings=False):
@@ -2064,7 +2215,7 @@ class Dir(Base):
                 for name in node_names: selfEntry(name)
             if ondisk:
                 try:
-                    disk_names = os.listdir(dir.abspath)
+                    disk_names = os.listdir(dir._abspath)
                 except os.error:
                     continue
                 names.extend(disk_names)
@@ -2094,14 +2245,12 @@ class Dir(Base):
 
         names = set(names)
         if pattern[0] != '.':
-            #names = [ n for n in names if n[0] != '.' ]
             names = [x for x in names if x[0] != '.']
         names = fnmatch.filter(names, pattern)
 
         if strings:
             return names
 
-        #return [ self.entries[_my_normcase(n)] for n in names ]
         return [self.entries[_my_normcase(n)] for n in names]
 
 class RootDir(Dir):
@@ -2112,18 +2261,12 @@ class RootDir(Dir):
     add a separator when creating the path names of entries within
     this directory.
     """
+    
+    __slots__ = ['_lookupDict']
+    
     def __init__(self, drive, fs):
-        if __debug__: logInstanceCreation(self, 'Node.FS.RootDir')
-        # We're going to be our own parent directory (".." entry and .dir
-        # attribute) so we have to set up some values so Base.__init__()
-        # won't gag won't it calls some of our methods.
-        self.abspath = ''
-        self.labspath = ''
-        self.path = ''
-        self.tpath = ''
-        self.path_elements = []
-        self.duplicate = 0
-        self.root = self
+        if SCons.Debug.track_instances: logInstanceCreation(self, 'Node.FS.RootDir')
+        SCons.Node.Node.__init__(self)
 
         # Handle all the types of drives:
         if drive == '':
@@ -2139,33 +2282,85 @@ class RootDir(Dir):
             name = drive
             dirname = drive + OS_SEP
 
-        Base.__init__(self, name, self, fs)
+        #: Filename with extension as it was specified when the object was
+        #: created; to obtain filesystem path, use Python str() function
+        self.name = SCons.Util.silent_intern(name)
+        self.fs = fs #: Reference to parent Node.FS object
+
+        self._path_elements = [self]
+        self.dir = self
+        self._func_rexists = 2
+        self._func_target_from_source = 1
+        self.store_info = 1
 
         # Now set our paths to what we really want them to be. The
         # name should already contain any necessary separators, such
         # as the initial drive letter (the name) plus the directory
         # separator, except for the "lookup abspath," which does not
         # have the drive letter.
-        self.abspath = dirname
-        self.labspath = ''
-        self.path = dirname
-        self.tpath = dirname
-        self._morph()
-
-        # Must be reset after Dir._morph() is invoked...
+        self._abspath = dirname
+        self._labspath = ''
+        self._path = dirname
+        self._tpath = dirname
         self.dirname = dirname
 
+        self._morph()
+
+        self.duplicate = 0
         self._lookupDict = {}
 
         self._lookupDict[''] = self
         self._lookupDict['/'] = self
-
+        self.root = self
         # The // entry is necessary because os.path.normpath()
         # preserves double slashes at the beginning of a path on Posix
         # platforms.
         if not has_unc:
             self._lookupDict['//'] = self
 
+    def _morph(self):
+        """Turn a file system Node (either a freshly initialized directory
+        object or a separate Entry object) into a proper directory object.
+
+        Set up this directory's entries and hook it into the file
+        system tree.  Specify that directories (this Node) don't use
+        signatures for calculating whether they're current.
+        """
+
+        self.repositories = []
+        self.srcdir = None
+
+        self.entries = {}
+        self.entries['.'] = self
+        self.entries['..'] = self.dir
+        self.cwd = self
+        self.searched = 0
+        self._sconsign = None
+        self.variant_dirs = []
+        self.changed_since_last_build = 3
+        self._func_sconsign = 1
+        self._func_exists = 2
+        self._func_get_contents = 2
+        
+        # Don't just reset the executor, replace its action list,
+        # because it might have some pre-or post-actions that need to
+        # be preserved.
+        #
+        # But don't reset the executor if there is a non-null executor
+        # attached already. The existing executor might have other
+        # targets, in which case replacing the action list with a
+        # Mkdir action is a big mistake.
+        if not hasattr(self, 'executor'):
+            self.builder = get_MkdirBuilder()
+            self.get_executor().set_action_list(self.builder.action)
+        else:
+            # Prepend MkdirBuilder action to existing action list
+            l = self.get_executor().action_list
+            a = get_MkdirBuilder().action
+            l.insert(0, a) 
+            self.get_executor().set_action_list(l)
+      
+
     def must_be_same(self, klass):
         if klass is Dir:
             return
@@ -2196,17 +2391,7 @@ class RootDir(Dir):
                 raise SCons.Errors.UserError(msg)
             # There is no Node for this path name, and we're allowed
             # to create it.
-            # (note: would like to use p.rsplit('/',1) here but
-            # that's not in python 2.3)
-            # e.g.: dir_name, file_name = p.rsplit('/',1)
-            last_slash = p.rindex('/')
-            if (last_slash >= 0):
-                dir_name  = p[:last_slash]
-                file_name = p[last_slash+1:]
-            else:
-                dir_name  = p         # shouldn't happen, just in case
-                file_name = ''
-
+            dir_name, file_name = p.rsplit('/',1)
             dir_node = self._lookup_abs(dir_name, Dir)
             result = klass(file_name, dir_node, self.fs)
 
@@ -2224,19 +2409,19 @@ class RootDir(Dir):
         return result
 
     def __str__(self):
-        return self.abspath
+        return self._abspath
 
     def entry_abspath(self, name):
-        return self.abspath + name
+        return self._abspath + name
 
     def entry_labspath(self, name):
         return '/' + name
 
     def entry_path(self, name):
-        return self.path + name
+        return self._path + name
 
     def entry_tpath(self, name):
-        return self.tpath + name
+        return self._tpath + name
 
     def is_under(self, dir):
         if self is dir:
@@ -2254,7 +2439,8 @@ class RootDir(Dir):
         return _null
 
 class FileNodeInfo(SCons.Node.NodeInfoBase):
-    current_version_id = 1
+    __slots__ = ('csig', 'timestamp', 'size')
+    current_version_id = 2
 
     field_list = ['csig', 'timestamp', 'size']
 
@@ -2269,11 +2455,43 @@ class FileNodeInfo(SCons.Node.NodeInfoBase):
             if drive:
                 root = self.fs.get_root(drive)
         if not os.path.isabs(s):
-            s = top.labspath + '/' + s
+            s = top.get_labspath() + '/' + s
         return root._lookup_abs(s, Entry)
 
+    def __getstate__(self):
+        """
+        Return all fields that shall be pickled. Walk the slots in the class
+        hierarchy and add those to the state dictionary. If a '__dict__' slot is
+        available, copy all entries to the dictionary. Also include the version
+        id, which is fixed for all instances of a class.
+        """
+        state = getattr(self, '__dict__', {}).copy()
+        for obj in type(self).mro():
+            for name in getattr(obj,'__slots__',()):
+                if hasattr(self, name):
+                    state[name] = getattr(self, name)
+
+        state['_version_id'] = self.current_version_id
+        try:
+            del state['__weakref__']
+        except KeyError:
+            pass
+
+        return state
+
+    def __setstate__(self, state):
+        """
+        Restore the attributes from a pickled state.
+        """
+        # TODO check or discard version
+        del state['_version_id']
+        for key, value in state.items():
+            if key not in ('__weakref__',):
+                setattr(self, key, value)
+
 class FileBuildInfo(SCons.Node.BuildInfoBase):
-    current_version_id = 1
+    __slots__ = ()
+    current_version_id = 2
 
     def convert_to_sconsign(self):
         """
@@ -2288,7 +2506,7 @@ class FileBuildInfo(SCons.Node.BuildInfoBase):
         else:
             def node_to_str(n):
                 try:
-                    s = n.path
+                    s = n.get_internal_path()
                 except AttributeError:
                     s = str(n)
                 else:
@@ -2329,6 +2547,8 @@ class FileBuildInfo(SCons.Node.BuildInfoBase):
                 nodeinfos = getattr(self, sattr)
             except AttributeError:
                 continue
+            if strings is None or nodeinfos is None:
+                continue
             nodes = []
             for s, ni in zip(strings, nodeinfos):
                 if not isinstance(s, SCons.Node.Node):
@@ -2342,6 +2562,8 @@ class FileBuildInfo(SCons.Node.BuildInfoBase):
         for bkid, bkidsig in zip(bkids, bkidsigs):
             result.append(str(bkid) + ': ' +
                           ' '.join(bkidsig.format(names=names)))
+        if not hasattr(self,'bact'):
+            self.bact = "none"
         result.append('%s [%s]' % (self.bactsig, self.bact))
         return '\n'.join(result)
 
@@ -2349,7 +2571,22 @@ class File(Base):
     """A class for files in a file system.
     """
 
-    memoizer_counters = []
+    __slots__ = ['scanner_paths',
+                 'cachedir_csig',
+                 'cachesig',
+                 'repositories',
+                 'srcdir',
+                 'entries',
+                 'searched',
+                 '_sconsign',
+                 'variant_dirs',
+                 'root',
+                 'dirname',
+                 'on_disk_entries',
+                 'sccs_dir',
+                 'rcs_dir',
+                 'released_target_info',
+                 'contentsig']
 
     NodeInfo = FileNodeInfo
     BuildInfo = FileBuildInfo
@@ -2361,7 +2598,7 @@ class File(Base):
                         "Directory %s found where file expected.")
 
     def __init__(self, name, directory, fs):
-        if __debug__: logInstanceCreation(self, 'Node.FS.File')
+        if SCons.Debug.track_instances: logInstanceCreation(self, 'Node.FS.File')
         Base.__init__(self, name, directory, fs)
         self._morph()
 
@@ -2397,7 +2634,17 @@ class File(Base):
         self.scanner_paths = {}
         if not hasattr(self, '_local'):
             self._local = 0
+        if not hasattr(self, 'released_target_info'):
+            self.released_target_info = False
 
+        self.store_info = 1
+        self._func_exists = 4
+        self._func_get_contents = 3
+        
+        # Initialize this Node's decider function to decide_source() because
+        # every file is a source file until it has a Builder attached...
+        self.changed_since_last_build = 4
+        
         # If there was already a Builder set on this entry, then
         # we need to make sure we call the target-decider function,
         # not the source-decider.  Reaching in and doing this by hand
@@ -2409,22 +2656,13 @@ class File(Base):
         # not clear right now how to fix that, stick with what works
         # until it becomes clear...
         if self.has_builder():
-            self.changed_since_last_build = self.decide_target
+            self.changed_since_last_build = 5
 
     def scanner_key(self):
         return self.get_suffix()
 
     def get_contents(self):
-        if not self.rexists():
-            return ''
-        fname = self.rfile().abspath
-        try:
-            contents = open(fname, "rb").read()
-        except EnvironmentError, e:
-            if not e.filename:
-                e.filename = fname
-            raise
-        return contents
+        return SCons.Node._get_contents_map[self._func_get_contents](self)
 
     # This attempts to figure out what the encoding of the text is
     # based upon the BOM bytes, and then decodes the contents so that
@@ -2451,7 +2689,7 @@ class File(Base):
         """
         if not self.rexists():
             return SCons.Util.MD5signature('')
-        fname = self.rfile().abspath
+        fname = self.rfile().get_abspath()
         try:
             cs = SCons.Util.MD5filesignature(fname,
                 chunksize=SCons.Node.FS.File.md5_chunksize*1024)
@@ -2461,9 +2699,7 @@ class File(Base):
             raise
         return cs
         
-
-    memoizer_counters.append(SCons.Memoize.CountValue('get_size'))
-
+    @SCons.Memoize.CountMethodCall
     def get_size(self):
         try:
             return self._memo['get_size']
@@ -2479,8 +2715,7 @@ class File(Base):
 
         return size
 
-    memoizer_counters.append(SCons.Memoize.CountValue('get_timestamp'))
-
+    @SCons.Memoize.CountMethodCall
     def get_timestamp(self):
         try:
             return self._memo['get_timestamp']
@@ -2496,14 +2731,6 @@ class File(Base):
 
         return timestamp
 
-    def store_info(self):
-        # Merge our build information into the already-stored entry.
-        # This accomodates "chained builds" where a file that's a target
-        # in one build (SConstruct file) is a source in a different build.
-        # See test/chained-build.py for the use case.
-        if do_store_info:
-            self.dir.sconsign().store_info(self.name, self)
-
     convert_copy_attrs = [
         'bsources',
         'bimplicit',
@@ -2616,8 +2843,7 @@ class File(Base):
             delattr(old_entry, attr)
         return new_entry
 
-    memoizer_counters.append(SCons.Memoize.CountValue('get_stored_info'))
-
+    @SCons.Memoize.CountMethodCall
     def get_stored_info(self):
         try:
             return self._memo['get_stored_info']
@@ -2657,8 +2883,7 @@ class File(Base):
     def _get_found_includes_key(self, env, scanner, path):
         return (id(env), id(scanner), path)
 
-    memoizer_counters.append(SCons.Memoize.CountDict('get_found_includes', _get_found_includes_key))
-
+    @SCons.Memoize.CountDictCall(_get_found_includes_key)
     def get_found_includes(self, env, scanner, path):
         """Return the included implicit dependencies in this file.
         Cache results so we only scan the file once per path
@@ -2724,7 +2949,7 @@ class File(Base):
         return self.get_build_env().get_CacheDir().retrieve(self)
 
     def visited(self):
-        if self.exists():
+        if self.exists() and self.executor is not None:
             self.get_build_env().get_CacheDir().push_if_forced(self)
 
         ninfo = self.get_ninfo()
@@ -2742,9 +2967,61 @@ class File(Base):
             # any build information that's stored in the .sconsign file
             # into our binfo object so it doesn't get lost.
             old = self.get_stored_info()
-            self.get_binfo().__dict__.update(old.binfo.__dict__)
-
-        self.store_info()
+            self.get_binfo().merge(old.binfo)
+
+        SCons.Node.store_info_map[self.store_info](self)
+
+    def release_target_info(self):
+        """Called just after this node has been marked
+         up-to-date or was built completely.
+         
+         This is where we try to release as many target node infos
+         as possible for clean builds and update runs, in order
+         to minimize the overall memory consumption.
+         
+         We'd like to remove a lot more attributes like self.sources
+         and self.sources_set, but they might get used
+         in a next build step. For example, during configuration
+         the source files for a built *.o file are used to figure out
+         which linker to use for the resulting Program (gcc vs. g++)!
+         That's why we check for the 'keep_targetinfo' attribute,
+         config Nodes and the Interactive mode just don't allow
+         an early release of most variables. 
+
+         In the same manner, we can't simply remove the self.attributes
+         here. The smart linking relies on the shared flag, and some
+         parts of the java Tool use it to transport information
+         about nodes...
+         
+         @see: built() and Node.release_target_info()
+         """
+        if (self.released_target_info or SCons.Node.interactive):
+            return
+        
+        if not hasattr(self.attributes, 'keep_targetinfo'):
+            # Cache some required values, before releasing
+            # stuff like env, executor and builder...
+            self.changed(allowcache=True)
+            self.get_contents_sig()
+            self.get_build_env()
+            # Now purge unneeded stuff to free memory...
+            self.executor = None
+            self._memo.pop('rfile', None)
+            self.prerequisites = None
+            # Cleanup lists, but only if they're empty
+            if not len(self.ignore_set):
+                self.ignore_set = None
+            if not len(self.implicit_set):
+                self.implicit_set = None
+            if not len(self.depends_set):
+                self.depends_set = None
+            if not len(self.ignore):
+                self.ignore = None
+            if not len(self.depends):
+                self.depends = None
+            # Mark this node as done, we only have to release
+            # the memory once...
+            self.released_target_info = True
 
     def find_src_builder(self):
         if self.rexists():
@@ -2792,7 +3069,7 @@ class File(Base):
 
     def _rmv_existing(self):
         self.clear_memoized_values()
-        if print_duplicate:
+        if SCons.Node.print_duplicate:
             print "dup: removing existing target %s"%self
         e = Unlink(self, [], None)
         if isinstance(e, SCons.Errors.BuildError):
@@ -2828,18 +3105,18 @@ class File(Base):
     def remove(self):
         """Remove this file."""
         if self.exists() or self.islink():
-            self.fs.unlink(self.path)
+            self.fs.unlink(self.get_internal_path())
             return 1
         return None
 
     def do_duplicate(self, src):
         self._createDir()
-        if print_duplicate:
+        if SCons.Node.print_duplicate:
             print "dup: relinking variant '%s' from '%s'"%(self, src)
         Unlink(self, None, None)
         e = Link(self, src, None)
         if isinstance(e, SCons.Errors.BuildError):
-            desc = "Cannot duplicate `%s' in `%s': %s." % (src.path, self.dir.path, e.errstr)
+            desc = "Cannot duplicate `%s' in `%s': %s." % (src.get_internal_path(), self.dir._path, e.errstr)
             raise SCons.Errors.StopError(desc)
         self.linked = 1
         # The Link() action may or may not have actually
@@ -2848,36 +3125,14 @@ class File(Base):
         # _rexists attributes so they can be reevaluated.
         self.clear()
 
-    memoizer_counters.append(SCons.Memoize.CountValue('exists'))
-
+    @SCons.Memoize.CountMethodCall
     def exists(self):
         try:
             return self._memo['exists']
         except KeyError:
             pass
-        # Duplicate from source path if we are set up to do this.
-        if self.duplicate and not self.is_derived() and not self.linked:
-            src = self.srcnode()
-            if src is not self:
-                # At this point, src is meant to be copied in a variant directory.
-                src = src.rfile()
-                if src.abspath != self.abspath:
-                    if src.exists():
-                        self.do_duplicate(src)
-                        # Can't return 1 here because the duplication might
-                        # not actually occur if the -n option is being used.
-                    else:
-                        # The source file does not exist.  Make sure no old
-                        # copy remains in the variant directory.
-                        if print_duplicate:
-                            print "dup: no src for %s, unlinking old variant copy"%self
-                        if Base.exists(self) or self.islink():
-                            self.fs.unlink(self.path)
-                        # Return None explicitly because the Base.exists() call
-                        # above will have cached its value if the file existed.
-                        self._memo['exists'] = None
-                        return None
-        result = Base.exists(self)
+        
+        result = SCons.Node._exists_map[self._func_exists](self)
         self._memo['exists'] = result
         return result
 
@@ -2954,7 +3209,53 @@ class File(Base):
 
     def builder_set(self, builder):
         SCons.Node.Node.builder_set(self, builder)
-        self.changed_since_last_build = self.decide_target
+        self.changed_since_last_build = 5
+
+    def built(self):
+        """Called just after this File node is successfully built.
+        
+         Just like for 'release_target_info' we try to release
+         some more target node attributes in order to minimize the
+         overall memory consumption.
+         
+         @see: release_target_info
+        """
+
+        SCons.Node.Node.built(self)
+
+        if (not SCons.Node.interactive and 
+            not hasattr(self.attributes, 'keep_targetinfo')):
+            # Ensure that the build infos get computed and cached...        
+            SCons.Node.store_info_map[self.store_info](self)
+            # ... then release some more variables.
+            self._specific_sources = False
+            self._labspath = None
+            self._save_str()
+            self.cwd = None
+             
+            self.scanner_paths = None
+
+    def changed(self, node=None, allowcache=False):
+        """
+        Returns if the node is up-to-date with respect to the BuildInfo
+        stored last time it was built. 
+        
+        For File nodes this is basically a wrapper around Node.changed(),
+        but we allow the return value to get cached after the reference
+        to the Executor got released in release_target_info().
+        
+        @see: Node.changed()
+        """
+        if node is None:
+            try:
+                return self._memo['changed']
+            except KeyError:
+                pass
+        
+        has_changed = SCons.Node.Node.changed(self, node)
+        if allowcache:
+            self._memo['changed'] = has_changed
+        return has_changed
 
     def changed_content(self, target, prev_ni):
         cur_csig = self.get_csig()
@@ -2987,16 +3288,6 @@ class File(Base):
         except AttributeError:
             return 1
 
-    def decide_source(self, target, prev_ni):
-        return target.get_build_env().decide_source(self, target, prev_ni)
-
-    def decide_target(self, target, prev_ni):
-        return target.get_build_env().decide_target(self, target, prev_ni)
-
-    # Initialize this Node's decider function to decide_source() because
-    # every file is a source file until it has a Builder attached...
-    changed_since_last_build = decide_source
-
     def is_up_to_date(self):
         T = 0
         if T: Trace('is_up_to_date(%s):' % self)
@@ -3014,7 +3305,7 @@ class File(Base):
                         e = LocalCopy(self, r, None)
                         if isinstance(e, SCons.Errors.BuildError):
                             raise 
-                        self.store_info()
+                        SCons.Node.store_info_map[self.store_info](self)
                     if T: Trace(' 1\n')
                     return 1
             self.changed()
@@ -3025,8 +3316,7 @@ class File(Base):
             if T: Trace(' self.exists():  %s\n' % r)
             return not r
 
-    memoizer_counters.append(SCons.Memoize.CountValue('rfile'))
-
+    @SCons.Memoize.CountMethodCall
     def rfile(self):
         try:
             return self._memo['rfile']
@@ -3089,25 +3379,50 @@ class File(Base):
             self.cachedir_csig = self.get_csig()
         return self.cachedir_csig
 
+    def get_contents_sig(self):
+        """
+        A helper method for get_cachedir_bsig.
+
+        It computes and returns the signature for this
+        node's contents.
+        """
+        
+        try:
+            return self.contentsig
+        except AttributeError:
+            pass
+        
+        executor = self.get_executor()
+
+        result = self.contentsig = SCons.Util.MD5signature(executor.get_contents())
+        return result
+
     def get_cachedir_bsig(self):
+        """
+        Return the signature for a cached file, including
+        its children.
+
+        It adds the path of the cached file to the cache signature,
+        because multiple targets built by the same action will all
+        have the same build signature, and we have to differentiate
+        them somehow.
+        """
         try:
             return self.cachesig
         except AttributeError:
             pass
-
-        # Add the path to the cache signature, because multiple
-        # targets built by the same action will all have the same
-        # build signature, and we have to differentiate them somehow.
+        
+        # Collect signatures for all children
         children = self.children()
-        executor = self.get_executor()
-        # sigs = [n.get_cachedir_csig() for n in children]
         sigs = [n.get_cachedir_csig() for n in children]
-        sigs.append(SCons.Util.MD5signature(executor.get_contents()))
-        sigs.append(self.path)
+        # Append this node's signature...
+        sigs.append(self.get_contents_sig())
+        # ...and it's path
+        sigs.append(self.get_internal_path())
+        # Merge this all into a single signature
         result = self.cachesig = SCons.Util.MD5collect(sigs)
         return result
 
-
 default_fs = None
 
 def get_default_fs():
@@ -3119,10 +3434,6 @@ def get_default_fs():
 class FileFinder(object):
     """
     """
-    if SCons.Memoize.use_memoizer:
-        __metaclass__ = SCons.Memoize.Memoized_Metaclass
-
-    memoizer_counters = []
 
     def __init__(self):
         self._memo = {}
@@ -3165,8 +3476,7 @@ class FileFinder(object):
     def _find_file_key(self, filename, paths, verbose=None):
         return (filename, paths)
         
-    memoizer_counters.append(SCons.Memoize.CountDict('find_file', _find_file_key))
-
+    @SCons.Memoize.CountDictCall(_find_file_key)
     def find_file(self, filename, paths, verbose=None):
         """
         find_file(str, [Dir()]) -> [nodes]
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Node/Python.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Node/Python.py
similarity index 73%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Node/Python.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Node/Python.py
index 5c302e6f750a4c0bd007ebe9c0fbe81512a782d5..b247ff6f75ee633e000dc6c1bb7f1a3c314c51ac 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Node/Python.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Node/Python.py
@@ -5,7 +5,7 @@ Python nodes.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -27,20 +27,54 @@ Python nodes.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Node/Python.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Node/Python.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import SCons.Node
 
 class ValueNodeInfo(SCons.Node.NodeInfoBase):
-    current_version_id = 1
+    __slots__ = ('csig',)
+    current_version_id = 2
 
     field_list = ['csig']
 
     def str_to_node(self, s):
         return Value(s)
 
+    def __getstate__(self):
+        """
+        Return all fields that shall be pickled. Walk the slots in the class
+        hierarchy and add those to the state dictionary. If a '__dict__' slot is
+        available, copy all entries to the dictionary. Also include the version
+        id, which is fixed for all instances of a class.
+        """
+        state = getattr(self, '__dict__', {}).copy()
+        for obj in type(self).mro():
+            for name in getattr(obj,'__slots__',()):
+                if hasattr(self, name):
+                    state[name] = getattr(self, name)
+
+        state['_version_id'] = self.current_version_id
+        try:
+            del state['__weakref__']
+        except KeyError:
+            pass
+        
+        return state
+
+    def __setstate__(self, state):
+        """
+        Restore the attributes from a pickled state.
+        """
+        # TODO check or discard version
+        del state['_version_id']
+        for key, value in state.items():
+            if key not in ('__weakref__',):
+                setattr(self, key, value)
+
+
 class ValueBuildInfo(SCons.Node.BuildInfoBase):
-    current_version_id = 1
+    __slots__ = ()
+    current_version_id = 2
 
 class Value(SCons.Node.Node):
     """A class for Python variables, typically passed on the command line 
@@ -53,6 +87,8 @@ class Value(SCons.Node.Node):
     def __init__(self, value, built_value=None):
         SCons.Node.Node.__init__(self)
         self.value = value
+        self.changed_since_last_build = 6
+        self.store_info = 0
         if built_value is not None:
             self.built_value = built_value
 
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Node/__init__.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Node/__init__.py
similarity index 71%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Node/__init__.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Node/__init__.py
index 126d83c09a415280a1b4b782cc93b0615ee7e8d5..79db894cf87aa7892a5acb812e099d43f532fdb7 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Node/__init__.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Node/__init__.py
@@ -20,7 +20,7 @@ be able to depend on any other type of "thing."
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -41,12 +41,13 @@ be able to depend on any other type of "thing."
 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
-__revision__ = "src/engine/SCons/Node/__init__.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Node/__init__.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import collections
 import copy
 from itertools import chain
 
+import SCons.Debug
 from SCons.Debug import logInstanceCreation
 import SCons.Executor
 import SCons.Memoize
@@ -54,9 +55,15 @@ import SCons.Util
 
 from SCons.Debug import Trace
 
+print_duplicate = 0
+
 def classname(obj):
     return str(obj.__class__).split('.')[-1]
 
+# Set to false if we're doing a dry run. There's more than one of these
+# little treats
+do_store_info = True
+
 # Node states
 #
 # These are in "priority" order, so that the maximum value for any
@@ -95,6 +102,238 @@ def do_nothing(node): pass
 
 Annotate = do_nothing
 
+# Gets set to 'True' if we're running in interactive mode. Is
+# currently used to release parts of a target's info during
+# clean builds and update runs (see release_target_info).
+interactive = False
+
+def is_derived_none(node):
+    raise NotImplementedError
+
+def is_derived_node(node):
+    """
+        Returns true if this node is derived (i.e. built).
+    """
+    return node.has_builder() or node.side_effect
+
+_is_derived_map = {0 : is_derived_none,
+                   1 : is_derived_node}
+
+def exists_none(node):
+    raise NotImplementedError
+
+def exists_always(node):
+    return 1
+
+def exists_base(node):
+    return node.stat() is not None
+
+def exists_entry(node):
+    """Return if the Entry exists.  Check the file system to see
+    what we should turn into first.  Assume a file if there's no
+    directory."""
+    node.disambiguate()
+    return _exists_map[node._func_exists](node)
+
+def exists_file(node):
+    # Duplicate from source path if we are set up to do this.
+    if node.duplicate and not node.is_derived() and not node.linked:
+        src = node.srcnode()
+        if src is not node:
+            # At this point, src is meant to be copied in a variant directory.
+            src = src.rfile()
+            if src.get_abspath() != node.get_abspath():
+                if src.exists():
+                    node.do_duplicate(src)
+                    # Can't return 1 here because the duplication might
+                    # not actually occur if the -n option is being used.
+                else:
+                    # The source file does not exist.  Make sure no old
+                    # copy remains in the variant directory.
+                    if print_duplicate:
+                        print "dup: no src for %s, unlinking old variant copy"%self
+                    if exists_base(node) or node.islink():
+                        node.fs.unlink(node.get_internal_path())
+                    # Return None explicitly because the Base.exists() call
+                    # above will have cached its value if the file existed.
+                    return None
+    return exists_base(node)
+
+_exists_map = {0 : exists_none,
+               1 : exists_always,
+               2 : exists_base,
+               3 : exists_entry,
+               4 : exists_file}
+
+
+def rexists_none(node):
+    raise NotImplementedError
+
+def rexists_node(node):
+    return node.exists()
+
+def rexists_base(node):
+    return node.rfile().exists()
+
+_rexists_map = {0 : rexists_none,
+                1 : rexists_node,
+                2 : rexists_base}
+
+def get_contents_none(node):
+    raise NotImplementedError
+
+def get_contents_entry(node):
+    """Fetch the contents of the entry.  Returns the exact binary
+    contents of the file."""
+    try:
+        node = node.disambiguate(must_exist=1)
+    except SCons.Errors.UserError:
+        # There was nothing on disk with which to disambiguate
+        # this entry.  Leave it as an Entry, but return a null
+        # string so calls to get_contents() in emitters and the
+        # like (e.g. in qt.py) don't have to disambiguate by hand
+        # or catch the exception.
+        return ''
+    else:
+        return _get_contents_map[node._func_get_contents](node)
+
+def get_contents_dir(node):
+    """Return content signatures and names of all our children
+    separated by new-lines. Ensure that the nodes are sorted."""
+    contents = []
+    for n in sorted(node.children(), key=lambda t: t.name):
+        contents.append('%s %s\n' % (n.get_csig(), n.name))
+    return ''.join(contents)
+
+def get_contents_file(node):    
+    if not node.rexists():
+        return ''
+    fname = node.rfile().get_abspath()
+    try:
+        contents = open(fname, "rb").read()
+    except EnvironmentError, e:
+        if not e.filename:
+            e.filename = fname
+        raise
+    return contents
+
+_get_contents_map = {0 : get_contents_none,
+                     1 : get_contents_entry,
+                     2 : get_contents_dir,
+                     3 : get_contents_file}
+
+def target_from_source_none(node, prefix, suffix, splitext):
+    raise NotImplementedError
+
+def target_from_source_base(node, prefix, suffix, splitext):
+    return node.dir.Entry(prefix + splitext(node.name)[0] + suffix)
+
+_target_from_source_map = {0 : target_from_source_none,
+                           1 : target_from_source_base}
+
+#
+# The new decider subsystem for Nodes
+#
+# We would set and overwrite the changed_since_last_build function
+# before, but for being able to use slots (less memory!) we now have
+# a dictionary of the different decider functions. Then in the Node
+# subclasses we simply store the index to the decider that should be
+# used by it.
+#
+
+#
+# First, the single decider functions
+#
+def changed_since_last_build_node(node, target, prev_ni):
+    """
+
+    Must be overridden in a specific subclass to return True if this
+    Node (a dependency) has changed since the last time it was used
+    to build the specified target.  prev_ni is this Node's state (for
+    example, its file timestamp, length, maybe content signature)
+    as of the last time the target was built.
+
+    Note that this method is called through the dependency, not the
+    target, because a dependency Node must be able to use its own
+    logic to decide if it changed.  For example, File Nodes need to
+    obey if we're configured to use timestamps, but Python Value Nodes
+    never use timestamps and always use the content.  If this method
+    were called through the target, then each Node's implementation
+    of this method would have to have more complicated logic to
+    handle all the different Node types on which it might depend.
+    """
+    raise NotImplementedError
+
+def changed_since_last_build_alias(node, target, prev_ni):
+    cur_csig = node.get_csig()
+    try:
+        return cur_csig != prev_ni.csig
+    except AttributeError:
+        return 1
+
+def changed_since_last_build_entry(node, target, prev_ni):
+    node.disambiguate()
+    return _decider_map[node.changed_since_last_build](node, target, prev_ni)
+
+def changed_since_last_build_state_changed(node, target, prev_ni):
+    return (node.state != SCons.Node.up_to_date)
+
+def decide_source(node, target, prev_ni):
+    return target.get_build_env().decide_source(node, target, prev_ni)
+
+def decide_target(node, target, prev_ni):
+    return target.get_build_env().decide_target(node, target, prev_ni)
+
+def changed_since_last_build_python(node, target, prev_ni):
+    cur_csig = node.get_csig()
+    try:
+        return cur_csig != prev_ni.csig
+    except AttributeError:
+        return 1
+
+
+#
+# Now, the mapping from indices to decider functions
+#
+_decider_map = {0 : changed_since_last_build_node,
+               1 : changed_since_last_build_alias,
+               2 : changed_since_last_build_entry,
+               3 : changed_since_last_build_state_changed,
+               4 : decide_source,
+               5 : decide_target,
+               6 : changed_since_last_build_python}
+
+do_store_info = True
+
+#
+# The new store_info subsystem for Nodes
+#
+# We would set and overwrite the store_info function
+# before, but for being able to use slots (less memory!) we now have
+# a dictionary of the different functions. Then in the Node
+# subclasses we simply store the index to the info method that should be
+# used by it.
+#
+
+#
+# First, the single info functions
+#
+
+def store_info_pass(node):
+    pass
+
+def store_info_file(node):
+    # Merge our build information into the already-stored entry.
+    # This accommodates "chained builds" where a file that's a target
+    # in one build (SConstruct file) is a source in a different build.
+    # See test/chained-build.py for the use case.
+    if do_store_info:
+        node.dir.sconsign().store_info(node.name, node)
+
+
+store_info_map = {0 : store_info_pass,
+                  1 : store_info_file}
+
 # Classes for signature info for Nodes.
 
 class NodeInfoBase(object):
@@ -104,11 +343,8 @@ class NodeInfoBase(object):
     Node subclasses should subclass NodeInfoBase to provide their own
     logic for dealing with their own Node-specific signature information.
     """
-    current_version_id = 1
-    def __init__(self, node=None):
-        # Create an object attribute from the class attribute so it ends up
-        # in the pickled data in the .sconsign file.
-        self._version_id = self.current_version_id
+    __slots__ = ('__weakref__',)
+    current_version_id = 2
     def update(self, node):
         try:
             field_list = self.field_list
@@ -128,13 +364,25 @@ class NodeInfoBase(object):
     def convert(self, node, val):
         pass
     def merge(self, other):
-        self.__dict__.update(other.__dict__)
+        """
+        Merge the fields of another object into this object. Already existing
+        information is overwritten by the other instance's data.
+        WARNING: If a '__dict__' slot is added, it should be updated instead of
+        replaced.
+        """
+        state = other.__getstate__()
+        self.__setstate__(state)
     def format(self, field_list=None, names=0):
         if field_list is None:
             try:
                 field_list = self.field_list
             except AttributeError:
-                field_list = sorted(self.__dict__.keys())
+                field_list = getattr(self, '__dict__', {}).keys()
+                for obj in type(self).mro():
+                    for slot in getattr(obj, '__slots__', ()):
+                        if slot not in ('__weakref__', '__dict__'):
+                            field_list.append(slot)
+                field_list.sort()
         fields = []
         for field in field_list:
             try:
@@ -147,6 +395,38 @@ class NodeInfoBase(object):
             fields.append(f)
         return fields
 
+    def __getstate__(self):
+        """
+        Return all fields that shall be pickled. Walk the slots in the class
+        hierarchy and add those to the state dictionary. If a '__dict__' slot is
+        available, copy all entries to the dictionary. Also include the version
+        id, which is fixed for all instances of a class.
+        """
+        state = getattr(self, '__dict__', {}).copy()
+        for obj in type(self).mro():
+            for name in getattr(obj,'__slots__',()):
+                if hasattr(self, name):
+                    state[name] = getattr(self, name)
+    
+        state['_version_id'] = self.current_version_id
+        try:
+            del state['__weakref__']
+        except KeyError:
+            pass
+        return state
+    
+    def __setstate__(self, state):
+        """
+        Restore the attributes from a pickled state. The version is discarded.
+        """
+        # TODO check or discard version
+        del state['_version_id']
+    
+        for key, value in state.items():
+            if key not in ('__weakref__',):
+                setattr(self, key, value)
+
+
 class BuildInfoBase(object):
     """
     The generic base class for build information for a Node.
@@ -157,33 +437,109 @@ class BuildInfoBase(object):
     generic build stuff we have to track:  sources, explicit dependencies,
     implicit dependencies, and action information.
     """
-    current_version_id = 1
-    def __init__(self, node=None):
+    __slots__ = ("bsourcesigs", "bdependsigs", "bimplicitsigs", "bactsig",
+                 "bsources", "bdepends", "bact", "bimplicit", "__weakref__")
+    current_version_id = 2
+    def __init__(self):
         # Create an object attribute from the class attribute so it ends up
         # in the pickled data in the .sconsign file.
-        self._version_id = self.current_version_id
         self.bsourcesigs = []
         self.bdependsigs = []
         self.bimplicitsigs = []
         self.bactsig = None
     def merge(self, other):
-        self.__dict__.update(other.__dict__)
+        """
+        Merge the fields of another object into this object. Already existing
+        information is overwritten by the other instance's data.
+        WARNING: If a '__dict__' slot is added, it should be updated instead of
+        replaced.
+        """
+        state = other.__getstate__()
+        self.__setstate__(state)
+ 
+    def __getstate__(self):
+        """
+        Return all fields that shall be pickled. Walk the slots in the class
+        hierarchy and add those to the state dictionary. If a '__dict__' slot is
+        available, copy all entries to the dictionary. Also include the version
+        id, which is fixed for all instances of a class.
+        """
+        state = getattr(self, '__dict__', {}).copy()
+        for obj in type(self).mro():
+            for name in getattr(obj,'__slots__',()):
+                if hasattr(self, name):
+                    state[name] = getattr(self, name)
+
+        state['_version_id'] = self.current_version_id
+        try:
+            del state['__weakref__']
+        except KeyError:
+            pass
+        return state
+
+    def __setstate__(self, state):
+        """
+        Restore the attributes from a pickled state.
+        """
+        # TODO check or discard version
+        del state['_version_id']
+        for key, value in state.items():
+            if key not in ('__weakref__',):
+                setattr(self, key, value)
 
 class Node(object):
     """The base Node class, for entities that we know how to
     build, or use to build other Nodes.
     """
 
-    if SCons.Memoize.use_memoizer:
-        __metaclass__ = SCons.Memoize.Memoized_Metaclass
-
-    memoizer_counters = []
+    __slots__ = ['sources',
+                 'sources_set',
+                 '_specific_sources',
+                 'depends',
+                 'depends_set',
+                 'ignore',
+                 'ignore_set',
+                 'prerequisites',
+                 'implicit',
+                 'waiting_parents',
+                 'waiting_s_e',
+                 'ref_count',
+                 'wkids',
+                 'env',
+                 'state',
+                 'precious',
+                 'noclean',
+                 'nocache',
+                 'cached',
+                 'always_build',
+                 'includes',
+                 'attributes',
+                 'side_effect',
+                 'side_effects',
+                 'linked',
+                 '_memo',
+                 'executor',
+                 'binfo',
+                 'ninfo',
+                 'builder',
+                 'is_explicit',
+                 'implicit_set',
+                 'changed_since_last_build',
+                 'store_info',
+                 'pseudo',
+                 '_tags',
+                 '_func_is_derived',
+                 '_func_exists',
+                 '_func_rexists',
+                 '_func_get_contents',
+                 '_func_target_from_source']
 
     class Attrs(object):
-        pass
+        __slots__ = ('shared', '__dict__')
+ 
 
     def __init__(self):
-        if __debug__: logInstanceCreation(self, 'Node.Node')
+        if SCons.Debug.track_instances: logInstanceCreation(self, 'Node.Node')
         # Note that we no longer explicitly initialize a self.builder
         # attribute to None here.  That's because the self.builder
         # attribute may be created on-the-fly later by a subclass (the
@@ -204,7 +560,7 @@ class Node(object):
         self.depends_set = set()
         self.ignore = []        # dependencies to ignore
         self.ignore_set = set()
-        self.prerequisites = SCons.Util.UniqueList()
+        self.prerequisites = None
         self.implicit = None    # implicit (scanned) dependencies (None means not scanned yet)
         self.waiting_parents = set()
         self.waiting_s_e = set()
@@ -214,6 +570,7 @@ class Node(object):
         self.env = None
         self.state = no_state
         self.precious = None
+        self.pseudo = False
         self.noclean = 0
         self.nocache = 0
         self.cached = 0 # is this node pulled from cache?
@@ -223,7 +580,15 @@ class Node(object):
         self.side_effect = 0 # true iff this node is a side effect
         self.side_effects = [] # the side effects of building this target
         self.linked = 0 # is this node linked to the variant directory?
-
+        self.changed_since_last_build = 0
+        self.store_info = 0
+        self._tags = None
+        self._func_is_derived = 1
+        self._func_exists = 1
+        self._func_rexists = 1
+        self._func_get_contents = 0
+        self._func_target_from_source = 0
+        
         self.clear_memoized_values()
 
         # Let the interface in which the build engine is embedded
@@ -237,8 +602,7 @@ class Node(object):
     def get_suffix(self):
         return ''
 
-    memoizer_counters.append(SCons.Memoize.CountValue('get_build_env'))
-
+    @SCons.Memoize.CountMethodCall
     def get_build_env(self):
         """Fetch the appropriate Environment to build this node.
         """
@@ -286,7 +650,8 @@ class Node(object):
         except AttributeError:
             pass
         else:
-            executor.cleanup()
+            if executor is not None:
+                executor.cleanup()
 
     def reset_executor(self):
         "Remove cached executor; forces recompute when needed."
@@ -346,10 +711,11 @@ class Node(object):
         methods should call this base class method to get the child
         check and the BuildInfo structure.
         """
-        for d in self.depends:
-            if d.missing():
-                msg = "Explicit dependency `%s' not found, needed by target `%s'."
-                raise SCons.Errors.StopError(msg % (d, self))
+        if self.depends is not None:
+            for d in self.depends:
+                if d.missing():
+                    msg = "Explicit dependency `%s' not found, needed by target `%s'."
+                    raise SCons.Errors.StopError(msg % (d, self))
         if self.implicit is not None:
             for i in self.implicit:
                 if i.missing():
@@ -385,6 +751,13 @@ class Node(object):
 
         self.clear()
 
+        if self.pseudo:
+            if self.exists():
+                raise SCons.Errors.UserError("Pseudo target " + str(self) + " must not exist")
+        else:
+            if not self.exists() and do_store_info:
+                SCons.Warnings.warn(SCons.Warnings.TargetNotBuiltWarning,
+                                    "Cannot find target " + str(self) + " after building")
         self.ninfo.update(self)
 
     def visited(self):
@@ -398,7 +771,24 @@ class Node(object):
             pass
         else:
             self.ninfo.update(self)
-            self.store_info()
+            SCons.Node.store_info_map[self.store_info](self)
+
+    def release_target_info(self):
+        """Called just after this node has been marked
+         up-to-date or was built completely.
+         
+         This is where we try to release as many target node infos
+         as possible for clean builds and update runs, in order
+         to minimize the overall memory consumption.
+         
+         By purging attributes that aren't needed any longer after
+         a Node (=File) got built, we don't have to care that much how
+         many KBytes a Node actually requires...as long as we free
+         the memory shortly afterwards.
+         
+         @see: built() and File.release_target_info()
+         """
+        pass
 
     #
     #
@@ -501,7 +891,7 @@ class Node(object):
 
     def is_derived(self):
         """
-        Returns true iff this node is derived (i.e. built).
+        Returns true if this node is derived (i.e. built).
 
         This should return true only for nodes whose path should be in
         the variant directory when duplicate=0 and should contribute their build
@@ -509,7 +899,7 @@ class Node(object):
         example: source with source builders are not derived in this sense,
         and hence should not return true.
         """
-        return self.has_builder() or self.side_effect
+        return _is_derived_map[self._func_is_derived](self)
 
     def alter_targets(self):
         """Return a list of alternate targets for this Node.
@@ -669,7 +1059,7 @@ class Node(object):
     BuildInfo = BuildInfoBase
 
     def new_ninfo(self):
-        ninfo = self.NodeInfo(self)
+        ninfo = self.NodeInfo()
         return ninfo
 
     def get_ninfo(self):
@@ -680,7 +1070,7 @@ class Node(object):
             return self.ninfo
 
     def new_binfo(self):
-        binfo = self.BuildInfo(self)
+        binfo = self.BuildInfo()
         return binfo
 
     def get_binfo(self):
@@ -765,14 +1155,6 @@ class Node(object):
     def get_cachedir_csig(self):
         return self.get_csig()
 
-    def store_info(self):
-        """Make the build signature permanent (that is, store it in the
-        .sconsign file or equivalent)."""
-        pass
-
-    def do_not_store_info(self):
-        pass
-
     def get_stored_info(self):
         return None
 
@@ -788,6 +1170,10 @@ class Node(object):
         """Set the Node's precious value."""
         self.precious = precious
 
+    def set_pseudo(self, pseudo = True):
+        """Set the Node's precious value."""
+        self.pseudo = pseudo
+
     def set_noclean(self, noclean = 1):
         """Set the Node's noclean value."""
         # Make sure noclean is an integer so the --debug=stree
@@ -806,13 +1192,16 @@ class Node(object):
 
     def exists(self):
         """Does this node exists?"""
-        # All node exist by default:
-        return 1
+        return _exists_map[self._func_exists](self)
 
     def rexists(self):
         """Does this node exist locally or in a repositiory?"""
         # There are no repositories by default:
-        return self.exists()
+        return _rexists_map[self._func_rexists](self)
+
+    def get_contents(self):
+        """Fetch the contents of the entry."""
+        return _get_contents_map[self._func_get_contents](self)
 
     def missing(self):
         return not self.is_derived() and \
@@ -837,6 +1226,8 @@ class Node(object):
 
     def add_prerequisite(self, prerequisite):
         """Adds prerequisites"""
+        if self.prerequisites is None:
+            self.prerequisites = SCons.Util.UniqueList()
         self.prerequisites.extend(prerequisite)
         self._children_reset()
 
@@ -898,11 +1289,10 @@ class Node(object):
         # build info that it's cached so we can re-calculate it.
         self.executor_cleanup()
 
-    memoizer_counters.append(SCons.Memoize.CountValue('_children_get'))
-
+    @SCons.Memoize.CountMethodCall
     def _children_get(self):
         try:
-            return self._memo['children_get']
+            return self._memo['_children_get']
         except KeyError:
             pass
 
@@ -924,22 +1314,16 @@ class Node(object):
         # dictionary patterns I found all ended up using "not in"
         # internally anyway...)
         if self.ignore_set:
-            if self.implicit is None:
-                iter = chain(self.sources,self.depends)
-            else:
-                iter = chain(self.sources, self.depends, self.implicit)
+            iter = chain.from_iterable(filter(None, [self.sources, self.depends, self.implicit]))
 
             children = []
             for i in iter:
                 if i not in self.ignore_set:
                     children.append(i)
         else:
-            if self.implicit is None:
-                children = self.sources + self.depends
-            else:
-                children = self.sources + self.depends + self.implicit
+            children = self.all_children(scan=0)
 
-        self._memo['children_get'] = children
+        self._memo['_children_get'] = children
         return children
 
     def all_children(self, scan=1):
@@ -964,10 +1348,7 @@ class Node(object):
         # using dictionary keys, lose the order, and the only ordered
         # dictionary patterns I found all ended up using "not in"
         # internally anyway...)
-        if self.implicit is None:
-            return self.sources + self.depends
-        else:
-            return self.sources + self.depends + self.implicit
+        return list(chain.from_iterable(filter(None, [self.sources, self.depends, self.implicit])))
 
     def children(self, scan=1):
         """Return a list of the node's direct children, minus those
@@ -982,9 +1363,6 @@ class Node(object):
     def get_state(self):
         return self.state
 
-    def state_has_changed(self, target, prev_ni):
-        return (self.state != SCons.Node.up_to_date)
-
     def get_env(self):
         env = self.env
         if not env:
@@ -992,30 +1370,30 @@ class Node(object):
             env = SCons.Defaults.DefaultEnvironment()
         return env
 
-    def changed_since_last_build(self, target, prev_ni):
-        """
-
-        Must be overridden in a specific subclass to return True if this
-        Node (a dependency) has changed since the last time it was used
-        to build the specified target.  prev_ni is this Node's state (for
-        example, its file timestamp, length, maybe content signature)
-        as of the last time the target was built.
-
-        Note that this method is called through the dependency, not the
-        target, because a dependency Node must be able to use its own
-        logic to decide if it changed.  For example, File Nodes need to
-        obey if we're configured to use timestamps, but Python Value Nodes
-        never use timestamps and always use the content.  If this method
-        were called through the target, then each Node's implementation
-        of this method would have to have more complicated logic to
-        handle all the different Node types on which it might depend.
-        """
-        raise NotImplementedError
-
     def Decider(self, function):
-        SCons.Util.AddMethod(self, function, 'changed_since_last_build')
+        foundkey = None
+        for k, v in _decider_map.iteritems():
+            if v == function:
+                foundkey = k
+                break
+        if not foundkey:
+            foundkey = len(_decider_map)
+            _decider_map[foundkey] = function
+        self.changed_since_last_build = foundkey
+
+    def Tag(self, key, value):
+        """ Add a user-defined tag. """
+        if not self._tags:
+            self._tags = {}
+        self._tags[key] = value
+
+    def GetTag(self, key):
+        """ Return a user-defined tag. """
+        if not self._tags:
+            return None
+        return self._tags.get(key, None)
 
-    def changed(self, node=None):
+    def changed(self, node=None, allowcache=False):
         """
         Returns if the node is up-to-date with respect to the BuildInfo
         stored last time it was built.  The default behavior is to compare
@@ -1028,6 +1406,15 @@ class Node(object):
         any difference, but we now rely on checking every dependency
         to make sure that any necessary Node information (for example,
         the content signature of an #included .h file) is updated.
+        
+        The allowcache option was added for supporting the early
+        release of the executor/builder structures, right after
+        a File target was built. When set to true, the return
+        value of this changed method gets cached for File nodes.
+        Like this, the executor isn't needed any longer for subsequent
+        calls to changed().
+        
+        @see: FS.File.changed(), FS.File.release_target_info()
         """
         t = 0
         if t: Trace('changed(%s [%s], %s)' % (self, classname(self), node))
@@ -1052,7 +1439,7 @@ class Node(object):
             result = True
 
         for child, prev_ni in zip(children, then):
-            if child.changed_since_last_build(self, prev_ni):
+            if _decider_map[child.changed_since_last_build](child, self, prev_ni):
                 if t: Trace(': %s changed' % child)
                 result = True
 
@@ -1103,17 +1490,18 @@ class Node(object):
         Return a text representation, suitable for displaying to the
         user, of the include tree for the sources of this node.
         """
-        if self.is_derived() and self.env:
+        if self.is_derived():
             env = self.get_build_env()
-            for s in self.sources:
-                scanner = self.get_source_scanner(s)
-                if scanner:
-                    path = self.get_build_scanner_path(scanner)
-                else:
-                    path = None
-                def f(node, env=env, scanner=scanner, path=path):
-                    return node.get_found_includes(env, scanner, path)
-                return SCons.Util.render_tree(s, f, 1)
+            if env:
+                for s in self.sources:
+                    scanner = self.get_source_scanner(s)
+                    if scanner:
+                        path = self.get_build_scanner_path(scanner)
+                    else:
+                        path = None
+                    def f(node, env=env, scanner=scanner, path=path):
+                        return node.get_found_includes(env, scanner, path)
+                    return SCons.Util.render_tree(s, f, 1)
         else:
             return None
 
@@ -1222,7 +1610,7 @@ class Node(object):
         for k in new_bkids:
             if not k in old_bkids:
                 lines.append("`%s' is a new dependency\n" % stringify(k))
-            elif k.changed_since_last_build(self, osig[k]):
+            elif _decider_map[k.changed_since_last_build](k, self, osig[k]):
                 lines.append("`%s' changed\n" % stringify(k))
 
         if len(lines) == 0 and old_bkids != new_bkids:
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Options/BoolOption.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Options/BoolOption.py
similarity index 89%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Options/BoolOption.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Options/BoolOption.py
index be2de6ce74e276ea8ec5bcbe96c878f362dec0d5..c8d901f53a9522a315390eb215decd1b7187c564 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Options/BoolOption.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Options/BoolOption.py
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -21,7 +21,7 @@
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Options/BoolOption.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Options/BoolOption.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 __doc__ = """Place-holder for the old SCons.Options module hierarchy
 
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Options/EnumOption.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Options/EnumOption.py
similarity index 89%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Options/EnumOption.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Options/EnumOption.py
index b7aa8530e23496fbd16c1ca56c97d49cd3d407b1..58b99ef8192973f7e4e4cec02911afaf21416d38 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Options/EnumOption.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Options/EnumOption.py
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -21,7 +21,7 @@
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Options/EnumOption.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Options/EnumOption.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 __doc__ = """Place-holder for the old SCons.Options module hierarchy
 
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Options/ListOption.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Options/ListOption.py
similarity index 89%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Options/ListOption.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Options/ListOption.py
index ba4c4a98a0ce7a75077148f934c207eefcdc400b..00c93d9453841898bbd1fa1092b247c80e2ad309 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Options/ListOption.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Options/ListOption.py
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -21,7 +21,7 @@
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Options/ListOption.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Options/ListOption.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 __doc__ = """Place-holder for the old SCons.Options module hierarchy
 
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Options/PackageOption.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Options/PackageOption.py
similarity index 89%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Options/PackageOption.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Options/PackageOption.py
index d65564077c9124e728cf0066f5c183a07d26c0bf..56624f0aabb6adcdab3e1eb62b380b049989557d 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Options/PackageOption.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Options/PackageOption.py
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -21,7 +21,7 @@
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Options/PackageOption.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Options/PackageOption.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 __doc__ = """Place-holder for the old SCons.Options module hierarchy
 
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Options/PathOption.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Options/PathOption.py
similarity index 92%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Options/PathOption.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Options/PathOption.py
index e7de97f89da6bb89c7b684d49050685ab3ade433..a4b81ecf58c95a1d17510597e2abfc8bdcf41ddb 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Options/PathOption.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Options/PathOption.py
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -21,7 +21,7 @@
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Options/PathOption.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Options/PathOption.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 __doc__ = """Place-holder for the old SCons.Options module hierarchy
 
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Options/__init__.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Options/__init__.py
similarity index 91%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Options/__init__.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Options/__init__.py
index 62edfa9005c5c53f126fe20889c0189f20c69889..50997120e24d2ae4f5d8fd91b5e95ceeb7ed9ae6 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Options/__init__.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Options/__init__.py
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -21,7 +21,7 @@
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Options/__init__.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Options/__init__.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 __doc__ = """Place-holder for the old SCons.Options module hierarchy
 
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/PathList.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/PathList.py
similarity index 93%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/PathList.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/PathList.py
index 9a4145331e721312cf615ccba71cc1f26192733c..b3591445c395d5f55183f9286fa6a81cf19d1d41 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/PathList.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/PathList.py
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -21,7 +21,7 @@
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/PathList.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/PathList.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 __doc__ = """SCons.PathList
 
@@ -131,12 +131,14 @@ class _PathList(object):
                 value = env.subst(value, target=target, source=source,
                                   conv=node_conv)
                 if SCons.Util.is_Sequence(value):
-                    result.extend(value)
-                    continue
-                    
+                    result.extend(SCons.Util.flatten(value))
+                elif value:
+                    result.append(value)
             elif type == TYPE_OBJECT:
                 value = node_conv(value)
-            if value:
+                if value:
+                    result.append(value)
+            elif value:
                 result.append(value)
         return tuple(result)
 
@@ -169,11 +171,6 @@ class PathListCache(object):
     cheaply avoid re-parsing both values of CPPPATH by using the
     common value from this cache.
     """
-    if SCons.Memoize.use_memoizer:
-        __metaclass__ = SCons.Memoize.Memoized_Metaclass
-
-    memoizer_counters = []
-
     def __init__(self):
         self._memo = {}
 
@@ -194,8 +191,7 @@ class PathListCache(object):
             pathlist = tuple(SCons.Util.flatten(pathlist))
         return pathlist
 
-    memoizer_counters.append(SCons.Memoize.CountDict('PathList', _PathList_key))
-
+    @SCons.Memoize.CountDictCall(_PathList_key)
     def PathList(self, pathlist):
         """
         Returns the cached _PathList object for the specified pathlist,
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Platform/__init__.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Platform/__init__.py
similarity index 84%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Platform/__init__.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Platform/__init__.py
index 2cab3c8653d052f39763b3dd149d9fef74a1288f..ca4bc9be9a87c26b1d66444e3c2678c37590be72 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Platform/__init__.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Platform/__init__.py
@@ -20,7 +20,7 @@ their own platform definition.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 # 
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -42,7 +42,7 @@ their own platform definition.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Platform/__init__.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Platform/__init__.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import SCons.compat
 
@@ -139,7 +139,7 @@ class TempFileMunge(object):
 
     Example usage:
     env["TEMPFILE"] = TempFileMunge
-    env["LINKCOM"] = "${TEMPFILE('$LINK $TARGET $SOURCES')}"
+    env["LINKCOM"] = "${TEMPFILE('$LINK $TARGET $SOURCES','$LINKCOMSTR')}"
 
     By default, the name of the temporary file used begins with a
     prefix of '@'.  This may be configred for other tool chains by
@@ -148,8 +148,9 @@ class TempFileMunge(object):
     env["TEMPFILEPREFIX"] = '-@'        # diab compiler
     env["TEMPFILEPREFIX"] = '-via'      # arm tool chain
     """
-    def __init__(self, cmd):
+    def __init__(self, cmd, cmdstr = None):
         self.cmd = cmd
+        self.cmdstr = cmdstr
 
     def __call__(self, target, source, env, for_signature):
         if for_signature:
@@ -173,9 +174,18 @@ class TempFileMunge(object):
         length = 0
         for c in cmd:
             length += len(c)
+        length += len(cmd) - 1
         if length <= maxline:
             return self.cmd
 
+        # Check if we already created the temporary file for this target
+        # It should have been previously done by Action.strfunction() call
+        node = target[0] if SCons.Util.is_List(target) else target
+        cmdlist = getattr(node.attributes, 'tempfile_cmdlist', None) \
+                    if node is not None else None
+        if cmdlist is not None : 
+            return cmdlist
+        
         # We do a normpath because mktemp() has what appears to be
         # a bug in Windows that will use a forward slash as a path
         # delimiter.  Windows's link mistakes that for a command line
@@ -187,7 +197,7 @@ class TempFileMunge(object):
         (fd, tmp) = tempfile.mkstemp('.lnk', text=True)
         native_tmp = SCons.Util.get_native_path(os.path.normpath(tmp))
 
-        if env['SHELL'] and env['SHELL'] == 'sh':
+        if env.get('SHELL',None) == 'sh':
             # The sh shell will try to escape the backslashes in the
             # path, so unescape them.
             native_tmp = native_tmp.replace('\\', r'\\\\')
@@ -223,9 +233,22 @@ class TempFileMunge(object):
         # purity get in the way of just being helpful, so we'll
         # reach into SCons.Action directly.
         if SCons.Action.print_actions:
-            print("Using tempfile "+native_tmp+" for command line:\n"+
-                  str(cmd[0]) + " " + " ".join(args))
-        return [ cmd[0], prefix + native_tmp + '\n' + rm, native_tmp ]
+            cmdstr = env.subst(self.cmdstr, SCons.Subst.SUBST_RAW, target, 
+                               source) if self.cmdstr is not None else ''
+            # Print our message only if XXXCOMSTR returns an empty string
+            if len(cmdstr) == 0 :
+                print("Using tempfile "+native_tmp+" for command line:\n"+
+                      str(cmd[0]) + " " + " ".join(args))
+            
+        # Store the temporary file command list into the target Node.attributes 
+        # to avoid creating two temporary files one for print and one for execute.
+        cmdlist = [ cmd[0], prefix + native_tmp + '\n' + rm, native_tmp ]
+        if node is not None:
+            try :
+                setattr(node.attributes, 'tempfile_cmdlist', cmdlist)
+            except AttributeError:
+                pass
+        return cmdlist
     
 def Platform(name = platform_default()):
     """Select a canned Platform specification.
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Platform/aix.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Platform/aix.py
similarity index 58%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Platform/aix.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Platform/aix.py
index df3ee4044210d0808a303473ce9cd3305ce6391d..44bccd1cb0c87b255e4fd0a622c0f34767671ce2 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Platform/aix.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Platform/aix.py
@@ -8,7 +8,7 @@ selection method.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -30,13 +30,17 @@ selection method.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Platform/aix.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Platform/aix.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import os
+import subprocess
 
 import posix
 
-def get_xlc(env, xlc=None, xlc_r=None, packages=[]):
+import SCons.Util
+import SCons.Action
+
+def get_xlc(env, xlc=None, packages=[]):
     # Use the AIX package installer tool lslpp to figure out where a
     # given xl* compiler is installed and what version it is.
     xlcPath = None
@@ -44,18 +48,30 @@ def get_xlc(env, xlc=None, xlc_r=None, packages=[]):
 
     if xlc is None:
         xlc = env.get('CC', 'xlc')
-    if xlc_r is None:
-        xlc_r = xlc + '_r'
+    if SCons.Util.is_List(xlc):
+        xlc = xlc[0]
     for package in packages:
-        cmd = "lslpp -fc " + package + " 2>/dev/null | egrep '" + xlc + "([^-_a-zA-Z0-9].*)?$'"
-        line = os.popen(cmd).readline()
-        if line:
-            v, p = line.split(':')[1:3]
-            xlcVersion = v.split()[1]
-            xlcPath = p.split()[0]
-            xlcPath = xlcPath[:xlcPath.rindex('/')]
-            break
-    return (xlcPath, xlc, xlc_r, xlcVersion)
+        # find the installed filename, which may be a symlink as well
+        pipe = SCons.Action._subproc(env, ['lslpp', '-fc', package],
+                stdin = 'devnull',
+                stderr = 'devnull',
+                stdout = subprocess.PIPE)
+        # output of lslpp is something like this:
+        #     #Path:Fileset:File
+        #     /usr/lib/objrepos:vac.C 6.0.0.0:/usr/vac/exe/xlCcpp
+        #     /usr/lib/objrepos:vac.C 6.0.0.0:/usr/vac/bin/xlc_r -> /usr/vac/bin/xlc
+        for line in pipe.stdout:
+            if xlcPath:
+                continue # read everything to let lslpp terminate
+            fileset, filename = line.split(':')[1:3]
+            filename = filename.split()[0]
+            if ('/' in xlc and filename == xlc) \
+            or ('/' not in xlc and filename.endswith('/' + xlc)):
+                xlcVersion = fileset.split()[1]
+                xlcPath, sep, xlc = filename.rpartition('/')
+            pass
+        pass
+    return (xlcPath, xlc, xlcVersion)
 
 def generate(env):
     posix.generate(env)
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Platform/cygwin.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Platform/cygwin.py
similarity index 89%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Platform/cygwin.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Platform/cygwin.py
index 31d822b9641bd8d2ff0c4c665effddf87c13f0d8..d04bbe7ae50763bd473db4c0e1fbe93fee3f7ab2 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Platform/cygwin.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Platform/cygwin.py
@@ -8,7 +8,7 @@ selection method.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -30,7 +30,7 @@ selection method.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Platform/cygwin.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Platform/cygwin.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import posix
 from SCons.Platform import TempFileMunge
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Platform/darwin.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Platform/darwin.py
similarity index 91%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Platform/darwin.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Platform/darwin.py
index 907ec45d1aeee73e85fc7d5a0c9a862f1c7d35f7..efd8ba4d65b67436946dc142d279864f9babdba0 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Platform/darwin.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Platform/darwin.py
@@ -8,7 +8,7 @@ selection method.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -30,7 +30,7 @@ selection method.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Platform/darwin.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Platform/darwin.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import posix
 import os
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Platform/hpux.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Platform/hpux.py
similarity index 88%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Platform/hpux.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Platform/hpux.py
index 2312439a8d67d715bacae6d2cc4b76c54c1bb13a..2e2fbca46b2d8a01ab2c67d504d32949313c6f28 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Platform/hpux.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Platform/hpux.py
@@ -8,7 +8,7 @@ selection method.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -30,7 +30,7 @@ selection method.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Platform/hpux.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Platform/hpux.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import posix
 
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Platform/irix.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Platform/irix.py
similarity index 87%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Platform/irix.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Platform/irix.py
index f0b089a86ed20f79cd448284109981ec4ee05a16..3bedbdf1993f63b1f0dca1d12551c9e3b60a6549 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Platform/irix.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Platform/irix.py
@@ -8,7 +8,7 @@ selection method.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -30,7 +30,7 @@ selection method.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Platform/irix.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Platform/irix.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import posix
 
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Platform/os2.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Platform/os2.py
similarity index 90%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Platform/os2.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Platform/os2.py
index 0576abdd65a45161009dbbfa755e5226734bee3c..82eb1635b0897ca61aad5549a4d8255208ec8bd9 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Platform/os2.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Platform/os2.py
@@ -8,7 +8,7 @@ selection method.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -30,7 +30,7 @@ selection method.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Platform/os2.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Platform/os2.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 import win32
 
 def generate(env):
diff --git a/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Platform/posix.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Platform/posix.py
new file mode 100644
index 0000000000000000000000000000000000000000..84458637d2b2479eec9f004b8f110090fc55970c
--- /dev/null
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Platform/posix.py
@@ -0,0 +1,124 @@
+"""SCons.Platform.posix
+
+Platform-specific initialization for POSIX (Linux, UNIX, etc.) systems.
+
+There normally shouldn't be any need to import this module directly.  It
+will usually be imported through the generic SCons.Platform.Platform()
+selection method.
+"""
+
+#
+# Copyright (c) 2001 - 2015 The SCons Foundation
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+
+__revision__ = "src/engine/SCons/Platform/posix.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
+
+import errno
+import os
+import os.path
+import subprocess
+import sys
+import select
+
+import SCons.Util
+from SCons.Platform import TempFileMunge
+
+exitvalmap = {
+    2 : 127,
+    13 : 126,
+}
+
+def escape(arg):
+    "escape shell special characters"
+    slash = '\\'
+    special = '"$()'
+
+    arg = arg.replace(slash, slash+slash)
+    for c in special:
+        arg = arg.replace(c, slash+c)
+
+    return '"' + arg + '"'
+
+def exec_subprocess(l, env):
+    proc = subprocess.Popen(l, env = env, close_fds = True)
+    return proc.wait()
+
+def subprocess_spawn(sh, escape, cmd, args, env):
+    return exec_subprocess([sh, '-c', ' '.join(args)], env)
+
+def exec_popen3(l, env, stdout, stderr):
+    proc = subprocess.Popen(l, env = env, close_fds = True,
+                            stdout = stdout,
+                            stderr = stderr)
+    return proc.wait()
+
+def piped_env_spawn(sh, escape, cmd, args, env, stdout, stderr):
+    # spawn using Popen3 combined with the env command
+    # the command name and the command's stdout is written to stdout
+    # the command's stderr is written to stderr
+    return exec_popen3([sh, '-c', ' '.join(args)],
+                       env, stdout, stderr)
+
+
+def generate(env):
+    # Bearing in mind we have python 2.4 as a baseline, we can just do this:
+    spawn = subprocess_spawn
+    pspawn = piped_env_spawn
+    # Note that this means that 'escape' is no longer used
+
+    if 'ENV' not in env:
+        env['ENV']        = {}
+    env['ENV']['PATH']    = '/usr/local/bin:/opt/bin:/bin:/usr/bin'
+    env['OBJPREFIX']      = ''
+    env['OBJSUFFIX']      = '.o'
+    env['SHOBJPREFIX']    = '$OBJPREFIX'
+    env['SHOBJSUFFIX']    = '$OBJSUFFIX'
+    env['PROGPREFIX']     = ''
+    env['PROGSUFFIX']     = ''
+    env['LIBPREFIX']      = 'lib'
+    env['LIBSUFFIX']      = '.a'
+    env['SHLIBPREFIX']    = '$LIBPREFIX'
+    env['SHLIBSUFFIX']    = '.so'
+    env['LIBPREFIXES']    = [ '$LIBPREFIX' ]
+    env['LIBSUFFIXES']    = [ '$LIBSUFFIX', '$SHLIBSUFFIX' ]
+    env['PSPAWN']         = pspawn
+    env['SPAWN']          = spawn
+    env['SHELL']          = 'sh'
+    env['ESCAPE']         = escape
+    env['TEMPFILE']       = TempFileMunge
+    env['TEMPFILEPREFIX'] = '@'
+    #Based on LINUX: ARG_MAX=ARG_MAX=131072 - 3000 for environment expansion
+    #Note: specific platforms might rise or lower this value
+    env['MAXLINELENGTH']  = 128072
+
+    # This platform supports RPATH specifications.
+    env['__RPATH'] = '$_RPATH'
+
+    # GDC is GCC family, but DMD and LDC have different options.
+    # Must be able to have GCC and DMD work in the same build, so:
+    env['__DRPATH'] = '$_DRPATH'
+
+# Local Variables:
+# tab-width:4
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=4 shiftwidth=4:
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Platform/sunos.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Platform/sunos.py
similarity index 89%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Platform/sunos.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Platform/sunos.py
index 7ae60f840f99d4f3390a079e4ba6b32940a92d36..1c1d797734566b5c37959bbc6599edeb0ba3423c 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Platform/sunos.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Platform/sunos.py
@@ -8,7 +8,7 @@ selection method.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -30,7 +30,7 @@ selection method.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Platform/sunos.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Platform/sunos.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import posix
 
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Platform/win32.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Platform/win32.py
similarity index 89%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Platform/win32.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Platform/win32.py
index 2d6d970d320b29132765a081edd9b537d5e4988c..3bad86b9ecd2187e6e3d454eb92b23e6946e4422 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Platform/win32.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Platform/win32.py
@@ -8,7 +8,7 @@ selection method.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -30,7 +30,7 @@ selection method.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Platform/win32.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Platform/win32.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import os
 import os.path
@@ -81,8 +81,39 @@ else:
     builtins.file = _scons_file
     builtins.open = _scons_open
 
-
-
+try:
+    import threading
+    spawn_lock = threading.Lock()
+    
+    # This locked version of spawnve works around a Windows
+    # MSVCRT bug, because its spawnve is not thread-safe.
+    # Without this, python can randomly crash while using -jN.
+    # See the python bug at http://bugs.python.org/issue6476
+    # and SCons issue at
+    # http://scons.tigris.org/issues/show_bug.cgi?id=2449
+    def spawnve(mode, file, args, env):
+        spawn_lock.acquire()
+        try:
+            if mode == os.P_WAIT:
+                ret = os.spawnve(os.P_NOWAIT, file, args, env)
+            else:
+                ret = os.spawnve(mode, file, args, env)
+        finally:
+            spawn_lock.release()
+        if mode == os.P_WAIT:
+            pid, status = os.waitpid(ret, 0)
+            ret = status >> 8
+        return ret
+except ImportError:
+    # Use the unsafe method of spawnve.
+    # Please, don't try to optimize this try-except block
+    # away by assuming that the threading module is always present.
+    # In the test test/option-j.py we intentionally call SCons with
+    # a fake threading.py that raises an import exception right away,
+    # simulating a non-existent package.
+    def spawnve(mode, file, args, env):
+        return os.spawnve(mode, file, args, env)
+    
 # The upshot of all this is that, if you are using Python 1.5.2,
 # you had better have cmd or command.com in your PATH when you run
 # scons.
@@ -123,7 +154,7 @@ def piped_spawn(sh, escape, cmd, args, env, stdout, stderr):
         # actually do the spawn
         try:
             args = [sh, '/C', escape(' '.join(args)) ]
-            ret = os.spawnve(os.P_WAIT, sh, args, env)
+            ret = spawnve(os.P_WAIT, sh, args, env)
         except OSError, e:
             # catch any error
             try:
@@ -151,7 +182,7 @@ def piped_spawn(sh, escape, cmd, args, env, stdout, stderr):
 
 def exec_spawn(l, env):
     try:
-        result = os.spawnve(os.P_WAIT, l[0], l, env)
+        result = spawnve(os.P_WAIT, l[0], l, env)
     except OSError, e:
         try:
             result = exitvalmap[e[0]]
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/SConf.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/SConf.py
similarity index 95%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/SConf.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/SConf.py
index 5c99db9d3342564cb190d5ccfec8d9255075aeba..2ef4003619f16551a0510e228a59a378fbff53b1 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/SConf.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/SConf.py
@@ -1,10 +1,18 @@
 """SCons.SConf
 
 Autoconf-like configuration support.
+
+In other words, SConf allows to run tests on the build machine to detect
+capabilities of system and do some things based on result: generate config
+files, header files for C/C++, update variables in environment.
+
+Tests on the build system can detect if compiler sees header files, if
+libraries are installed, if some command line options are supported etc.
+
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -26,7 +34,7 @@ Autoconf-like configuration support.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/SConf.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/SConf.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import SCons.compat
 
@@ -110,16 +118,22 @@ def _createConfigH(target, source, env):
 def _stringConfigH(target, source, env):
     return "scons: Configure: creating " + str(target[0])
 
-def CreateConfigHBuilder(env):
-    """Called just before the building targets phase begins."""
+
+def NeedConfigHBuilder():
     if len(_ac_config_hs) == 0:
-        return
+       return False
+    else:
+       return True
+
+def CreateConfigHBuilder(env):
+    """Called if necessary just before the building targets phase begins."""
     action = SCons.Action.Action(_createConfigH,
                                  _stringConfigH)
     sconfigHBld = SCons.Builder.Builder(action=action)
     env.Append( BUILDERS={'SConfigHBuilder':sconfigHBld} )
     for k in _ac_config_hs.keys():
         env.SConfigHBuilder(k, env.Value(_ac_config_hs[k]))
+
     
 class SConfWarning(SCons.Warnings.Warning):
     pass
@@ -161,8 +175,11 @@ class SConfBuildInfo(SCons.Node.FS.FileBuildInfo):
     are result (did the builder succeed last time?) and string, which
     contains messages of the original build phase.
     """
-    result = None # -> 0/None -> no error, != 0 error
-    string = None # the stdout / stderr output when building the target
+    __slots__ = ('result', 'string')
+    
+    def __init__(self):
+        self.result = None # -> 0/None -> no error, != 0 error
+        self.string = None # the stdout / stderr output when building the target
 
     def set_build_result(self, result, string):
         self.result = result
@@ -180,7 +197,11 @@ class Streamer(object):
     def write(self, str):
         if self.orig:
             self.orig.write(str)
-        self.s.write(str)
+        try:
+            self.s.write(str)
+        except TypeError as e:
+            # "unicode argument expected" bug in IOStream (python 2.x)
+            self.s.write(str.decode())
 
     def writelines(self, lines):
         for l in lines:
@@ -334,8 +355,10 @@ class SConfBuildTask(SCons.Taskmaster.AlwaysTask):
                 raise SCons.Errors.ExplicitExit(self.targets[0],exc_value.code)
             except Exception, e:
                 for t in self.targets:
-                    binfo = t.get_binfo()
-                    binfo.__class__ = SConfBuildInfo
+                    #binfo = t.get_binfo()
+                    #binfo.__class__ = SConfBuildInfo
+                    binfo = SConfBuildInfo()
+                    binfo.merge(t.get_binfo())
                     binfo.set_build_result(1, s.getvalue())
                     sconsign_entry = SCons.SConsign.SConsignEntry()
                     sconsign_entry.binfo = binfo
@@ -352,8 +375,10 @@ class SConfBuildTask(SCons.Taskmaster.AlwaysTask):
                 raise e
             else:
                 for t in self.targets:
-                    binfo = t.get_binfo()
-                    binfo.__class__ = SConfBuildInfo
+                    #binfo = t.get_binfo()
+                    #binfo.__class__ = SConfBuildInfo
+                    binfo = SConfBuildInfo()
+                    binfo.merge(t.get_binfo())
                     binfo.set_build_result(0, s.getvalue())
                     sconsign_entry = SCons.SConsign.SConsignEntry()
                     sconsign_entry.binfo = binfo
@@ -482,7 +507,10 @@ class SConfBase(object):
         # we override the store_info() method with a null place-holder
         # so we really control how it gets written.
         for n in nodes:
-            n.store_info = n.do_not_store_info
+            n.store_info = 0
+            if not hasattr(n, 'attributes'):
+                n.attributes = SCons.Node.Node.Attrs()
+            n.attributes.keep_targetinfo = 1
 
         ret = 1
 
@@ -619,7 +647,7 @@ class SConfBase(object):
         ok = self.TryLink(text, extension)
         if( ok ):
             prog = self.lastTarget
-            pname = prog.path
+            pname = prog.get_internal_path()
             output = self.confdir.File(os.path.basename(pname)+'.out')
             node = self.env.Command(output, prog, [ [ pname, ">", "${TARGET}"] ])
             ok = self.BuildNodes(node)
@@ -663,7 +691,6 @@ class SConfBase(object):
         else:
             if not os.path.isdir( dirName ):
                 os.makedirs( dirName )
-                node._exists = 1
 
     def _startup(self):
         """Private method. Set up logstream, and set the environment
@@ -776,19 +803,16 @@ class CheckContext(object):
         self.did_show_result = 0
 
     def Result(self, res):
-        """Inform about the result of the test. res may be an integer or a
-        string. In case of an integer, the written text will be 'yes' or 'no'.
+        """Inform about the result of the test. If res is not a string, displays
+        'yes' or 'no' depending on whether res is evaluated as true or false.
         The result is only displayed when self.did_show_result is not set.
         """
-        if isinstance(res, (int, bool)):
-            if res:
-                text = "yes"
-            else:
-                text = "no"
-        elif isinstance(res, str):
+        if isinstance(res, str):
             text = res
+        elif res:
+            text = "yes"
         else:
-            raise TypeError("Expected string, int or bool, got " + str(type(res)))
+            text = "no"
 
         if self.did_show_result == 0:
             # Didn't show result yet, do it now.
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/SConsign.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/SConsign.py
similarity index 91%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/SConsign.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/SConsign.py
index aa59836b9d34a8b0fff96abcebbf907c60445790..e31a3eb713e7c4eb6a2723a1dc0e14082f532308 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/SConsign.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/SConsign.py
@@ -5,7 +5,7 @@ Writing and reading information to the .sconsign file or files.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -27,7 +27,7 @@ Writing and reading information to the .sconsign file or files.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/SConsign.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/SConsign.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import SCons.compat
 
@@ -122,16 +122,40 @@ class SConsignEntry(object):
     XXX As coded below, we do expect a '.binfo' attribute to be added,
     but we'll probably generalize this in the next refactorings.
     """
-    current_version_id = 1
+    __slots__ = ("binfo", "ninfo", "__weakref__")
+    current_version_id = 2
+    
     def __init__(self):
         # Create an object attribute from the class attribute so it ends up
         # in the pickled data in the .sconsign file.
-        _version_id = self.current_version_id
+        #_version_id = self.current_version_id
+        pass
+    
     def convert_to_sconsign(self):
         self.binfo.convert_to_sconsign()
+        
     def convert_from_sconsign(self, dir, name):
         self.binfo.convert_from_sconsign(dir, name)
 
+    def __getstate__(self):
+        state = getattr(self, '__dict__', {}).copy()
+        for obj in type(self).mro():
+            for name in getattr(obj,'__slots__',()):
+                if hasattr(self, name):
+                    state[name] = getattr(self, name)
+
+        state['_version_id'] = self.current_version_id
+        try:
+            del state['__weakref__']
+        except KeyError:
+            pass
+        return state
+
+    def __setstate__(self, state):
+        for key, value in state.items():
+            if key not in ('_version_id','__weakref__'):
+                setattr(self, key, value)
+        
 class Base(object):
     """
     This is the controlling class for the signatures for the collection of
@@ -202,7 +226,7 @@ class DB(Base):
         # Read using the path relative to the top of the Repository
         # (self.dir.tpath) from which we're fetching the signature
         # information.
-        path = normcase(dir.tpath)
+        path = normcase(dir.get_tpath())
         try:
             rawentries = db[path]
         except KeyError:
@@ -217,7 +241,7 @@ class DB(Base):
                 raise
             except Exception, e:
                 SCons.Warnings.warn(SCons.Warnings.CorruptSConsignWarning,
-                                    "Ignoring corrupt sconsign entry : %s (%s)\n"%(self.dir.tpath, e))
+                                    "Ignoring corrupt sconsign entry : %s (%s)\n"%(self.dir.get_tpath(), e))
             for key, entry in self.entries.items():
                 entry.convert_from_sconsign(dir, key)
 
@@ -244,7 +268,7 @@ class DB(Base):
         # directory (self.dir.path), not relative to the top of
         # the Repository; we only write to our own .sconsign file,
         # not to .sconsign files in Repositories.
-        path = normcase(self.dir.path)
+        path = normcase(self.dir.get_internal_path())
         for key, entry in self.entries.items():
             entry.convert_to_sconsign()
         db[path] = pickle.dumps(self.entries, 1)
@@ -287,7 +311,7 @@ class DirFile(Dir):
         """
 
         self.dir = dir
-        self.sconsign = os.path.join(dir.path, '.sconsign')
+        self.sconsign = os.path.join(dir.get_internal_path(), '.sconsign')
 
         try:
             fp = open(self.sconsign, 'rb')
@@ -323,7 +347,7 @@ class DirFile(Dir):
 
         self.merge()
 
-        temp = os.path.join(self.dir.path, '.scons%d' % os.getpid())
+        temp = os.path.join(self.dir.get_internal_path(), '.scons%d' % os.getpid())
         try:
             file = open(temp, 'wb')
             fname = temp
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Scanner/C.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Scanner/C.py
similarity index 95%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Scanner/C.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Scanner/C.py
index 6ba7eeac16afe96564ee847fce0a1d4bbadf0661..33e1145559128eb6ca0290e31f3232c944bdf8e1 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Scanner/C.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Scanner/C.py
@@ -5,7 +5,7 @@ This module implements the depenency scanner for C/C++ code.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -27,7 +27,7 @@ This module implements the depenency scanner for C/C++ code.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Scanner/C.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Scanner/C.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import SCons.Node.FS
 import SCons.Scanner
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Scanner/D.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Scanner/D.py
similarity index 91%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Scanner/D.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Scanner/D.py
index 20ab5f0ac67e1b8860ccda6746d97b34b7800227..2c51a097414e9eb57d4c6c9e260de8ebf7c9f2f6 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Scanner/D.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Scanner/D.py
@@ -8,7 +8,7 @@ Coded by Andy Friesen
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -30,7 +30,7 @@ Coded by Andy Friesen
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Scanner/D.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Scanner/D.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import re
 
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Scanner/Dir.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Scanner/Dir.py
similarity index 93%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Scanner/Dir.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Scanner/Dir.py
index 7c199bcf3b77cb8c478a9be5f45a1f80d4a9148a..756542384df42738b9ba4abb8ef20207eae52029 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Scanner/Dir.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Scanner/Dir.py
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -20,7 +20,7 @@
 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
-__revision__ = "src/engine/SCons/Scanner/Dir.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Scanner/Dir.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import SCons.Node.FS
 import SCons.Scanner
@@ -77,7 +77,7 @@ def scan_on_disk(node, env, path=()):
     that and then call the in-memory scanning function.
     """
     try:
-        flist = node.fs.listdir(node.abspath)
+        flist = node.fs.listdir(node.get_abspath())
     except (IOError, OSError):
         return []
     e = node.Entry
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Scanner/Fortran.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Scanner/Fortran.py
similarity index 98%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Scanner/Fortran.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Scanner/Fortran.py
index 4bb49cd7895519a5ef5f28251a92fc883ca0deda..a1f39277fb0fb95e7e9bc69215509f04bb269c47 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Scanner/Fortran.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Scanner/Fortran.py
@@ -5,7 +5,7 @@ This module implements the dependency scanner for Fortran code.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -26,7 +26,7 @@ This module implements the dependency scanner for Fortran code.
 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
-__revision__ = "src/engine/SCons/Scanner/Fortran.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Scanner/Fortran.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import re
 
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Scanner/IDL.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Scanner/IDL.py
similarity index 88%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Scanner/IDL.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Scanner/IDL.py
index d43e0139dfd428ba9a988cff6233dfe66dc5e49e..6758bd2e3af52593b2df2a18ab98db70b18b1bb1 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Scanner/IDL.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Scanner/IDL.py
@@ -6,7 +6,7 @@ Definition Language) files.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -28,7 +28,7 @@ Definition Language) files.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Scanner/IDL.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Scanner/IDL.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import SCons.Node.FS
 import SCons.Scanner
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Scanner/LaTeX.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Scanner/LaTeX.py
similarity index 98%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Scanner/LaTeX.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Scanner/LaTeX.py
index 4152fa2ae3ea7310266b9243ec0d575424e6149b..aed074c974918c331b1995f133fec967fd33dd94 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Scanner/LaTeX.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Scanner/LaTeX.py
@@ -5,7 +5,7 @@ This module implements the dependency scanner for LaTeX code.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -27,7 +27,7 @@ This module implements the dependency scanner for LaTeX code.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Scanner/LaTeX.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Scanner/LaTeX.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import os.path
 import re
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Scanner/Prog.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Scanner/Prog.py
similarity index 82%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Scanner/Prog.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Scanner/Prog.py
index fbdf8581e69791889547fbdd3d1a726699a518d6..c0511dcd19e3fc417ad0217199379d99ff9885c6 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Scanner/Prog.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Scanner/Prog.py
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -21,7 +21,7 @@
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Scanner/Prog.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Scanner/Prog.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import SCons.Node
 import SCons.Node.FS
@@ -38,6 +38,24 @@ def ProgramScanner(**kw):
     ps = SCons.Scanner.Base(scan, "ProgramScanner", **kw)
     return ps
 
+def _subst_libs(env, libs):
+    """
+    Substitute environment variables and split into list.
+    """
+    if SCons.Util.is_String(libs):
+        libs = env.subst(libs)
+        if SCons.Util.is_String(libs):
+            libs = libs.split()
+    elif SCons.Util.is_Sequence(libs):
+        _libs = []
+        for l in libs:
+            _libs += _subst_libs(env, l)
+        libs = _libs
+    else:
+        # libs is an object (Node, for example)
+        libs = [libs]
+    return libs
+
 def scan(node, env, libpath = ()):
     """
     This scanner scans program files for static-library
@@ -50,10 +68,8 @@ def scan(node, env, libpath = ()):
     except KeyError:
         # There are no LIBS in this environment, so just return a null list:
         return []
-    if SCons.Util.is_String(libs):
-        libs = libs.split()
-    else:
-        libs = SCons.Util.flatten(libs)
+
+    libs = _subst_libs(env, libs)
 
     try:
         prefix = env['LIBPREFIXES']
@@ -83,7 +99,6 @@ def scan(node, env, libpath = ()):
     adjustixes = SCons.Util.adjustixes
     for lib in libs:
         if SCons.Util.is_String(lib):
-            lib = env.subst(lib)
             for pref, suf in pairs:
                 l = adjustixes(lib, pref, suf)
                 l = find_file(l, libpath, verbose=print_find_libs)
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Scanner/RC.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Scanner/RC.py
similarity index 89%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Scanner/RC.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Scanner/RC.py
index 871fdf9a04f71ea7d6b1ed7db27fd4cf2b5ae442..f73b47ee579b0f977126d2315782cb4273f210ca 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Scanner/RC.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Scanner/RC.py
@@ -6,7 +6,7 @@ Definition Language) files.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -28,7 +28,7 @@ Definition Language) files.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Scanner/RC.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Scanner/RC.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import SCons.Node.FS
 import SCons.Scanner
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Scanner/__init__.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Scanner/__init__.py
similarity index 98%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Scanner/__init__.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Scanner/__init__.py
index 9675e8dd5c87e831ff29eab0c2acc2e3e68dfd46..d51cb9edaf7106fc3b0f6008c319d5b807060836 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Scanner/__init__.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Scanner/__init__.py
@@ -5,7 +5,7 @@ The Scanner package for the SCons software construction utility.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -27,7 +27,7 @@ The Scanner package for the SCons software construction utility.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Scanner/__init__.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Scanner/__init__.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import re
 
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Script/Interactive.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Script/Interactive.py
similarity index 98%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Script/Interactive.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Script/Interactive.py
index e0822a7e3089d18f6e05499f09b2b8781aea0ec3..afcde0c3dfd5c42bd1302518c01aa824ad0f65ea 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Script/Interactive.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Script/Interactive.py
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -20,7 +20,7 @@
 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
-__revision__ = "src/engine/SCons/Script/Interactive.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Script/Interactive.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 __doc__ = """
 SCons interactive mode
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Script/Main.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Script/Main.py
similarity index 92%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Script/Main.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Script/Main.py
index 12d1bc256b9d1e7f9adff35f35b21cee5829c06f..6684fbd0af01992d48443bcf2c7f795dea68cce9 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Script/Main.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Script/Main.py
@@ -11,9 +11,9 @@ it goes here.
 """
 
 unsupported_python_version = (2, 3, 0)
-deprecated_python_version = (2, 4, 0)
+deprecated_python_version = (2, 7, 0)
 
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -34,7 +34,7 @@ deprecated_python_version = (2, 4, 0)
 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
-__revision__ = "src/engine/SCons/Script/Main.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Script/Main.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import SCons.compat
 
@@ -79,7 +79,12 @@ def fetch_win32_parallel_msg():
     import SCons.Platform.win32
     return SCons.Platform.win32.parallel_msg
 
-#
+def revert_io():
+    # This call is added to revert stderr and stdout to the original
+    # ones just in case some build rule or something else in the system
+    # has redirected them elsewhere.
+    sys.stderr = sys.__stderr__
+    sys.stdout = sys.__stdout__
 
 class SConsPrintHelpException(Exception):
     pass
@@ -187,7 +192,7 @@ class BuildTask(SCons.Taskmaster.OutOfDateTask):
             finish_time = time.time()
             last_command_end = finish_time
             cumulative_command_time = cumulative_command_time+finish_time-start_time
-            sys.stdout.write("Command execution time: %f seconds\n"%(finish_time-start_time))
+            sys.stdout.write("Command execution time: %s: %f seconds\n"%(str(self.node), finish_time-start_time))
 
     def do_failed(self, status=2):
         _BuildFailures.append(self.exception[1])
@@ -203,13 +208,13 @@ class BuildTask(SCons.Taskmaster.OutOfDateTask):
             SCons.Taskmaster.OutOfDateTask.fail_stop(self)
             exit_status = status
             this_build_status = status
-            
+
     def executed(self):
         t = self.targets[0]
         if self.top and not t.has_builder() and not t.side_effect:
             if not t.exists():
                 if t.__class__.__name__ in ('File', 'Dir', 'Entry'):
-                    errstr="Do not know how to make %s target `%s' (%s)." % (t.__class__.__name__, t, t.abspath)
+                    errstr="Do not know how to make %s target `%s' (%s)." % (t.__class__.__name__, t, t.get_abspath())
                 else: # Alias or Python or ...
                     errstr="Do not know how to make %s target `%s'." % (t.__class__.__name__, t)
                 sys.stderr.write("scons: *** " + errstr)
@@ -248,7 +253,7 @@ class BuildTask(SCons.Taskmaster.OutOfDateTask):
             except ValueError:
                 t, e = exc_info
                 tb = None
-                
+
         # Deprecated string exceptions will have their string stored
         # in the first entry of the tuple.
         if e is None:
@@ -266,12 +271,15 @@ class BuildTask(SCons.Taskmaster.OutOfDateTask):
         errfmt = "scons: *** [%s] %s\n"
         sys.stderr.write(errfmt % (nodename, buildError))
 
-        if (buildError.exc_info[2] and buildError.exc_info[1] and 
+        if (buildError.exc_info[2] and buildError.exc_info[1] and
            not isinstance(
-               buildError.exc_info[1], 
+               buildError.exc_info[1],
                (EnvironmentError, SCons.Errors.StopError,
                             SCons.Errors.UserError))):
             type, value, trace = buildError.exc_info
+            if tb and print_stacktrace:
+                sys.stderr.write("scons: internal stack trace:\n")
+                traceback.print_tb(tb, file=sys.stderr)
             traceback.print_exception(type, value, trace)
         elif tb and print_stacktrace:
             sys.stderr.write("scons: internal stack trace:\n")
@@ -304,7 +312,7 @@ class BuildTask(SCons.Taskmaster.OutOfDateTask):
 
 class CleanTask(SCons.Taskmaster.AlwaysTask):
     """An SCons clean task."""
-    def fs_delete(self, path, pathstr, remove=1):
+    def fs_delete(self, path, pathstr, remove=True):
         try:
             if os.path.lexists(path):
                 if os.path.isfile(path) or os.path.islink(path):
@@ -331,37 +339,41 @@ class CleanTask(SCons.Taskmaster.AlwaysTask):
         except (IOError, OSError), e:
             print "scons: Could not remove '%s':" % pathstr, e.strerror
 
-    def show(self):
+    def _get_files_to_clean(self):
+        result = []
         target = self.targets[0]
-        if (target.has_builder() or target.side_effect) and not target.noclean:
-            for t in self.targets:
-                if not t.isdir():
-                    display("Removed " + str(t))
-        if target in SCons.Environment.CleanTargets:
-            files = SCons.Environment.CleanTargets[target]
-            for f in files:
-                self.fs_delete(f.abspath, str(f), 0)
+        if target.has_builder() or target.side_effect:
+            result = [t for t in self.targets if not t.noclean]
+        return result
 
-    def remove(self):
+    def _clean_targets(self, remove=True):
         target = self.targets[0]
-        if (target.has_builder() or target.side_effect) and not target.noclean:
-            for t in self.targets:
-                try:
-                    removed = t.remove()
-                except OSError, e:
-                    # An OSError may indicate something like a permissions
-                    # issue, an IOError would indicate something like
-                    # the file not existing.  In either case, print a
-                    # message and keep going to try to remove as many
-                    # targets aa possible.
-                    print "scons: Could not remove '%s':" % str(t), e.strerror
-                else:
-                    if removed:
-                        display("Removed " + str(t))
         if target in SCons.Environment.CleanTargets:
             files = SCons.Environment.CleanTargets[target]
             for f in files:
-                self.fs_delete(f.abspath, str(f))
+                self.fs_delete(f.get_abspath(), str(f), remove)
+
+    def show(self):
+        for t in self._get_files_to_clean():
+            if not t.isdir():
+                display("Removed " + str(t))
+        self._clean_targets(remove=False)
+
+    def remove(self):
+        for t in self._get_files_to_clean():
+            try:
+                removed = t.remove()
+            except OSError, e:
+                # An OSError may indicate something like a permissions
+                # issue, an IOError would indicate something like
+                # the file not existing.  In either case, print a
+                # message and keep going to try to remove as many
+                # targets aa possible.
+                print "scons: Could not remove '%s':" % str(t), e.strerror
+            else:
+                if removed:
+                    display("Removed " + str(t))
+        self._clean_targets(remove=True)
 
     execute = remove
 
@@ -546,7 +558,7 @@ def find_deepest_user_frame(tb):
     Input is a "pre-processed" stack trace in the form
     returned by traceback.extract_tb() or traceback.extract_stack()
     """
-    
+
     tb.reverse()
 
     # find the deepest traceback frame that is not part
@@ -559,7 +571,7 @@ def find_deepest_user_frame(tb):
 
 def _scons_user_error(e):
     """Handle user errors. Print out a message and a description of the
-    error, along with the line number and routine where it occured. 
+    error, along with the line number and routine where it occured.
     The file and line number will be the deepest stack frame that is
     not part of SCons itself.
     """
@@ -622,7 +634,7 @@ def _set_debug_values(options):
     debug_values = options.debug
 
     if "count" in debug_values:
-        # All of the object counts are within "if __debug__:" blocks,
+        # All of the object counts are within "if track_instances:" blocks,
         # which get stripped when running optimized (with python -O or
         # from compiled *.pyo files).  Provide a warning if __debug__ is
         # stripped, so it doesn't just look like --debug=count is broken.
@@ -630,6 +642,7 @@ def _set_debug_values(options):
         if __debug__: enable_count = True
         if enable_count:
             count_stats.enable(sys.stdout)
+            SCons.Debug.track_instances = True
         else:
             msg = "--debug=count is not supported when running SCons\n" + \
                   "\twith the python -O option or optimized (.pyo) modules."
@@ -644,6 +657,8 @@ def _set_debug_values(options):
     if "memory" in debug_values:
         memory_stats.enable(sys.stdout)
     print_objects = ("objects" in debug_values)
+    if print_objects:
+        SCons.Debug.track_instances = True
     if "presub" in debug_values:
         SCons.Action.print_actions_presub = 1
     if "stacktrace" in debug_values:
@@ -657,7 +672,7 @@ def _set_debug_values(options):
     if "prepare" in debug_values:
         SCons.Taskmaster.print_prepare = 1
     if "duplicate" in debug_values:
-        SCons.Node.FS.print_duplicate = 1
+        SCons.Node.print_duplicate = 1
 
 def _create_path(plist):
     path = '.'
@@ -677,7 +692,7 @@ def _load_site_scons_dir(topdir, site_dir_name=None):
     else:
         site_dir_name = "site_scons"
         err_if_not_found = False
-        
+
     site_dir = os.path.join(topdir, site_dir_name)
     if not os.path.exists(site_dir):
         if err_if_not_found:
@@ -931,13 +946,21 @@ def _main(parser):
         progress_display.set_mode(0)
 
     if options.site_dir:
-        _load_site_scons_dir(d.path, options.site_dir)
+        _load_site_scons_dir(d.get_internal_path(), options.site_dir)
     elif not options.no_site_dir:
-        _load_all_site_scons_dirs(d.path)
-        
+        _load_all_site_scons_dirs(d.get_internal_path())
+
     if options.include_dir:
         sys.path = options.include_dir + sys.path
 
+    # If we're about to start SCons in the interactive mode,
+    # inform the FS about this right here. Else, the release_target_info
+    # method could get called on some nodes, like the used "gcc" compiler,
+    # when using the Configure methods within the SConscripts.
+    # This would then cause subtle bugs, as already happened in #2971.
+    if options.interactive:
+        SCons.Node.interactive = True
+
     # That should cover (most of) the options.  Next, set up the variables
     # that hold command-line arguments, so the SConscript files that we
     # read and execute have access to them.
@@ -983,9 +1006,9 @@ def _main(parser):
         # reading SConscript files and haven't started building
         # things yet, stop regardless of whether they used -i or -k
         # or anything else.
+        revert_io()
         sys.stderr.write("scons: *** %s  Stop.\n" % e)
-        exit_status = 2
-        sys.exit(exit_status)
+        sys.exit(2)
     global sconscript_time
     sconscript_time = time.time() - start_time
 
@@ -1009,13 +1032,18 @@ def _main(parser):
     # warning about deprecated Python versions--delayed until here
     # in case they disabled the warning in the SConscript files.
     if python_version_deprecated():
-        msg = "Support for pre-2.4 Python (%s) is deprecated.\n" + \
-              "    If this will cause hardship, contact dev@scons.tigris.org."
+        msg = "Support for pre-%s Python version (%s) is deprecated.\n" + \
+              "    If this will cause hardship, contact scons-dev@scons.org"
+        deprecated_version_string = ".".join(map(str, deprecated_python_version))
         SCons.Warnings.warn(SCons.Warnings.PythonVersionWarning,
-                            msg % python_version_string())
+                            msg % (deprecated_version_string, python_version_string()))
 
     if not options.help:
-        SCons.SConf.CreateConfigHBuilder(SCons.Defaults.DefaultEnvironment())
+        # [ ] Clarify why we need to create Builder here at all, and
+        #     why it is created in DefaultEnvironment
+        # https://bitbucket.org/scons/scons/commits/d27a548aeee8ad5e67ea75c2d19a7d305f784e30
+        if SCons.SConf.NeedConfigHBuilder():
+            SCons.SConf.CreateConfigHBuilder(SCons.Defaults.DefaultEnvironment())
 
     # Now re-parse the command-line options (any to the left of a '--'
     # argument, that is) with any user-defined command-line options that
@@ -1070,6 +1098,8 @@ def _main(parser):
         # Build the targets
         nodes = _build_targets(fs, options, targets, target_top)
         if not nodes:
+            revert_io()
+            print 'Found nothing to build'
             exit_status = 2
 
 def _build_targets(fs, options, targets, target_top):
@@ -1081,13 +1111,14 @@ def _build_targets(fs, options, targets, target_top):
     display.set_mode(not options.silent)
     SCons.Action.print_actions          = not options.silent
     SCons.Action.execute_actions        = not options.no_exec
-    SCons.Node.FS.do_store_info         = not options.no_exec
+    SCons.Node.do_store_info            = not options.no_exec
     SCons.SConf.dryrun                  = options.no_exec
 
     if options.diskcheck:
         SCons.Node.FS.set_diskcheck(options.diskcheck)
 
     SCons.CacheDir.cache_enabled = not options.cache_disable
+    SCons.CacheDir.cache_readonly = options.cache_readonly
     SCons.CacheDir.cache_debug = options.cache_debug
     SCons.CacheDir.cache_force = options.cache_force
     SCons.CacheDir.cache_show = options.cache_show
@@ -1133,7 +1164,7 @@ def _build_targets(fs, options, targets, target_top):
                         # x doesn't have a cwd, so it's either not a target,
                         # or not a file, so go ahead and keep it as a default
                         # target and let the engine sort it out:
-                        return 1                
+                        return 1
                 d = list(filter(check_dir, SCons.Script.DEFAULT_TARGETS))
                 SCons.Script.DEFAULT_TARGETS[:] = d
                 target_top = None
@@ -1297,12 +1328,8 @@ def _exec_main(parser, values):
         prof = Profile()
         try:
             prof.runcall(_main, parser)
-        except SConsPrintHelpException, e:
+        finally:
             prof.dump_stats(options.profile_file)
-            raise e
-        except SystemExit:
-            pass
-        prof.dump_stats(options.profile_file)
     else:
         _main(parser)
 
@@ -1327,10 +1354,10 @@ def main():
     except (ImportError, AttributeError):
         # On Windows there is no scons.py, so there is no
         # __main__.__version__, hence there is no script version.
-        pass 
+        pass
     parts.append(version_string("engine", SCons))
     parts.append(path_string("engine", SCons))
-    parts.append("Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation")
+    parts.append("Copyright (c) 2001 - 2015 The SCons Foundation")
     version = ''.join(parts)
 
     import SConsOptions
@@ -1338,9 +1365,12 @@ def main():
     values = SConsOptions.SConsValues(parser.get_default_values())
 
     OptionsParser = parser
-    
+
     try:
-        _exec_main(parser, values)
+        try:
+            _exec_main(parser, values)
+        finally:
+            revert_io()
     except SystemExit, s:
         if s:
             exit_status = s
@@ -1357,6 +1387,7 @@ def main():
         parser.print_help()
         exit_status = 0
     except SCons.Errors.BuildError, e:
+        print e
         exit_status = e.exitstatus
     except:
         # An exception here is likely a builtin Python exception Python
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Script/SConsOptions.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Script/SConsOptions.py
similarity index 88%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Script/SConsOptions.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Script/SConsOptions.py
index 1d574f8cb068a404fc4b2afbbfa620b5380b501e..7e458aa22ebf704213b25d9844895629e2c51c25 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Script/SConsOptions.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Script/SConsOptions.py
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -21,7 +21,7 @@
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Script/SConsOptions.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Script/SConsOptions.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import optparse
 import re
@@ -248,7 +248,7 @@ class SConsOption(optparse.Option):
 class SConsOptionGroup(optparse.OptionGroup):
     """
     A subclass for SCons-specific option groups.
-    
+
     The only difference between this and the base class is that we print
     the group's help text flush left, underneath their own title but
     lined up with the normal "SCons Options".
@@ -268,8 +268,9 @@ class SConsOptionParser(optparse.OptionParser):
     preserve_unknown_options = False
 
     def error(self, msg):
+        # overriden OptionValueError exception handler
         self.print_usage(sys.stderr)
-        sys.stderr.write("SCons error: %s\n" % msg)
+        sys.stderr.write("SCons Error: %s\n" % msg)
         sys.exit(2)
 
     def _process_long_opt(self, rargs, values):
@@ -318,7 +319,13 @@ class SConsOptionParser(optparse.OptionParser):
                     value = option.const
             elif len(rargs) < nargs:
                 if nargs == 1:
-                    self.error(_("%s option requires an argument") % opt)
+                    if not option.choices:
+                        self.error(_("%s option requires an argument") % opt)
+                    else:
+                        msg  = _("%s option requires an argument " % opt)
+                        msg += _("(choose from %s)"
+                                 % ', '.join(option.choices))
+                        self.error(msg)
                 else:
                     self.error(_("%s option requires %d arguments")
                                % (opt, nargs))
@@ -336,10 +343,75 @@ class SConsOptionParser(optparse.OptionParser):
 
         option.process(opt, value, values, self)
 
+    def reparse_local_options(self):
+        """
+        Re-parse the leftover command-line options stored
+        in self.largs, so that any value overridden on the
+        command line is immediately available if the user turns
+        around and does a GetOption() right away.
+        
+        We mimic the processing of the single args
+        in the original OptionParser._process_args(), but here we
+        allow exact matches for long-opts only (no partial
+        argument names!).
+
+        Else, this would lead to problems in add_local_option()
+        below. When called from there, we try to reparse the
+        command-line arguments that
+          1. haven't been processed so far (self.largs), but
+          2. are possibly not added to the list of options yet.
+          
+        So, when we only have a value for "--myargument" yet,
+        a command-line argument of "--myarg=test" would set it.
+        Responsible for this behaviour is the method
+        _match_long_opt(), which allows for partial matches of
+        the option name, as long as the common prefix appears to
+        be unique.
+        This would lead to further confusion, because we might want
+        to add another option "--myarg" later on (see issue #2929).
+        
+        """
+        rargs = []
+        largs_restore = []
+        # Loop over all remaining arguments
+        skip = False
+        for l in self.largs:
+            if skip:
+                # Accept all remaining arguments as they are
+                largs_restore.append(l)
+            else:
+                if len(l) > 2 and l[0:2] == "--":
+                    # Check long option
+                    lopt = (l,)
+                    if "=" in l:
+                        # Split into option and value
+                        lopt = l.split("=", 1)
+                        
+                    if lopt[0] in self._long_opt:
+                        # Argument is already known
+                        rargs.append('='.join(lopt))
+                    else:
+                        # Not known yet, so reject for now
+                        largs_restore.append('='.join(lopt))
+                else:
+                    if l == "--" or l == "-":
+                        # Stop normal processing and don't
+                        # process the rest of the command-line opts
+                        largs_restore.append(l)
+                        skip = True
+                    else:
+                        rargs.append(l)
+        
+        # Parse the filtered list
+        self.parse_args(rargs, self.values)
+        # Restore the list of remaining arguments for the
+        # next call of AddOption/add_local_option...
+        self.largs = self.largs + largs_restore
+
     def add_local_option(self, *args, **kw):
         """
         Adds a local option to the parser.
-        
+
         This is initiated by a SetOption() call to add a user-defined
         command-line option.  We add the option to a separate option
         group for the local options, creating the group if necessary.
@@ -363,7 +435,7 @@ class SConsOptionParser(optparse.OptionParser):
             # available if the user turns around and does a GetOption()
             # right away.
             setattr(self.values.__defaults__, result.dest, result.default)
-            self.parse_args(self.largs, self.values)
+            self.reparse_local_options()
 
         return result
 
@@ -393,11 +465,11 @@ class SConsIndentedHelpFormatter(optparse.IndentedHelpFormatter):
         out liking:
 
         --  add our own regular expression that doesn't break on hyphens
-            (so things like --no-print-directory don't get broken); 
+            (so things like --no-print-directory don't get broken);
 
         --  wrap the list of options themselves when it's too long
             (the wrapper.fill(opts) call below);
- 
+
         --  set the subsequent_indent when wrapping the help_text.
         """
         # The help for each option consists of two parts:
@@ -563,23 +635,28 @@ def Parser(version):
                   action="store_true",
                   help="Copy already-built targets into the CacheDir.")
 
+    op.add_option('--cache-readonly',
+                  dest='cache_readonly', default=False,
+                  action="store_true",
+                  help="Do not update CacheDir with built targets.")
+
     op.add_option('--cache-show',
                   dest='cache_show', default=False,
                   action="store_true",
                   help="Print build actions for files from CacheDir.")
 
+    def opt_invalid(group, value, options):
+        errmsg  = "`%s' is not a valid %s option type, try:\n" % (value, group)
+        return errmsg + "    %s" % ", ".join(options)
+
     config_options = ["auto", "force" ,"cache"]
 
-    def opt_config(option, opt, value, parser, c_options=config_options):
-        if not value in c_options:
-            raise OptionValueError("Warning:  %s is not a valid config type" % value)
-        setattr(parser.values, option.dest, value)
     opt_config_help = "Controls Configure subsystem: %s." \
                       % ", ".join(config_options)
+
     op.add_option('--config',
-                  nargs=1, type="string",
+                  nargs=1, choices=config_options,
                   dest="config", default="auto",
-                  action="callback", callback=opt_config,
                   help = opt_config_help,
                   metavar="MODE")
 
@@ -599,14 +676,16 @@ def Parser(version):
     debug_options = ["count", "duplicate", "explain", "findlibs",
                      "includes", "memoizer", "memory", "objects",
                      "pdb", "prepare", "presub", "stacktrace",
-                     "time"] + list(deprecated_debug_options.keys())
+                     "time"]
 
-    def opt_debug(option, opt, value, parser,
+    def opt_debug(option, opt, value__, parser,
                   debug_options=debug_options,
                   deprecated_debug_options=deprecated_debug_options):
-        if value in debug_options:
-            parser.values.debug.append(value)
-            if value in deprecated_debug_options.keys():
+        for value in value__.split(','):
+            if value in debug_options:
+                parser.values.debug.append(value)
+            elif value in deprecated_debug_options.keys():
+                parser.values.debug.append(value)
                 try:
                     parser.values.delayed_warnings
                 except AttributeError:
@@ -615,8 +694,9 @@ def Parser(version):
                 w = "The --debug=%s option is deprecated%s." % (value, msg)
                 t = (SCons.Warnings.DeprecatedDebugOptionsWarning, w)
                 parser.values.delayed_warnings.append(t)
-        else:
-            raise OptionValueError("Warning:  %s is not a valid debug type" % value)
+            else:
+                raise OptionValueError(opt_invalid('debug', value, debug_options))
+
     opt_debug_help = "Print various types of debugging information: %s." \
                      % ", ".join(debug_options)
     op.add_option('--debug',
@@ -630,7 +710,7 @@ def Parser(version):
         try:
             diskcheck_value = diskcheck_convert(value)
         except ValueError, e:
-            raise OptionValueError("Warning: `%s' is not a valid diskcheck type" % e)
+            raise OptionValueError("`%s' is not a valid diskcheck type" % e)
         setattr(parser.values, option.dest, diskcheck_value)
 
     op.add_option('--diskcheck',
@@ -642,7 +722,8 @@ def Parser(version):
 
     def opt_duplicate(option, opt, value, parser):
         if not value in SCons.Node.FS.Valid_Duplicates:
-            raise OptionValueError("`%s' is not a valid duplication style." % value)
+            raise OptionValueError(opt_invalid('duplication', value,
+                                              SCons.Node.FS.Valid_Duplicates))
         setattr(parser.values, option.dest, value)
         # Set the duplicate style right away so it can affect linking
         # of SConscript files.
@@ -807,7 +888,7 @@ def Parser(version):
             elif o == 'status':
                 tp.status = True
             else:
-                raise OptionValueError("Warning:  %s is not a valid --tree option" % o)
+                raise OptionValueError(opt_invalid('--tree', o, tree_options))
         parser.values.tree_printers.append(tp)
 
     opt_tree_help = "Print a dependency tree in various formats: %s." \
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Script/SConscript.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Script/SConscript.py
similarity index 97%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Script/SConscript.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Script/SConscript.py
index 18a9e310a3456099fac7f168992ed403f9255cca..ead6f2ea11e00e4f18ee38bc49ff98f1d1f7f8a3 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Script/SConscript.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Script/SConscript.py
@@ -6,7 +6,7 @@ files.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -28,7 +28,7 @@ files.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 from __future__ import division
 
-__revision__ = "src/engine/SCons/Script/SConscript.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Script/SConscript.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import SCons
 import SCons.Action
@@ -265,7 +265,7 @@ def _SConscript(fs, *files, **kw):
                             call_stack[-1].globals.update({__file__:old_file})
                 else:
                     SCons.Warnings.warn(SCons.Warnings.MissingSConscriptWarning,
-                             "Ignoring missing SConscript '%s'" % f.path)
+                             "Ignoring missing SConscript '%s'" % f.get_internal_path())
 
         finally:
             SCons.Script.sconscript_reading = SCons.Script.sconscript_reading - 1
@@ -438,7 +438,7 @@ class SConsEnvironment(SCons.Environment.Base):
                     fname = fn.get_path(src_dir)
                     files = [os.path.join(str(variant_dir), fname)]
                 else:
-                    files = [fn.abspath]
+                    files = [fn.get_abspath()]
                 kw['src_dir'] = variant_dir
             self.fs.VariantDir(variant_dir, src_dir, duplicate)
 
@@ -461,6 +461,11 @@ class SConsEnvironment(SCons.Environment.Base):
 
     def EnsureSConsVersion(self, major, minor, revision=0):
         """Exit abnormally if the SCons version is not late enough."""
+        # split string to avoid replacement during build process
+        if SCons.__version__ == '__' + 'VERSION__':
+            SCons.Warnings.warn(SCons.Warnings.DevelopmentVersionWarning,
+                "EnsureSConsVersion is ignored for development version")
+            return
         scons_ver = self._get_major_minor_revision(SCons.__version__)
         if scons_ver < (major, minor, revision):
             if revision:
@@ -473,13 +478,8 @@ class SConsEnvironment(SCons.Environment.Base):
 
     def EnsurePythonVersion(self, major, minor):
         """Exit abnormally if the Python version is not late enough."""
-        try:
-            v_major, v_minor, v_micro, release, serial = sys.version_info
-            python_ver = (v_major, v_minor)
-        except AttributeError:
-            python_ver = self._get_major_minor_revision(sys.version)[:2]
-        if python_ver < (major, minor):
-            v = sys.version.split(" ", 1)[0]
+        if sys.version_info < (major, minor):
+            v = sys.version.split()[0]
             print "Python %d.%d or greater required, but you have Python %s" %(major,minor,v)
             sys.exit(2)
 
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Script/__init__.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Script/__init__.py
similarity index 98%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Script/__init__.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Script/__init__.py
index c0a031adb4b5d22eb6558b8df89782be668aa5c9..c21882fb2a17efd4d57216882b447d0dcc845db1 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Script/__init__.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Script/__init__.py
@@ -12,7 +12,7 @@ it goes here.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -34,7 +34,7 @@ it goes here.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Script/__init__.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Script/__init__.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import time
 start_time = time.time()
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Sig.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Sig.py
similarity index 91%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Sig.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Sig.py
index 41289a0f6f94890ee5d59cbe2c0056294b1425f8..e949cfb18b53cae91c9ebfa1cf565be9695a2612 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Sig.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Sig.py
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -21,7 +21,7 @@
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Sig.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Sig.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 __doc__ = """Place-holder for the old SCons.Sig module hierarchy
 
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Subst.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Subst.py
similarity index 98%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Subst.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Subst.py
index 8d9d3a43a0fa992db335fcad5d068b554f4b8ce5..da0fa68da4aab66182874d51cf7a95c6d17673da 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Subst.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Subst.py
@@ -5,7 +5,7 @@ SCons string substitution.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -26,7 +26,7 @@ SCons string substitution.
 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
-__revision__ = "src/engine/SCons/Subst.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Subst.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import collections
 import re
@@ -78,6 +78,14 @@ class Literal(object):
     def is_literal(self):
         return 1
 
+    def __eq__(self, other):
+        if not isinstance(other, Literal):
+            return False
+        return self.lstr == other.lstr
+
+    def __neq__(self, other):
+        return not self.__eq__(other)
+
 class SpecialAttrWrapper(object):
     """This is a wrapper for what we call a 'Node special attribute.'
     This is any of the attributes of a Node that we can reference from
@@ -172,7 +180,7 @@ class NLWrapper(object):
     In practice, this might be a wash performance-wise, but it's a little
     cleaner conceptually...
     """
-    
+
     def __init__(self, list, func):
         self.list = list
         self.func = func
@@ -190,7 +198,7 @@ class NLWrapper(object):
         self._create_nodelist = self._return_nodelist
         return self.nodelist
     _create_nodelist = _gen_nodelist
-    
+
 
 class Targets_or_Sources(collections.UserList):
     """A class that implements $TARGETS or $SOURCES expansions by in turn
@@ -451,7 +459,7 @@ def scons_subst(strSubst, env, mode=SUBST_RAW, target=None, source=None, gvars={
                             raise_exception(NameError(key), lvars['TARGETS'], s)
                         else:
                             return ''
-    
+
                     # Before re-expanding the result, handle
                     # recursive expansion by copying the local
                     # variable dictionary and overwriting a null
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Taskmaster.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Taskmaster.py
similarity index 96%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Taskmaster.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Taskmaster.py
index cd95fb081b868bd2bdf2ddea49782b7e36f1f400..b303f79363daf72235a0251805300943069c3d9d 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Taskmaster.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Taskmaster.py
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -47,7 +47,7 @@ interface and the SCons build engine.  There are two key classes here:
         target(s) that it decides need to be evaluated and/or built.
 """
 
-__revision__ = "src/engine/SCons/Taskmaster.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Taskmaster.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 from itertools import chain
 import operator
@@ -186,6 +186,8 @@ class Task(object):
         # or implicit dependencies exists, and also initialize the
         # .sconsign info.
         executor = self.targets[0].get_executor()
+        if executor is None:
+            return
         executor.prepare()
         for t in executor.get_action_targets():
             if print_prepare:
@@ -240,7 +242,7 @@ class Task(object):
                 #
                 for t in cached_targets:
                     try:
-                        t.fs.unlink(t.path)
+                        t.fs.unlink(t.get_internal_path())
                     except (IOError, OSError):
                         pass
                 self.targets[0].build()
@@ -289,6 +291,7 @@ class Task(object):
         post-visit actions that must take place regardless of whether
         or not the target was an actual built target or a source Node.
         """
+        global print_prepare
         T = self.tm.trace
         if T: T.write(self.trace_message('Task.executed_with_callbacks()',
                                          self.node))
@@ -301,7 +304,12 @@ class Task(object):
                 if not t.cached:
                     t.push_to_cache()
                 t.built()
-            t.visited()
+                t.visited()
+                if (not print_prepare and 
+                    (not hasattr(self, 'options') or not self.options.debug_includes)):
+                    t.release_target_info()
+            else:
+                t.visited()
 
     executed = executed_with_callbacks
 
@@ -382,6 +390,7 @@ class Task(object):
 
         This is the default behavior for building only what's necessary.
         """
+        global print_prepare
         T = self.tm.trace
         if T: T.write(self.trace_message(u'Task.make_ready_current()',
                                          self.node))
@@ -414,6 +423,9 @@ class Task(object):
                 # parallel build...)
                 t.visited()
                 t.set_state(NODE_UP_TO_DATE)
+                if (not print_prepare and 
+                    (not hasattr(self, 'options') or not self.options.debug_includes)):
+                    t.release_target_info()
 
     make_ready = make_ready_current
 
@@ -453,14 +465,15 @@ class Task(object):
                 parents[p] = parents.get(p, 0) + 1
 
         for t in targets:
-            for s in t.side_effects:
-                if s.get_state() == NODE_EXECUTING:
-                    s.set_state(NODE_NO_STATE)
-                    for p in s.waiting_parents:
-                        parents[p] = parents.get(p, 0) + 1
-                for p in s.waiting_s_e:
-                    if p.ref_count == 0:
-                        self.tm.candidates.append(p)
+            if t.side_effects is not None:
+                for s in t.side_effects:
+                    if s.get_state() == NODE_EXECUTING:
+                        s.set_state(NODE_NO_STATE)
+                        for p in s.waiting_parents:
+                            parents[p] = parents.get(p, 0) + 1
+                    for p in s.waiting_s_e:
+                        if p.ref_count == 0:
+                            self.tm.candidates.append(p)
 
         for p, subtract in parents.items():
             p.ref_count = p.ref_count - subtract
@@ -927,7 +940,11 @@ class Taskmaster(object):
         if node is None:
             return None
 
-        tlist = node.get_executor().get_all_targets()
+        executor = node.get_executor()
+        if executor is None:
+            return None
+        
+        tlist = executor.get_all_targets()
 
         task = self.tasker(self, tlist, node in self.original_top, node)
         try:
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/386asm.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/386asm.py
similarity index 90%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/386asm.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/386asm.py
index bf32a0b7d4f7c404ddbfd9d2520c34e19a383540..06d271e7caa4ba142aa8bbb243a8aca079a34480 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/386asm.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/386asm.py
@@ -10,7 +10,7 @@ selection method.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -32,7 +32,7 @@ selection method.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/386asm.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/386asm.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 from SCons.Tool.PharLapCommon import addPharLapPaths
 import SCons.Util
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/BitKeeper.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/BitKeeper.py
similarity index 91%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/BitKeeper.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/BitKeeper.py
index 60445db1e8f5eda92439fe2c3fc36b6fd02d9965..9df9f59180b573b74adbf36ff3c1f210f2b496b0 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/BitKeeper.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/BitKeeper.py
@@ -10,7 +10,7 @@ selection method.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -32,7 +32,7 @@ selection method.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/BitKeeper.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/BitKeeper.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import SCons.Action
 import SCons.Builder
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/CVS.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/CVS.py
similarity index 92%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/CVS.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/CVS.py
index 87a6f1a32528d07c5acf3b900a99dfd787dc6024..14bc18e40fd5ac23f0dc10ac5dacfc1c36533bad 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/CVS.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/CVS.py
@@ -8,7 +8,7 @@ selection method.
 
 """
 
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -29,7 +29,7 @@ selection method.
 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
-__revision__ = "src/engine/SCons/Tool/CVS.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/CVS.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import SCons.Action
 import SCons.Builder
diff --git a/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/DCommon.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/DCommon.py
new file mode 100644
index 0000000000000000000000000000000000000000..db0366051e1551a4d75de2f5382c6809f917ee30
--- /dev/null
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/DCommon.py
@@ -0,0 +1,56 @@
+"""SCons.Tool.DCommon
+
+Common code for the various D tools.
+
+Coded by Russel Winder (russel@winder.org.uk)
+2012-09-06
+"""
+#
+# Copyright (c) 2001 - 2015 The SCons Foundation
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+
+__revision__ = "src/engine/SCons/Tool/DCommon.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
+
+import os.path
+
+def isD(env, source):
+    if not source:
+        return 0
+    for s in source:
+        if s.sources:
+            ext = os.path.splitext(str(s.sources[0]))[1]
+            if ext == '.d':
+                return 1
+    return 0
+
+def addDPATHToEnv(env, executable):
+    dPath = env.WhereIs(executable)
+    if dPath:
+        phobosDir = dPath[:dPath.rindex(executable)] + '/../src/phobos'
+        if os.path.isdir(phobosDir):
+            env.Append(DPATH=[phobosDir])
+
+# Local Variables:
+# tab-width:4
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=4 shiftwidth=4:
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/FortranCommon.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/FortranCommon.py
similarity index 94%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/FortranCommon.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/FortranCommon.py
index 2efcfa27b98507429dd07d8f46a4f6f2f8b61003..b8ff7d94cb43e72064227516f56e0bec7d4caa9f 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/FortranCommon.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/FortranCommon.py
@@ -5,7 +5,7 @@ Stuff for processing Fortran, common to all fortran dialects.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -27,7 +27,7 @@ Stuff for processing Fortran, common to all fortran dialects.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/FortranCommon.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/FortranCommon.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import re
 import os.path
@@ -247,6 +247,21 @@ def add_f03_to_env(env):
     DialectAddToEnv(env, "F03", F03Suffixes, F03PPSuffixes,
                     support_module = 1)
 
+def add_f08_to_env(env):
+    """Add Builders and construction variables for f08 to an Environment."""
+    try:
+        F08Suffixes = env['F08FILESUFFIXES']
+    except KeyError:
+        F08Suffixes = ['.f08']
+
+    try:
+        F08PPSuffixes = env['F08PPFILESUFFIXES']
+    except KeyError:
+        F08PPSuffixes = []
+
+    DialectAddToEnv(env, "F08", F08Suffixes, F08PPSuffixes,
+                    support_module = 1)
+
 def add_all_to_env(env):
     """Add builders and construction variables for all supported fortran
     dialects."""
@@ -255,6 +270,7 @@ def add_all_to_env(env):
     add_f90_to_env(env)
     add_f95_to_env(env)
     add_f03_to_env(env)
+    add_f08_to_env(env)
 
 # Local Variables:
 # tab-width:4
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/GettextCommon.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/GettextCommon.py
similarity index 98%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/GettextCommon.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/GettextCommon.py
index b2d848c441c5f5ed1c63efe8dd067df11733e3d7..af9b074b782ea5eb9b5c551f05f04d7eb3a8b782 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/GettextCommon.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/GettextCommon.py
@@ -3,7 +3,7 @@
 Used by several tools of `gettext` toolset.
 """
 
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 # 
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -24,7 +24,7 @@ Used by several tools of `gettext` toolset.
 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
-__revision__ = "src/engine/SCons/Tool/GettextCommon.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/GettextCommon.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import SCons.Warnings
 import re
@@ -225,8 +225,9 @@ class _POFileBuilder(BuilderBase):
 
 import SCons.Environment
 #############################################################################
-def _translate(env, target=[], source=SCons.Environment._null, *args, **kw):
+def _translate(env, target=None, source=SCons.Environment._null, *args, **kw):
   """ Function for `Translate()` pseudo-builder """
+  if target is None: target = []
   pot = env.POTUpdate(None, source, *args, **kw)
   po = env.POUpdate(target, pot, *args, **kw)
   return po
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/JavaCommon.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/JavaCommon.py
similarity index 96%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/JavaCommon.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/JavaCommon.py
index dc381053e4a88f5793dfe97aca0c0265d42d0334..8b1e48efcdfe97925ac5baa9d6527d827db43838 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/JavaCommon.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/JavaCommon.py
@@ -5,7 +5,7 @@ Stuff for processing Java.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -27,7 +27,7 @@ Stuff for processing Java.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/JavaCommon.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/JavaCommon.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import os
 import os.path
@@ -64,8 +64,8 @@ if java_parsing:
         interfaces, and anonymous inner classes."""
         def __init__(self, version=default_java_version):
 
-            if not version in ('1.1', '1.2', '1.3','1.4', '1.5', '1.6',
-                               '5', '6'):
+            if not version in ('1.1', '1.2', '1.3','1.4', '1.5', '1.6', '1.7',
+                               '1.8', '5', '6'):
                 msg = "Java version %s not supported" % version
                 raise NotImplementedError(msg)
 
@@ -171,7 +171,7 @@ if java_parsing:
             if self.version in ('1.1', '1.2', '1.3', '1.4'):
                 clazz = self.listClasses[0]
                 self.listOutputs.append('%s$%d' % (clazz, self.nextAnon))
-            elif self.version in ('1.5', '1.6', '5', '6'):
+            elif self.version in ('1.5', '1.6', '1.7', '1.8', '5', '6'):
                 self.stackAnonClassBrackets.append(self.brackets)
                 className = []
                 className.extend(self.listClasses)
@@ -244,7 +244,8 @@ if java_parsing:
                 return self
             # If that's an inner class which is declared in a method, it
             # requires an index prepended to the class-name, e.g.
-            # 'Foo$1Inner' (Tigris Issue 2087)
+            # 'Foo$1Inner'
+            # http://scons.tigris.org/issues/show_bug.cgi?id=2087
             if self.outer_state.localClasses and \
                 self.outer_state.stackBrackets[-1] > \
                 self.outer_state.stackBrackets[-2]+1:
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/MSCommon/__init__.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/MSCommon/__init__.py
similarity index 89%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/MSCommon/__init__.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/MSCommon/__init__.py
index 8dc6c5a618ba4999a32e559cd0f3a6d883316dee..90cb0bc748ad4fa7ca46ae4e0ff39bd520f2bcd1 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/MSCommon/__init__.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/MSCommon/__init__.py
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -21,7 +21,7 @@
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/MSCommon/__init__.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/MSCommon/__init__.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 __doc__ = """
 Common functions for Microsoft Visual Studio and Visual C/C++.
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/MSCommon/arch.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/MSCommon/arch.py
similarity index 88%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/MSCommon/arch.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/MSCommon/arch.py
index 1b6ac9ef0483ef20c1184fda45bcbc63cfd58327..5bc7ea596f639f538fdbe457aa56f5d7e0097529 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/MSCommon/arch.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/MSCommon/arch.py
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -21,7 +21,7 @@
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/MSCommon/arch.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/MSCommon/arch.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 __doc__ = """Module to define supported Windows chip architectures.
 """
@@ -51,6 +51,12 @@ SupportedArchitectureList = [
         'ia64',
         ['IA64'],
     ),
+    
+    ArchitectureDefinition(
+        'arm',
+        ['ARM'],
+    ),
+
 ]
 
 SupportedArchitectureMap = {}
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/MSCommon/common.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/MSCommon/common.py
similarity index 88%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/MSCommon/common.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/MSCommon/common.py
index d10b7636c1fb87950c8a47dad173309cde1da373..60d7d408d14fd6d599423c6cf6d5c031931d18f2 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/MSCommon/common.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/MSCommon/common.py
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -21,7 +21,7 @@
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/MSCommon/common.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/MSCommon/common.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 __doc__ = """
 Common helper functions for working with the Microsoft tool chain.
@@ -55,12 +55,12 @@ _is_win64 = None
 
 def is_win64():
     """Return true if running on windows 64 bits.
-    
+
     Works whether python itself runs in 64 bits or 32 bits."""
     # Unfortunately, python does not provide a useful way to determine
     # if the underlying Windows OS is 32-bit or 64-bit.  Worse, whether
     # the Python itself is 32-bit or 64-bit affects what it returns,
-    # so nothing in sys.* or os.* help.  
+    # so nothing in sys.* or os.* help.
 
     # Apparently the best solution is to use env vars that Windows
     # sets.  If PROCESSOR_ARCHITECTURE is not x86, then the python
@@ -120,11 +120,21 @@ def normalize_env(env, keys, force=False):
             if k in os.environ and (force or not k in normenv):
                 normenv[k] = os.environ[k].encode('mbcs')
 
+    # This shouldn't be necessary, since the default environment should include system32,
+    # but keep this here to be safe, since it's needed to find reg.exe which the MSVC
+    # bat scripts use.
+    sys32_dir = os.path.join(os.environ.get("SystemRoot", os.environ.get("windir",r"C:\Windows\system32")),"System32")
+
+    if sys32_dir not in normenv['PATH']:
+        normenv['PATH'] = normenv['PATH'] + os.pathsep + sys32_dir
+
+    debug("PATH: %s"%normenv['PATH'])
+
     return normenv
 
 def get_output(vcbat, args = None, env = None):
     """Parse the output of given bat file, with given args."""
-    
+
     if env is None:
         # Create a blank environment, for use in launching the tools
         env = SCons.Environment.Environment(tools=[])
@@ -136,6 +146,11 @@ def get_output(vcbat, args = None, env = None):
     # settings in vs.py.
     vars = [
         'COMSPEC',
+# VS100 and VS110: Still set, but modern MSVC setup scripts will
+# discard these if registry has values.  However Intel compiler setup
+# script still requires these as of 2013/2014.
+        'VS110COMNTOOLS',
+        'VS100COMNTOOLS',
         'VS90COMNTOOLS',
         'VS80COMNTOOLS',
         'VS71COMNTOOLS',
@@ -164,6 +179,11 @@ def get_output(vcbat, args = None, env = None):
     # and won't work under Pythons not built with threading.
     stdout = popen.stdout.read()
     stderr = popen.stderr.read()
+
+    # Extra debug logic, uncomment if necessar
+#     debug('get_output():stdout:%s'%stdout)
+#     debug('get_output():stderr:%s'%stderr)
+
     if stderr:
         # TODO: find something better to do with stderr;
         # this at least prevents errors from getting swallowed.
@@ -194,7 +214,7 @@ def parse_output(output, keep = ("INCLUDE", "LIB", "LIBPATH", "PATH")):
                 p = p.encode('mbcs')
                 # XXX: For some reason, VC98 .bat file adds "" around the PATH
                 # values, and it screws up the environment later, so we strip
-                # it. 
+                # it.
                 p = p.strip('"')
                 dkeep[key].append(p)
 
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/MSCommon/netframework.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/MSCommon/netframework.py
similarity index 92%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/MSCommon/netframework.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/MSCommon/netframework.py
index cc5aaf1bf0bb6c5818523f04c0ac548db3247264..0606e27bc5d140eeb74c718b2919255d1928489b 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/MSCommon/netframework.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/MSCommon/netframework.py
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -20,7 +20,7 @@
 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
-__revision__ = "src/engine/SCons/Tool/MSCommon/netframework.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/MSCommon/netframework.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 __doc__ = """
 """
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/MSCommon/sdk.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/MSCommon/sdk.py
similarity index 92%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/MSCommon/sdk.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/MSCommon/sdk.py
index fd22cd7be2aca4bea7c78d182e46f54554754cad..537f367c6d790134d48b61fe428797ac7895f0cd 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/MSCommon/sdk.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/MSCommon/sdk.py
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -19,9 +19,9 @@
 # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-#
 
-__revision__ = "src/engine/SCons/Tool/MSCommon/sdk.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+
+__revision__ = "src/engine/SCons/Tool/MSCommon/sdk.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 __doc__ = """Module to detect the Platform/Windows SDK
 
@@ -172,6 +172,26 @@ SDK70VCSetupScripts =    { 'x86'      : r'bin\vcvars32.bat',
 #
 # If you update this list, update the documentation in Tool/mssdk.xml.
 SupportedSDKList = [
+    WindowsSDK('7.1',
+               sanity_check_file=r'bin\SetEnv.Cmd',
+               include_subdir='include',
+               lib_subdir={
+                   'x86'       : ['lib'],
+                   'x86_64'    : [r'lib\x64'],
+                   'ia64'      : [r'lib\ia64'],
+               },
+               vc_setup_scripts = SDK70VCSetupScripts,
+              ),
+    WindowsSDK('7.0A',
+               sanity_check_file=r'bin\SetEnv.Cmd',
+               include_subdir='include',
+               lib_subdir={
+                   'x86'       : ['lib'],
+                   'x86_64'    : [r'lib\x64'],
+                   'ia64'      : [r'lib\ia64'],
+               },
+               vc_setup_scripts = SDK70VCSetupScripts,
+              ),
     WindowsSDK('7.0',
                sanity_check_file=r'bin\SetEnv.Cmd',
                include_subdir='include',
@@ -337,10 +357,13 @@ def mssdk_setup_env(env):
     elif 'MSSDK_VERSION' in env:
         sdk_version = env['MSSDK_VERSION']
         if sdk_version is None:
-            msg = "SDK version %s is not installed" % repr(mssdk)
+            msg = "SDK version is specified as None"  
             raise SCons.Errors.UserError(msg)
         sdk_version = env.subst(sdk_version)
         mssdk = get_sdk_by_version(sdk_version)
+        if mssdk is None:
+            msg = "SDK version %s is not installed" % sdk_version 
+            raise SCons.Errors.UserError(msg)
         sdk_dir = mssdk.get_sdk_dir()
         debug('sdk.py:mssdk_setup_env: Using MSSDK_VERSION:%s'%sdk_dir)
     elif 'MSVS_VERSION' in env:
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/MSCommon/vc.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/MSCommon/vc.py
similarity index 83%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/MSCommon/vc.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/MSCommon/vc.py
index 9bbec21702b8643aff9331002596a9a16e626aee..02a32a0fff3b1c3f993bc782825d807912485cc1 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/MSCommon/vc.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/MSCommon/vc.py
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -30,7 +30,7 @@
 #   * test on 64 bits XP +  VS 2005 (and VS 6 if possible)
 #   * SDK
 #   * Assembly
-__revision__ = "src/engine/SCons/Tool/MSCommon/vc.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/MSCommon/vc.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 __doc__ = """Module for Visual C/C++ detection and configuration.
 """
@@ -81,6 +81,7 @@ _ARCH_TO_CANONICAL = {
     "itanium"   : "ia64",
     "x86"       : "x86",
     "x86_64"    : "amd64",
+    "x86_amd64" : "x86_amd64", # Cross compile to 64 bit from 32bits
 }
 
 # Given a (host, target) tuple, return the argument for the bat file. Both host
@@ -88,6 +89,8 @@ _ARCH_TO_CANONICAL = {
 _HOST_TARGET_ARCH_TO_BAT_ARCH = {
     ("x86", "x86"): "x86",
     ("x86", "amd64"): "x86_amd64",
+    ("x86", "x86_amd64"): "x86_amd64",
+    ("amd64", "x86_amd64"): "x86_amd64", # This is present in (at least) VS2012 express
     ("amd64", "amd64"): "amd64",
     ("amd64", "x86"): "x86",
     ("x86", "ia64"): "x86_ia64"
@@ -129,9 +132,19 @@ def get_host_target(env):
 
     return (host, target,req_target_platform)
 
-_VCVER = ["11.0", "11.0Exp", "10.0", "10.0Exp", "9.0", "9.0Exp","8.0", "8.0Exp","7.1", "7.0", "6.0"]
+# If you update this, update SupportedVSList in Tool/MSCommon/vs.py, and the
+# MSVC_VERSION documentation in Tool/msvc.xml.
+_VCVER = ["14.0", "14.0Exp", "12.0", "12.0Exp", "11.0", "11.0Exp", "10.0", "10.0Exp", "9.0", "9.0Exp","8.0", "8.0Exp","7.1", "7.0", "6.0"]
 
 _VCVER_TO_PRODUCT_DIR = {
+        '14.0' : [
+            r'Microsoft\VisualStudio\14.0\Setup\VC\ProductDir'],
+        '14.0Exp' : [
+            r'Microsoft\VCExpress\14.0\Setup\VC\ProductDir'],
+        '12.0' : [
+            r'Microsoft\VisualStudio\12.0\Setup\VC\ProductDir'],
+        '12.0Exp' : [
+            r'Microsoft\VCExpress\12.0\Setup\VC\ProductDir'],
         '11.0': [
             r'Microsoft\VisualStudio\11.0\Setup\VC\ProductDir'],
         '11.0Exp' : [
@@ -256,15 +269,16 @@ def find_batch_file(env,msvc_version,host_arch,target_arch):
     
     installed_sdks=get_installed_sdks()
     for _sdk in installed_sdks:
-        sdk_bat_file=_sdk.get_sdk_vc_script(host_arch,target_arch)
-        sdk_bat_file_path=os.path.join(pdir,sdk_bat_file)
-        debug('vc.py:find_batch_file() sdk_bat_file_path:%s'%sdk_bat_file_path)
-        if os.path.exists(sdk_bat_file_path):
-            return (batfilename,sdk_bat_file_path)
+        sdk_bat_file = _sdk.get_sdk_vc_script(host_arch,target_arch)
+        if not sdk_bat_file:
+            debug("vc.py:find_batch_file() not found:%s"%_sdk)
         else:
-            debug("vc.py:find_batch_file() not found:%s"%sdk_bat_file_path)
-    else:
-        return (batfilename,None)
+            sdk_bat_file_path = os.path.join(pdir,sdk_bat_file)
+            if os.path.exists(sdk_bat_file_path): 
+                debug('vc.py:find_batch_file() sdk_bat_file_path:%s'%sdk_bat_file_path)
+                return (batfilename,sdk_bat_file_path)
+    return (batfilename,None)
+
 
 __INSTALLED_VCS_RUN = None
 
@@ -295,8 +309,21 @@ def reset_installed_vcs():
     """Make it try again to find VC.  This is just for the tests."""
     __INSTALLED_VCS_RUN = None
 
+# Running these batch files isn't cheap: most of the time spent in
+# msvs.generate() is due to vcvars*.bat.  In a build that uses "tools='msvs'"
+# in multiple environments, for example:
+#    env1 = Environment(tools='msvs')
+#    env2 = Environment(tools='msvs')
+# we can greatly improve the speed of the second and subsequent Environment
+# (or Clone) calls by memoizing the environment variables set by vcvars*.bat.
+script_env_stdout_cache = {}
 def script_env(script, args=None):
-    stdout = common.get_output(script, args)
+    cache_key = (script, args)
+    stdout = script_env_stdout_cache.get(cache_key, None)
+    if stdout is None:
+        stdout = common.get_output(script, args)
+        script_env_stdout_cache[cache_key] = stdout
+
     # Stupid batch files do not set return code: we take a look at the
     # beginning of the output for an error message instead
     olines = stdout.splitlines()
@@ -357,13 +384,23 @@ def msvc_find_valid_batch_script(env,version):
     # target platform
     (host_platform, target_platform,req_target_platform) = get_host_target(env)
 
-    # If the user hasn't specifically requested a TARGET_ARCH, and
-    # The TARGET_ARCH is amd64 then also try 32 bits if there are no viable
-    # 64 bit tools installed
     try_target_archs = [target_platform]
-    if not req_target_platform and target_platform in ('amd64','x86_64'):
+    debug("msvs_find_valid_batch_script(): req_target_platform %s target_platform:%s"%(req_target_platform,target_platform))
+
+    # VS2012 has a "cross compile" environment to build 64 bit 
+    # with x86_amd64 as the argument to the batch setup script
+    if req_target_platform in ('amd64','x86_64'):
+        try_target_archs.append('x86_amd64')
+    elif not req_target_platform and target_platform in ['amd64','x86_64']:
+        # There may not be "native" amd64, but maybe "cross" x86_amd64 tools
+        try_target_archs.append('x86_amd64')
+        # If the user hasn't specifically requested a TARGET_ARCH, and
+        # The TARGET_ARCH is amd64 then also try 32 bits if there are no viable
+        # 64 bit tools installed
         try_target_archs.append('x86')
 
+    debug("msvs_find_valid_batch_script(): host_platform: %s try_target_archs:%s"%(host_platform, try_target_archs))
+
     d = None
     for tp in try_target_archs:
         # Set to current arch.
@@ -399,16 +436,20 @@ def msvc_find_valid_batch_script(env,version):
             except BatchFileExecutionError, e:
                 debug('vc.py:msvc_find_valid_batch_script() use_script 3: failed running VC script %s: %s: Error:%s'%(repr(vc_script),arg,e))
                 vc_script=None
+                continue
         if not vc_script and sdk_script:
             debug('vc.py:msvc_find_valid_batch_script() use_script 4: trying sdk script: %s'%(sdk_script))
             try:
-                d = script_env(sdk_script,args=[])
+                d = script_env(sdk_script)
             except BatchFileExecutionError,e:
                 debug('vc.py:msvc_find_valid_batch_script() use_script 5: failed running SDK script %s: Error:%s'%(repr(sdk_script),e))
                 continue
         elif not vc_script and not sdk_script:
             debug('vc.py:msvc_find_valid_batch_script() use_script 6: Neither VC script nor SDK script found')
             continue
+        
+        debug("vc.py:msvc_find_valid_batch_script() Found a working script/target: %s %s"%(repr(sdk_script),arg))
+        break # We've found a working target_platform, so stop looking
     
     # If we cannot find a viable installed compiler, reset the TARGET_ARCH
     # To it's initial value
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/MSCommon/vs.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/MSCommon/vs.py
similarity index 86%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/MSCommon/vs.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/MSCommon/vs.py
index f5feb2a448fb084e45d846d94c4e41f5b74089a0..619cbe58d376bec7eed0c155c36c0482218889db 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/MSCommon/vs.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/MSCommon/vs.py
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -21,7 +21,7 @@
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/MSCommon/vs.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/MSCommon/vs.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 __doc__ = """Module to detect Visual Studio and/or Visual C/C++
 """
@@ -73,7 +73,7 @@ class VisualStudio(object):
             debug('find_vs_dir():  no installed VC %s' % self.vc_version)
             return None
         return dir
-        
+
     def find_vs_dir_by_reg(self):
         root = 'Software\\'
 
@@ -91,13 +91,13 @@ class VisualStudio(object):
                 debug('find_vs_dir_by_reg(): found VS in registry: %s' % comps)
                 return comps
         return None
-    
+
     def find_vs_dir(self):
         """ Can use registry or location of VC to find vs dir
         First try to find by registry, and if that fails find via VC dir
         """
-        
-        
+
+
         if True:
             vs_dir=self.find_vs_dir_by_reg()
             return vs_dir
@@ -115,7 +115,7 @@ class VisualStudio(object):
             debug('find_executable():  %s not on file system' % executable)
             return None
         return executable
-    
+
     #
 
     def get_batch_file(self):
@@ -199,102 +199,118 @@ class VisualStudio(object):
 # good money for in preference to whatever Microsoft makes available
 # for free.
 #
-# If you update this list, update the documentation in Tool/msvs.xml.
+# If you update this list, update _VCVER and _VCVER_TO_PRODUCT_DIR in
+# Tool/MSCommon/vc.py, and the MSVC_VERSION documentation in Tool/msvc.xml.
 
 SupportedVSList = [
-    # Visual Studio 2010
-    # TODO: find the settings, perhaps from someone with a CTP copy?
-    #VisualStudio('TBD',
-    #             hkey_root=r'TBD',
-    #             common_tools_var='TBD',
-    #             executable_path=r'TBD',
-    #             default_dirname='TBD',
-    #),
-
-    # Visual Studio 11
-    # The batch file we look for is in the VC directory,
-    # so the devenv.com executable is up in ..\..\Common7\IDE.
+    # Visual Studio 2015
+    VisualStudio('14.0',
+                 vc_version='14.0',
+                 sdk_version='10.0A',
+                 hkeys=[r'Microsoft\VisualStudio\14.0\Setup\VS\ProductDir'],
+                 common_tools_var='VS140COMNTOOLS',
+                 executable_path=r'Common7\IDE\devenv.com',
+                 batch_file_path=r'Common7\Tools\vsvars32.bat',
+                 supported_arch=['x86', 'amd64', "arm"],
+    ),
+ 
+    # Visual C++ 2015 Express Edition (for Desktop)
+    VisualStudio('14.0Exp',
+                 vc_version='14.0',
+                 sdk_version='10.0A',
+                 hkeys=[r'Microsoft\VisualStudio\14.0\Setup\VS\ProductDir'],
+                 common_tools_var='VS140COMNTOOLS',
+                 executable_path=r'Common7\IDE\WDExpress.exe',
+                 batch_file_path=r'Common7\Tools\vsvars32.bat',
+                 supported_arch=['x86', 'amd64', "arm"],
+    ),
+
+    # Visual Studio 2013
+    VisualStudio('12.0',
+                 vc_version='12.0',
+                 sdk_version='8.1A',
+                 hkeys=[r'Microsoft\VisualStudio\12.0\Setup\VS\ProductDir'],
+                 common_tools_var='VS120COMNTOOLS',
+                 executable_path=r'Common7\IDE\devenv.com',
+                 batch_file_path=r'Common7\Tools\vsvars32.bat',
+                 supported_arch=['x86', 'amd64'],
+    ),
+
+    # Visual C++ 2013 Express Edition (for Desktop)
+    VisualStudio('12.0Exp',
+                 vc_version='12.0',
+                 sdk_version='8.1A',
+                 hkeys=[r'Microsoft\VisualStudio\12.0\Setup\VS\ProductDir'],
+                 common_tools_var='VS120COMNTOOLS',
+                 executable_path=r'Common7\IDE\WDExpress.exe',
+                 batch_file_path=r'Common7\Tools\vsvars32.bat',
+                 supported_arch=['x86', 'amd64'],
+    ),
+
+    # Visual Studio 2012
     VisualStudio('11.0',
-                 sdk_version='6.1',
+                 sdk_version='8.0A',
                  hkeys=[r'Microsoft\VisualStudio\11.0\Setup\VS\ProductDir'],
                  common_tools_var='VS110COMNTOOLS',
                  executable_path=r'Common7\IDE\devenv.com',
                  batch_file_path=r'Common7\Tools\vsvars32.bat',
-                 default_dirname='Microsoft Visual Studio 11',
                  supported_arch=['x86', 'amd64'],
     ),
 
-    # Visual C++ 11 Express Edition
-    # The batch file we look for is in the VC directory,
-    # so the VCExpress.exe executable is up in ..\..\Common7\IDE.
+    # Visual C++ 2012 Express Edition (for Desktop)
     VisualStudio('11.0Exp',
                  vc_version='11.0',
-                 sdk_version='6.1',
-                 hkeys=[r'Microsoft\VCExpress\11.0\Setup\VS\ProductDir'],
+                 sdk_version='8.0A',
+                 hkeys=[r'Microsoft\VisualStudio\11.0\Setup\VS\ProductDir'],
                  common_tools_var='VS110COMNTOOLS',
-                 executable_path=r'Common7\IDE\VCExpress.exe',
+                 executable_path=r'Common7\IDE\WDExpress.exe',
                  batch_file_path=r'Common7\Tools\vsvars32.bat',
-                 default_dirname='Microsoft Visual Studio 11',
-                 supported_arch=['x86'],
+                 supported_arch=['x86', 'amd64'],
     ),
 
     # Visual Studio 2010
-    # The batch file we look for is in the VC directory,
-    # so the devenv.com executable is up in ..\..\Common7\IDE.
     VisualStudio('10.0',
-                 sdk_version='6.1',
+                 sdk_version='7.0A',
                  hkeys=[r'Microsoft\VisualStudio\10.0\Setup\VS\ProductDir'],
                  common_tools_var='VS100COMNTOOLS',
                  executable_path=r'Common7\IDE\devenv.com',
                  batch_file_path=r'Common7\Tools\vsvars32.bat',
-                 default_dirname='Microsoft Visual Studio 10',
                  supported_arch=['x86', 'amd64'],
     ),
 
     # Visual C++ 2010 Express Edition
-    # The batch file we look for is in the VC directory,
-    # so the VCExpress.exe executable is up in ..\..\Common7\IDE.
     VisualStudio('10.0Exp',
                  vc_version='10.0',
-                 sdk_version='6.1',
+                 sdk_version='7.0A',
                  hkeys=[r'Microsoft\VCExpress\10.0\Setup\VS\ProductDir'],
                  common_tools_var='VS100COMNTOOLS',
                  executable_path=r'Common7\IDE\VCExpress.exe',
                  batch_file_path=r'Common7\Tools\vsvars32.bat',
-                 default_dirname='Microsoft Visual Studio 10',
                  supported_arch=['x86'],
     ),
 
     # Visual Studio 2008
-    # The batch file we look for is in the VC directory,
-    # so the devenv.com executable is up in ..\..\Common7\IDE.
     VisualStudio('9.0',
-                 sdk_version='6.1',
+                 sdk_version='6.0A',
                  hkeys=[r'Microsoft\VisualStudio\9.0\Setup\VS\ProductDir'],
                  common_tools_var='VS90COMNTOOLS',
                  executable_path=r'Common7\IDE\devenv.com',
                  batch_file_path=r'Common7\Tools\vsvars32.bat',
-                 default_dirname='Microsoft Visual Studio 9',
                  supported_arch=['x86', 'amd64'],
     ),
 
     # Visual C++ 2008 Express Edition
-    # The batch file we look for is in the VC directory,
-    # so the VCExpress.exe executable is up in ..\..\Common7\IDE.
     VisualStudio('9.0Exp',
                  vc_version='9.0',
-                 sdk_version='6.1',
+                 sdk_version='6.0A',
                  hkeys=[r'Microsoft\VCExpress\9.0\Setup\VS\ProductDir'],
                  common_tools_var='VS90COMNTOOLS',
                  executable_path=r'Common7\IDE\VCExpress.exe',
                  batch_file_path=r'Common7\Tools\vsvars32.bat',
-                 default_dirname='Microsoft Visual Studio 9',
                  supported_arch=['x86'],
     ),
 
     # Visual Studio 2005
-    # The batch file we look for is in the VC directory,
-    # so the devenv.com executable is up in ..\..\Common7\IDE.
     VisualStudio('8.0',
                  sdk_version='6.0A',
                  hkeys=[r'Microsoft\VisualStudio\8.0\Setup\VS\ProductDir'],
@@ -306,8 +322,6 @@ SupportedVSList = [
     ),
 
     # Visual C++ 2005 Express Edition
-    # The batch file we look for is in the VC directory,
-    # so the VCExpress.exe executable is up in ..\..\Common7\IDE.
     VisualStudio('8.0Exp',
                  vc_version='8.0Exp',
                  sdk_version='6.0A',
@@ -320,8 +334,6 @@ SupportedVSList = [
     ),
 
     # Visual Studio .NET 2003
-    # The batch file we look for is in the Common7\Tools directory,
-    # so the devenv.com executable is next door in ..\IDE.
     VisualStudio('7.1',
                  sdk_version='6.0',
                  hkeys=[r'Microsoft\VisualStudio\7.1\Setup\VS\ProductDir'],
@@ -333,8 +345,6 @@ SupportedVSList = [
     ),
 
     # Visual Studio .NET
-    # The batch file we look for is in the Common7\Tools directory,
-    # so the devenv.com executable is next door in ..\IDE.
     VisualStudio('7.0',
                  sdk_version='2003R2',
                  hkeys=[r'Microsoft\VisualStudio\7.0\Setup\VS\ProductDir'],
@@ -393,11 +403,11 @@ def reset_installed_visual_studios():
     InstalledVSMap  = None
     for vs in SupportedVSList:
         vs.reset()
-        
+
     # Need to clear installed VC's as well as they are used in finding
     # installed VS's
     SCons.Tool.MSCommon.vc.reset_installed_vcs()
-        
+
 
 # We may be asked to update multiple construction environments with
 # SDK information.  When doing this, we check on-disk for whether
@@ -462,7 +472,7 @@ def get_default_version(env):
 
     If no version was requested by the user through the MSVS environment
     variable, query all the available the visual studios through
-    query_versions, and take the highest one.
+    get_installed_visual_studios, and take the highest one.
 
     Return
     ------
@@ -470,6 +480,7 @@ def get_default_version(env):
         the default version.
     """
     if 'MSVS' not in env or not SCons.Util.is_Dict(env['MSVS']):
+        # get all versions, and remember them for speed later
         versions = [vs.version for vs in get_installed_visual_studios()]
         env['MSVS'] = {'VERSIONS' : versions}
     else:
@@ -479,6 +490,8 @@ def get_default_version(env):
         if versions:
             env['MSVS_VERSION'] = versions[0] #use highest version by default
         else:
+            debug('get_default_version: WARNING: no installed versions found, '
+                  'using first in SupportedVSList (%s)'%SupportedVSList[0].version)
             env['MSVS_VERSION'] = SupportedVSList[0].version
 
     env['MSVS']['VERSION'] = env['MSVS_VERSION']
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/Perforce.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/Perforce.py
similarity index 94%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/Perforce.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/Perforce.py
index ade9e88a74685e489ee957565c1a568a51b018c1..ddff25fed3b366b2da687a59ef37d9b1fcf216c9 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/Perforce.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/Perforce.py
@@ -8,7 +8,7 @@ selection method.
 
 """
 
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -29,7 +29,7 @@ selection method.
 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
-__revision__ = "src/engine/SCons/Tool/Perforce.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/Perforce.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import os
 
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/PharLapCommon.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/PharLapCommon.py
similarity index 95%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/PharLapCommon.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/PharLapCommon.py
index 0f54a2ba94c7c4fc0cee97252fd1b933847e40b8..576dea1aee75fd1b5d05aa3f8fa3a763fcabad41 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/PharLapCommon.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/PharLapCommon.py
@@ -7,7 +7,7 @@ Phar Lap ETS tool chain.  Right now, this is linkloc and
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -29,7 +29,7 @@ Phar Lap ETS tool chain.  Right now, this is linkloc and
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/PharLapCommon.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/PharLapCommon.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import os
 import os.path
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/RCS.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/RCS.py
similarity index 91%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/RCS.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/RCS.py
index cc33a4eeaf74cf0c8e0a7153c6bf7be055545214..d63bcd4c14d3148c50011bd34065e009f7709c04 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/RCS.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/RCS.py
@@ -8,7 +8,7 @@ selection method.
 
 """
 
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -29,7 +29,7 @@ selection method.
 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
-__revision__ = "src/engine/SCons/Tool/RCS.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/RCS.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import SCons.Action
 import SCons.Builder
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/SCCS.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/SCCS.py
similarity index 91%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/SCCS.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/SCCS.py
index 5e35a875819e4323914a307e01ea91298b6e0c97..76f69e7f912e42afa2c8922c50ab05ccae53b9d8 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/SCCS.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/SCCS.py
@@ -8,7 +8,7 @@ selection method.
 
 """
 
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -29,7 +29,7 @@ selection method.
 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
-__revision__ = "src/engine/SCons/Tool/SCCS.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/SCCS.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import SCons.Action
 import SCons.Builder
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/Subversion.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/Subversion.py
similarity index 92%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/Subversion.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/Subversion.py
index 212850fe353d79cd719584479e802691d9ed574e..85470b17fb2a4f43c327c08bcec9e5bd0f70f680 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/Subversion.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/Subversion.py
@@ -8,7 +8,7 @@ selection method.
 
 """
 
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -29,7 +29,7 @@ selection method.
 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
-__revision__ = "src/engine/SCons/Tool/Subversion.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/Subversion.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import os.path
 
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/__init__.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/__init__.py
similarity index 76%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/__init__.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/__init__.py
index 5bee64dd9a5346c0a534aefa21e7c78630aff130..bb9729a1cdde799b5b0094aa051f744d0ffa716d 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/__init__.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/__init__.py
@@ -14,7 +14,7 @@ tool definition.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -35,10 +35,13 @@ tool definition.
 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
-__revision__ = "src/engine/SCons/Tool/__init__.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/__init__.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import imp
 import sys
+import re
+import os
+import shutil
 
 import SCons.Builder
 import SCons.Errors
@@ -233,6 +236,151 @@ def createStaticLibBuilder(env):
 
     return static_lib
 
+def VersionShLibLinkNames(version, libname, env):
+    """Generate names of symlinks to the versioned shared library"""
+    Verbose = False
+    platform = env.subst('$PLATFORM')
+    shlib_suffix = env.subst('$SHLIBSUFFIX')
+    shlink_flags = SCons.Util.CLVar(env.subst('$SHLINKFLAGS'))
+
+    linknames = []
+    if version.count(".") != 2:
+        # We need a version string of the form x.y.z to proceed
+        # Several changes need to be made to support versions like x.y
+        raise ValueError
+
+    if platform == 'darwin':
+        # For libfoo.x.y.z.dylib, linknames libfoo.so
+        suffix_re = re.escape('.' + version + shlib_suffix)
+        linkname = re.sub(suffix_re, shlib_suffix, libname)
+        if Verbose:
+            print "VersionShLibLinkNames: linkname = ",linkname
+        linknames.append(linkname)
+    elif platform == 'posix' or platform == 'sunos':
+        if sys.platform.startswith('openbsd'):
+            # OpenBSD uses x.y shared library versioning numbering convention
+            # and doesn't use symlinks to backwards-compatible libraries
+            return []
+        # For libfoo.so.x.y.z, linknames libfoo.so libfoo.so.x.y libfoo.so.x
+        suffix_re = re.escape(shlib_suffix + '.' + version)
+        # First linkname has no version number
+        linkname = re.sub(suffix_re, shlib_suffix, libname)
+        if Verbose:
+            print "VersionShLibLinkNames: linkname = ",linkname
+        linknames.append(linkname)
+        versionparts = version.split('.')
+        major_name = linkname + "." + versionparts[0]
+        minor_name = major_name + "." + versionparts[1]
+        #Only add link for major_name
+        #for linkname in [major_name, minor_name]:
+        for linkname in [major_name, ]:
+            if Verbose:
+                print "VersionShLibLinkNames: linkname ",linkname, ", target ",libname
+            linknames.append(linkname)
+    # note: no Windows case here (win32 or cygwin);
+    # MSVC doesn't support this type of versioned shared libs.
+    # (could probably do something for MinGW though)
+    return linknames
+
+def VersionedSharedLibrary(target = None, source= None, env=None):
+    """Build a shared library. If the environment has SHLIBVERSION
+defined make a versioned shared library and create the appropriate
+symlinks for the platform we are on"""
+    Verbose = False
+    try:
+        version = env.subst('$SHLIBVERSION')
+    except KeyError:
+        version = None
+
+    # libname includes the version number if one was given
+    libname = getattr(target[0].attributes, 'shlibname', target[0].name)
+    platform = env.subst('$PLATFORM')
+    shlib_suffix = env.subst('$SHLIBSUFFIX')
+    shlink_flags = SCons.Util.CLVar(env.subst('$SHLINKFLAGS'))
+    if Verbose:
+        print "VersionShLib: libname      = ",libname
+        print "VersionShLib: platform     = ",platform
+        print "VersionShLib: shlib_suffix = ",shlib_suffix
+        print "VersionShLib: target = ",str(target[0])
+
+    if version:
+        # set the shared library link flags
+        if platform == 'posix':
+            shlink_flags += [ '-Wl,-Bsymbolic' ]
+            # OpenBSD doesn't usually use SONAME for libraries
+            if not sys.platform.startswith('openbsd'):
+                # continue setup of shlink flags for all other POSIX systems
+                suffix_re = re.escape(shlib_suffix + '.' + version)
+                (major, age, revision) = version.split(".")
+                # soname will have only the major version number in it
+                soname = re.sub(suffix_re, shlib_suffix, libname) + '.' + major
+                shlink_flags += [ '-Wl,-soname=%s' % soname ]
+                if Verbose:
+                    print " soname ",soname,", shlink_flags ",shlink_flags
+        elif platform == 'sunos':
+            suffix_re = re.escape(shlib_suffix + '.' + version)
+            (major, age, revision) = version.split(".")
+            soname = re.sub(suffix_re, shlib_suffix, libname) + '.' + major
+            shlink_flags += [ '-h', soname ]
+        elif platform == 'cygwin':
+            shlink_flags += [ '-Wl,-Bsymbolic',
+                              '-Wl,--out-implib,${TARGET.base}.a' ]
+        elif platform == 'darwin':
+            shlink_flags += [ '-current_version', '%s' % version,
+                              '-compatibility_version', '%s' % version,
+                              '-undefined', 'dynamic_lookup' ]
+        if Verbose:
+            print "VersionShLib: shlink_flags = ",shlink_flags
+        envlink = env.Clone()
+        envlink['SHLINKFLAGS'] = shlink_flags
+    else:
+        envlink = env
+
+    result = SCons.Defaults.ShLinkAction(target, source, envlink)
+
+    if version:
+        # here we need the full pathname so the links end up in the right directory
+        libname = getattr(target[0].attributes, 'shlibpath', target[0].get_internal_path())
+        if Verbose:
+            print "VerShLib: target lib is = ", libname
+            print "VerShLib: name is = ", target[0].name
+            print "VerShLib: dir is = ", target[0].dir.path
+        linknames = VersionShLibLinkNames(version, libname, env)
+        if Verbose:
+            print "VerShLib: linknames ",linknames
+        # Here we just need the file name w/o path as the target of the link
+        lib_ver = getattr(target[0].attributes, 'shlibname', target[0].name)
+        # make symlink of adjacent names in linknames
+        for count in range(len(linknames)):
+            linkname = linknames[count]
+            if count > 0:
+                try:
+                    os.remove(lastlinkname)
+                except:
+                    pass
+                os.symlink(os.path.basename(linkname),lastlinkname)
+                if Verbose:
+                    print "VerShLib: made sym link of %s -> %s" % (lastlinkname,linkname)
+            lastlinkname = linkname
+        # finish chain of sym links with link to the actual library
+        if len(linknames)>0:
+            try:
+                os.remove(lastlinkname)
+            except:
+                pass
+            os.symlink(lib_ver,lastlinkname)
+            if Verbose:
+                print "VerShLib: made sym link of %s -> %s" % (linkname, lib_ver)
+    return result
+
+# Fix http://scons.tigris.org/issues/show_bug.cgi?id=2903 :
+# Ensure we still depend on SCons.Defaults.ShLinkAction command line which is $SHLINKCOM.
+# This was tricky because we don't want changing LIBPATH to cause a rebuild, but
+# changing other link args should.  LIBPATH has $( ... $) around it but until this
+# fix, when the varlist was added to the build sig those ignored parts weren't getting
+# ignored.
+ShLibAction = SCons.Action.Action(VersionedSharedLibrary, None, varlist=['SHLINKCOM'])
+
 def createSharedLibBuilder(env):
     """This is a utility function that creates the SharedLibrary
     Builder in an Environment if it is not there already.
@@ -245,7 +393,7 @@ def createSharedLibBuilder(env):
     except KeyError:
         import SCons.Defaults
         action_list = [ SCons.Defaults.SharedCheck,
-                        SCons.Defaults.ShLinkAction ]
+                        ShLibAction ]
         shared_lib = SCons.Builder.Builder(action = action_list,
                                            emitter = "$SHLIBEMITTER",
                                            prefix = '$SHLIBPREFIX',
@@ -527,13 +675,16 @@ class ToolInitializer(object):
 	# the ToolInitializer class.
 
 def Initializers(env):
-    ToolInitializer(env, ['install'], ['_InternalInstall', '_InternalInstallAs'])
+    ToolInitializer(env, ['install'], ['_InternalInstall', '_InternalInstallAs', '_InternalInstallVersionedLib'])
     def Install(self, *args, **kw):
         return self._InternalInstall(*args, **kw)
     def InstallAs(self, *args, **kw):
         return self._InternalInstallAs(*args, **kw)
+    def InstallVersionedLib(self, *args, **kw):
+        return self._InternalInstallVersionedLib(*args, **kw)
     env.AddMethod(Install)
     env.AddMethod(InstallAs)
+    env.AddMethod(InstallVersionedLib)
 
 def FindTool(tools, env):
     for tool in tools:
@@ -563,7 +714,7 @@ def tool_list(platform, env):
         assemblers = ['masm', 'nasm', 'gas', '386asm' ]
         fortran_compilers = ['gfortran', 'g77', 'ifl', 'cvf', 'f95', 'f90', 'fortran']
         ars = ['mslib', 'ar', 'tlib']
-        other_plat_tools=['msvs','midl']
+        other_plat_tools = ['msvs', 'midl']
     elif str(platform) == 'os2':
         "prefer IBM tools on OS/2"
         linkers = ['ilink', 'gnulink', ]#'mslink']
@@ -613,6 +764,14 @@ def tool_list(platform, env):
         assemblers = ['as']
         fortran_compilers = ['gfortran', 'f95', 'f90', 'g77']
         ars = ['ar']
+    elif str(platform) == 'cygwin':
+        "prefer GNU tools on Cygwin, except for a platform-specific linker"
+        linkers = ['cyglink', 'mslink', 'ilink']
+        c_compilers = ['gcc', 'msvc', 'intelc', 'icc', 'cc']
+        cxx_compilers = ['g++', 'msvc', 'intelc', 'icc', 'c++']
+        assemblers = ['gas', 'nasm', 'masm']
+        fortran_compilers = ['gfortran', 'g77', 'ifort', 'ifl', 'f95', 'f90', 'f77']
+        ars = ['ar', 'mslib']
     else:
         "prefer GNU tools on all other platforms"
         linkers = ['gnulink', 'mslink', 'ilink']
@@ -622,6 +781,9 @@ def tool_list(platform, env):
         fortran_compilers = ['gfortran', 'g77', 'ifort', 'ifl', 'f95', 'f90', 'f77']
         ars = ['ar', 'mslib']
 
+    if not str(platform) == 'win32':
+        other_plat_tools += ['m4', 'rpm']
+
     c_compiler = FindTool(c_compilers, env) or c_compilers[0]
 
     # XXX this logic about what tool provides what should somehow be
@@ -645,12 +807,13 @@ def tool_list(platform, env):
         fortran_compiler = FindTool(fortran_compilers, env) or fortran_compilers[0]
         ar = FindTool(ars, env) or ars[0]
 
+    d_compilers = ['dmd', 'gdc', 'ldc']
+    d_compiler = FindTool(d_compilers, env) or d_compilers[0]
+
     other_tools = FindAllTools(other_plat_tools + [
-                               'dmd',
                                #TODO: merge 'install' into 'filesystem' and
                                # make 'filesystem' the default
                                'filesystem',
-                               'm4',
                                'wix', #'midl', 'msvs',
                                # Parser generators
                                'lex', 'yacc',
@@ -662,14 +825,14 @@ def tool_list(platform, env):
                                'dvipdf', 'dvips', 'gs',
                                'tex', 'latex', 'pdflatex', 'pdftex',
                                # Archivers
-                               'tar', 'zip', 'rpm',
+                               'tar', 'zip',
                                # SourceCode factories
                                'BitKeeper', 'CVS', 'Perforce',
                                'RCS', 'SCCS', # 'Subversion',
                                ], env)
 
     tools = ([linker, c_compiler, cxx_compiler,
-              fortran_compiler, assembler, ar]
+              fortran_compiler, assembler, ar, d_compiler]
              + other_tools)
 
     return [x for x in tools if x]
@@ -679,3 +842,4 @@ def tool_list(platform, env):
 # indent-tabs-mode:nil
 # End:
 # vim: set expandtab tabstop=4 shiftwidth=4:
+
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/aixc++.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/aixc++.py
similarity index 72%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/aixc++.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/aixc++.py
index fecfe766f75d14d5e3e6780dc9ed958a742a645d..864fcdffe594ec3d2651e3f4a59003d5abd82626 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/aixc++.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/aixc++.py
@@ -9,7 +9,7 @@ selection method.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -31,7 +31,7 @@ selection method.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/aixc++.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/aixc++.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import os.path
 
@@ -43,32 +43,25 @@ packages = ['vacpp.cmp.core', 'vacpp.cmp.batch', 'vacpp.cmp.C', 'ibmcxx.cmp']
 
 def get_xlc(env):
     xlc = env.get('CXX', 'xlC')
-    xlc_r = env.get('SHCXX', 'xlC_r')
-    return SCons.Platform.aix.get_xlc(env, xlc, xlc_r, packages)
-
-def smart_cxxflags(source, target, env, for_signature):
-    build_dir = env.GetBuildPath()
-    if build_dir:
-        return '-qtempinc=' + os.path.join(build_dir, 'tempinc')
-    return ''
+    return SCons.Platform.aix.get_xlc(env, xlc, packages)
 
 def generate(env):
     """Add Builders and construction variables for xlC / Visual Age
     suite to an Environment."""
-    path, _cxx, _shcxx, version = get_xlc(env)
-    if path:
+    path, _cxx, version = get_xlc(env)
+    if path and _cxx:
         _cxx = os.path.join(path, _cxx)
-        _shcxx = os.path.join(path, _shcxx)
+
+    if 'CXX' not in env:
+        env['CXX'] = _cxx
 
     cplusplus.generate(env)
 
-    env['CXX'] = _cxx
-    env['SHCXX'] = _shcxx
-    env['CXXVERSION'] = version
-    env['SHOBJSUFFIX'] = '.pic.o'
+    if version:
+        env['CXXVERSION'] = version
     
 def exists(env):
-    path, _cxx, _shcxx, version = get_xlc(env)
+    path, _cxx, version = get_xlc(env)
     if path and _cxx:
         xlc = os.path.join(path, _cxx)
         if os.path.exists(xlc):
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/aixcc.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/aixcc.py
similarity index 78%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/aixcc.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/aixcc.py
index d611fdcf093b67a13f23bbe34791b7aac7a554b3..02e06499fb07e55aa5a64907d3f0cb7069c31bf3 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/aixcc.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/aixcc.py
@@ -8,7 +8,7 @@ selection method.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -30,7 +30,7 @@ selection method.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/aixcc.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/aixcc.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import os.path
 
@@ -42,25 +42,25 @@ packages = ['vac.C', 'ibmcxx.cmp']
 
 def get_xlc(env):
     xlc = env.get('CC', 'xlc')
-    xlc_r = env.get('SHCC', 'xlc_r')
-    return SCons.Platform.aix.get_xlc(env, xlc, xlc_r, packages)
+    return SCons.Platform.aix.get_xlc(env, xlc, packages)
 
 def generate(env):
     """Add Builders and construction variables for xlc / Visual Age
     suite to an Environment."""
-    path, _cc, _shcc, version = get_xlc(env)
-    if path:
+    path, _cc, version = get_xlc(env)
+    if path and _cc:
         _cc = os.path.join(path, _cc)
-        _shcc = os.path.join(path, _shcc)
+
+    if 'CC' not in env:
+        env['CC'] = _cc
 
     cc.generate(env)
 
-    env['CC'] = _cc
-    env['SHCC'] = _shcc
-    env['CCVERSION'] = version
+    if version:
+        env['CCVERSION'] = version
 
 def exists(env):
-    path, _cc, _shcc, version = get_xlc(env)
+    path, _cc, version = get_xlc(env)
     if path and _cc:
         xlc = os.path.join(path, _cc)
         if os.path.exists(xlc):
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/aixf77.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/aixf77.py
similarity index 92%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/aixf77.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/aixf77.py
index c3e062e00bffccf6581b0850bb68adfa1d296521..5327cf737a5dcdae246d6c330f90e07c1e86a52a 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/aixf77.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/aixf77.py
@@ -8,7 +8,7 @@ selection method.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -30,7 +30,7 @@ selection method.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/aixf77.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/aixf77.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import os.path
 
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/aixlink.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/aixlink.py
similarity index 80%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/aixlink.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/aixlink.py
index 3a064bd2c7bf16ae76db8978a33f191970e4f2ef..7ad9cc61e2806ff245e70c723b07e44c5e4b30c6 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/aixlink.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/aixlink.py
@@ -8,7 +8,7 @@ selection method.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -30,14 +30,13 @@ selection method.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/aixlink.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/aixlink.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import os
 import os.path
 
 import SCons.Util
 
-import aixcc
 import link
 
 cplusplus = __import__('c++', globals(), locals(), [])
@@ -62,12 +61,14 @@ def generate(env):
     env['SHLIBSUFFIX']    = '.a'
 
 def exists(env):
-    path, _cc, _shcc, version = aixcc.get_xlc(env)
-    if path and _cc:
-        xlc = os.path.join(path, _cc)
-        if os.path.exists(xlc):
-            return xlc
-    return None
+    # TODO: sync with link.smart_link() to choose a linker
+    linkers = { 'CXX': ['aixc++'], 'CC': ['aixcc'] }
+    alltools = []
+    for langvar, linktools in linkers.items():
+        if langvar in env: # use CC over CXX when user specified CC but not CXX
+            return SCons.Tool.FindTool(linktools, env)
+        alltools.extend(linktools)
+    return SCons.Tool.FindTool(alltools, env)
 
 # Local Variables:
 # tab-width:4
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/applelink.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/applelink.py
similarity index 92%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/applelink.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/applelink.py
index 7b0cc176804bc708fe6d79ae12c8a5d433f28aad..9ef1b7519f6d14c40aa14cb38af602876147808c 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/applelink.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/applelink.py
@@ -9,7 +9,7 @@ selection method.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -31,7 +31,7 @@ selection method.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/applelink.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/applelink.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import SCons.Util
 
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/ar.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/ar.py
similarity index 90%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/ar.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/ar.py
index 655e56b60192522dee81ea50ab688e7b9f679193..2d7f7b9814902336301cb51dbae0bf6226417075 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/ar.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/ar.py
@@ -9,7 +9,7 @@ selection method.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -31,7 +31,7 @@ selection method.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/ar.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/ar.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import SCons.Defaults
 import SCons.Tool
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/as.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/as.py
similarity index 93%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/as.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/as.py
index 6275d81367f61d39a11f0284a41a3b4b3bf12984..6c7304f1c419c030db3ffb639b0ab4c4fa253167 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/as.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/as.py
@@ -9,7 +9,7 @@ selection method.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -31,7 +31,7 @@ selection method.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/as.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/as.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import SCons.Defaults
 import SCons.Tool
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/bcc32.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/bcc32.py
similarity index 93%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/bcc32.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/bcc32.py
index c426e79e198184f287b3bf929af8e06c967123cc..a8295a350415324ff038d09ce1eb933d62866dbc 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/bcc32.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/bcc32.py
@@ -5,7 +5,7 @@ XXX
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -27,7 +27,7 @@ XXX
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/bcc32.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/bcc32.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import os
 import os.path
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/c++.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/c++.py
similarity index 91%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/c++.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/c++.py
index 8cd1dea29dcbd4eea533dc6fb1a601496075c17e..580bf9cd03adf1d692009b45a3c06865cf26b512 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/c++.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/c++.py
@@ -8,7 +8,7 @@ selection method.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -30,7 +30,7 @@ selection method.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/c++.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/c++.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import os.path
 
@@ -72,7 +72,8 @@ def generate(env):
 
     SCons.Tool.cc.add_common_cc_variables(env)
 
-    env['CXX']        = 'c++'
+    if 'CXX' not in env:
+        env['CXX']    = env.Detect(compilers) or compilers[0]
     env['CXXFLAGS']   = SCons.Util.CLVar('')
     env['CXXCOM']     = '$CXX -o $TARGET -c $CXXFLAGS $CCFLAGS $_CCCOMCOM $SOURCES'
     env['SHCXX']      = '$CXX'
@@ -90,7 +91,7 @@ def generate(env):
     env['CXXFILESUFFIX'] = '.cc'
 
 def exists(env):
-    return env.Detect(compilers)
+    return env.Detect(env.get('CXX', compilers))
 
 # Local Variables:
 # tab-width:4
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/cc.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/cc.py
similarity index 92%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/cc.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/cc.py
index 806f25131159a6c272c0c62632f9374081072928..7332ad0ce730ccc520da547eff77e300ca4e6c02 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/cc.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/cc.py
@@ -8,7 +8,7 @@ selection method.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -30,7 +30,7 @@ selection method.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/cc.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/cc.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import SCons.Tool
 import SCons.Defaults
@@ -62,6 +62,8 @@ def add_common_cc_variables(env):
     if 'SHCCFLAGS' not in env:
         env['SHCCFLAGS'] = SCons.Util.CLVar('$CCFLAGS')
 
+compilers = ['cc']
+
 def generate(env):
     """
     Add Builders and construction variables for C compilers to an Environment.
@@ -76,7 +78,8 @@ def generate(env):
 
     add_common_cc_variables(env)
 
-    env['CC']        = 'cc'
+    if 'CC' not in env:
+        env['CC']    = env.Detect(compilers) or compilers[0]
     env['CFLAGS']    = SCons.Util.CLVar('')
     env['CCCOM']     = '$CC -o $TARGET -c $CFLAGS $CCFLAGS $_CCCOMCOM $SOURCES'
     env['SHCC']      = '$CC'
@@ -93,7 +96,7 @@ def generate(env):
     env['CFILESUFFIX'] = '.c'
 
 def exists(env):
-    return env.Detect('cc')
+    return env.Detect(env.get('CC', compilers))
 
 # Local Variables:
 # tab-width:4
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/cvf.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/cvf.py
similarity index 91%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/cvf.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/cvf.py
index 2dcf195e1810919f031f7d91ff96afc18361e5da..89ac9fb4b5405a9312dc90dcc59987315126a3dd 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/cvf.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/cvf.py
@@ -5,7 +5,7 @@ Tool-specific initialization for the Compaq Visual Fortran compiler.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -27,7 +27,7 @@ Tool-specific initialization for the Compaq Visual Fortran compiler.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/cvf.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/cvf.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import fortran
 
diff --git a/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/cyglink.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/cyglink.py
new file mode 100644
index 0000000000000000000000000000000000000000..87716cf940576f579b8bdbc1102417f2bf7166cd
--- /dev/null
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/cyglink.py
@@ -0,0 +1,94 @@
+"""SCons.Tool.cyglink
+
+Customization of gnulink for Cygwin (http://www.cygwin.com/)
+
+There normally shouldn't be any need to import this module directly.
+It will usually be imported through the generic SCons.Tool.Tool()
+selection method.
+
+"""
+
+import SCons.Action
+import SCons.Util
+
+import gnulink
+
+def shlib_generator(target, source, env, for_signature):
+    cmd = SCons.Util.CLVar(['$SHLINK']) 
+
+    dll = env.FindIxes(target, 'SHLIBPREFIX', 'SHLIBSUFFIX')
+    if dll: cmd.extend(['-o', dll])
+
+    cmd.extend(['$SHLINKFLAGS', '$__RPATH'])
+
+    implib = env.FindIxes(target, 'IMPLIBPREFIX', 'IMPLIBSUFFIX')
+    if implib:
+        cmd.extend([
+            '-Wl,--out-implib='+implib.get_string(for_signature),
+            '-Wl,--export-all-symbols',
+            '-Wl,--enable-auto-import',
+            '-Wl,--whole-archive', '$SOURCES',
+            '-Wl,--no-whole-archive', '$_LIBDIRFLAGS', '$_LIBFLAGS'
+            ])
+    else:
+        cmd.extend(['$SOURCES', '$_LIBDIRFLAGS', '$_LIBFLAGS'])
+    
+    return [cmd]
+
+def shlib_emitter(target, source, env):
+    dll = env.FindIxes(target, 'SHLIBPREFIX', 'SHLIBSUFFIX')
+    no_import_lib = env.get('no_import_lib', 0)
+
+    if not dll or len(target) > 1:
+        raise SCons.Errors.UserError("A shared library should have exactly one target with the suffix: %s" % env.subst("$SHLIBSUFFIX"))
+    
+    # Remove any "lib" after the prefix
+    pre = env.subst('$SHLIBPREFIX')
+    if dll.name[len(pre):len(pre)+3] == 'lib':
+        dll.name = pre + dll.name[len(pre)+3:]
+
+    orig_target = target
+    target = [env.fs.File(dll)]
+    target[0].attributes.shared = 1
+
+    # Append an import lib target
+    if not no_import_lib:
+        # Create list of target libraries as strings
+        target_strings = env.ReplaceIxes(orig_target[0],
+                                         'SHLIBPREFIX', 'SHLIBSUFFIX',
+                                         'IMPLIBPREFIX', 'IMPLIBSUFFIX')
+        
+        implib_target = env.fs.File(target_strings)
+        implib_target.attributes.shared = 1
+        target.append(implib_target)
+
+    return (target, source)
+                         
+
+shlib_action = SCons.Action.Action(shlib_generator, generator=1)
+
+def generate(env):
+    """Add Builders and construction variables for cyglink to an Environment."""
+    gnulink.generate(env)
+
+    env['LINKFLAGS']   = SCons.Util.CLVar('-Wl,-no-undefined')
+
+    env['SHLINKCOM'] = shlib_action
+    env['LDMODULECOM'] = shlib_action
+    env.Append(SHLIBEMITTER = [shlib_emitter])
+
+    env['SHLIBPREFIX']         = 'cyg'
+    env['SHLIBSUFFIX']         = '.dll'
+
+    env['IMPLIBPREFIX']        = 'lib'
+    env['IMPLIBSUFFIX']        = '.dll.a'
+
+def exists(env):
+    return gnulink.exists(env)
+
+
+# Local Variables:
+# tab-width:4
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=4 shiftwidth=4:
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/default.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/default.py
similarity index 88%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/default.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/default.py
index 292bd0ba3cc90b01117edc03a7ddaf7ce912adcf..35e872c6ac24bb2e4a52e629119d03b9292052a2 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/default.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/default.py
@@ -9,7 +9,7 @@ selection method.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -31,7 +31,7 @@ selection method.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/default.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/default.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import SCons.Tool
 
diff --git a/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/dmd.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/dmd.py
new file mode 100644
index 0000000000000000000000000000000000000000..327da1504b922da1a7d4cb77923f2ecda455bca9
--- /dev/null
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/dmd.py
@@ -0,0 +1,152 @@
+"""SCons.Tool.dmd
+
+Tool-specific initialization for the Digital Mars D compiler.
+(http://digitalmars.com/d)
+
+Originally coded by Andy Friesen (andy@ikagames.com)
+15 November 2003
+
+Evolved by Russel Winder (russel@winder.org.uk)
+2010-02-07 onwards
+
+There are a number of problems with this script at this point in time.
+The one that irritates the most is the Windows linker setup.  The D
+linker doesn't have a way to add lib paths on the commandline, as far
+as I can see.  You have to specify paths relative to the SConscript or
+use absolute paths.  To hack around it, add '#/blah'.  This will link
+blah.lib from the directory where SConstruct resides.
+
+Compiler variables:
+    DC - The name of the D compiler to use.  Defaults to dmd or gdmd,
+        whichever is found.
+    DPATH - List of paths to search for import modules.
+    DVERSIONS - List of version tags to enable when compiling.
+    DDEBUG - List of debug tags to enable when compiling.
+
+Linker related variables:
+    LIBS - List of library files to link in.
+    DLINK - Name of the linker to use.  Defaults to dmd or gdmd,
+        whichever is found.
+    DLINKFLAGS - List of linker flags.
+
+Lib tool variables:
+    DLIB - Name of the lib tool to use.  Defaults to lib.
+    DLIBFLAGS - List of flags to pass to the lib tool.
+    LIBS - Same as for the linker. (libraries to pull into the .lib)
+"""
+
+#
+# Copyright (c) 2001 - 2015 The SCons Foundation
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+
+__revision__ = "src/engine/SCons/Tool/dmd.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
+
+import os
+import subprocess
+
+import SCons.Action
+import SCons.Builder
+import SCons.Defaults
+import SCons.Scanner.D
+import SCons.Tool
+
+import SCons.Tool.DCommon
+
+
+def generate(env):
+    static_obj, shared_obj = SCons.Tool.createObjBuilders(env)
+
+    static_obj.add_action('.d', SCons.Defaults.DAction)
+    shared_obj.add_action('.d', SCons.Defaults.ShDAction)
+    static_obj.add_emitter('.d', SCons.Defaults.StaticObjectEmitter)
+    shared_obj.add_emitter('.d', SCons.Defaults.SharedObjectEmitter)
+
+    env['DC'] = env.Detect(['dmd', 'gdmd'])
+    env['DCOM'] = '$DC $_DINCFLAGS $_DVERFLAGS $_DDEBUGFLAGS $_DFLAGS -c -of$TARGET $SOURCES'
+    env['_DINCFLAGS'] = '${_concat(DINCPREFIX, DPATH, DINCSUFFIX, __env__, RDirs, TARGET, SOURCE)}'
+    env['_DVERFLAGS'] = '${_concat(DVERPREFIX, DVERSIONS, DVERSUFFIX, __env__)}'
+    env['_DDEBUGFLAGS'] = '${_concat(DDEBUGPREFIX, DDEBUG, DDEBUGSUFFIX, __env__)}'
+    env['_DFLAGS'] = '${_concat(DFLAGPREFIX, DFLAGS, DFLAGSUFFIX, __env__)}'
+
+    env['SHDC'] = '$DC'
+    env['SHDCOM'] = '$DC $_DINCFLAGS $_DVERFLAGS $_DDEBUGFLAGS $_DFLAGS -c -fPIC -of$TARGET $SOURCES'
+
+    env['DPATH'] = ['#/']
+    env['DFLAGS'] = []
+    env['DVERSIONS'] = []
+    env['DDEBUG'] = []
+
+    if env['DC']:
+        SCons.Tool.DCommon.addDPATHToEnv(env, env['DC'])
+
+    env['DINCPREFIX'] = '-I'
+    env['DINCSUFFIX'] = ''
+    env['DVERPREFIX'] = '-version='
+    env['DVERSUFFIX'] = ''
+    env['DDEBUGPREFIX'] = '-debug='
+    env['DDEBUGSUFFIX'] = ''
+    env['DFLAGPREFIX'] = '-'
+    env['DFLAGSUFFIX'] = ''
+    env['DFILESUFFIX'] = '.d'
+
+    env['DLINK'] = '$DC'
+    env['DLINKFLAGS'] = SCons.Util.CLVar('')
+    env['DLINKCOM'] = '$DLINK -of$TARGET $DLINKFLAGS $__DRPATH $SOURCES $_DLIBDIRFLAGS $_DLIBFLAGS'
+
+    env['DSHLINK'] = '$DC'
+    env['DSHLINKFLAGS'] = SCons.Util.CLVar('$DLINKFLAGS -shared -defaultlib=libphobos2.so')
+    env['SHDLINKCOM'] = '$DLINK -of$TARGET $DSHLINKFLAGS $__DRPATH $SOURCES $_DLIBDIRFLAGS $_DLIBFLAGS'
+
+    env['DLIBLINKPREFIX'] = '' if env['PLATFORM'] == 'win32' else '-L-l'
+    env['DLIBLINKSUFFIX'] = '.lib' if env['PLATFORM'] == 'win32' else ''
+    env['_DLIBFLAGS'] = '${_stripixes(DLIBLINKPREFIX, LIBS, DLIBLINKSUFFIX, LIBPREFIXES, LIBSUFFIXES,  __env__)}'
+
+    env['DLIBDIRPREFIX'] = '-L-L'
+    env['DLIBDIRSUFFIX'] = ''
+    env['_DLIBDIRFLAGS'] = '${_concat(DLIBDIRPREFIX, LIBPATH, DLIBDIRSUFFIX, __env__, RDirs, TARGET, SOURCE)}'
+
+
+    env['DLIB'] = 'lib' if env['PLATFORM'] == 'win32' else 'ar cr'
+    env['DLIBCOM'] = '$DLIB $_DLIBFLAGS {0}$TARGET $SOURCES $_DLIBFLAGS'.format('-c ' if env['PLATFORM'] == 'win32' else '')
+
+    #env['_DLIBFLAGS'] = '${_concat(DLIBFLAGPREFIX, DLIBFLAGS, DLIBFLAGSUFFIX, __env__)}'
+
+    env['DLIBFLAGPREFIX'] = '-'
+    env['DLIBFLAGSUFFIX'] = ''
+
+    # __RPATH is set to $_RPATH in the platform specification if that
+    # platform supports it.
+    env['DRPATHPREFIX'] = '-L-rpath='
+    env['DRPATHSUFFIX'] = ''
+    env['_DRPATH'] = '${_concat(DRPATHPREFIX, RPATH, DRPATHSUFFIX, __env__)}'
+
+    SCons.Tool.createStaticLibBuilder(env)
+
+
+def exists(env):
+    return env.Detect(['dmd', 'gdmd'])
+
+# Local Variables:
+# tab-width:4
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=4 shiftwidth=4:
diff --git a/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/docbook/__init__.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/docbook/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..aead43c6969b612c8f18f856893535003081b48c
--- /dev/null
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/docbook/__init__.py
@@ -0,0 +1,882 @@
+
+"""SCons.Tool.docbook
+
+Tool-specific initialization for Docbook.
+
+There normally shouldn't be any need to import this module directly.
+It will usually be imported through the generic SCons.Tool.Tool()
+selection method.
+
+"""
+
+#
+# Copyright (c) 2001-7,2010 The SCons Foundation
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+
+import os
+import glob
+import re
+
+import SCons.Action
+import SCons.Builder
+import SCons.Defaults
+import SCons.Script
+import SCons.Tool
+import SCons.Util
+
+# Get full path to this script
+scriptpath = os.path.dirname(os.path.realpath(__file__))
+
+# Local folder for the collection of DocBook XSLs
+db_xsl_folder = 'docbook-xsl-1.76.1'
+
+# Do we have libxml2/libxslt/lxml?
+has_libxml2 = True
+has_lxml = True
+try:
+    import libxml2
+    import libxslt
+except:
+    has_libxml2 = False
+try:
+    import lxml
+except:
+    has_lxml = False
+
+# Set this to True, to prefer xsltproc over libxml2 and lxml
+prefer_xsltproc = False
+
+# Regexs for parsing Docbook XML sources of MAN pages
+re_manvolnum = re.compile("<manvolnum>([^<]*)</manvolnum>")
+re_refname = re.compile("<refname>([^<]*)</refname>")
+
+#
+# Helper functions
+#
+def __extend_targets_sources(target, source):
+    """ Prepare the lists of target and source files. """
+    if not SCons.Util.is_List(target):
+        target = [target]
+    if not source:
+        source = target[:]
+    elif not SCons.Util.is_List(source):
+        source = [source]
+    if len(target) < len(source):
+        target.extend(source[len(target):])
+        
+    return target, source
+
+def __init_xsl_stylesheet(kw, env, user_xsl_var, default_path):
+    if kw.get('DOCBOOK_XSL','') == '':
+        xsl_style = kw.get('xsl', env.subst(user_xsl_var))
+        if xsl_style == '':
+            path_args = [scriptpath, db_xsl_folder] + default_path
+            xsl_style = os.path.join(*path_args)
+        kw['DOCBOOK_XSL'] =  xsl_style
+    
+def __select_builder(lxml_builder, libxml2_builder, cmdline_builder):
+    """ Selects a builder, based on which Python modules are present. """
+    if prefer_xsltproc:
+        return cmdline_builder
+    
+    if not has_libxml2:
+        # At the moment we prefer libxml2 over lxml, the latter can lead
+        # to conflicts when installed together with libxml2.
+        if has_lxml:
+            return lxml_builder
+        else:
+            return cmdline_builder
+
+    return libxml2_builder
+
+def __ensure_suffix(t, suffix):
+    """ Ensure that the target t has the given suffix. """
+    tpath = str(t)
+    if not tpath.endswith(suffix):
+        return tpath+suffix
+    
+    return t
+
+def __ensure_suffix_stem(t, suffix):
+    """ Ensure that the target t has the given suffix, and return the file's stem. """
+    tpath = str(t)
+    if not tpath.endswith(suffix):
+        stem = tpath
+        tpath += suffix
+        
+        return tpath, stem
+    else:
+        stem, ext = os.path.splitext(tpath)
+    
+    return t, stem
+
+def __get_xml_text(root):
+    """ Return the text for the given root node (xml.dom.minidom). """
+    txt = ""
+    for e in root.childNodes:
+        if (e.nodeType == e.TEXT_NODE):
+            txt += e.data
+    return txt
+
+def __create_output_dir(base_dir):
+    """ Ensure that the output directory base_dir exists. """
+    root, tail = os.path.split(base_dir)
+    dir = None
+    if tail:
+        if base_dir.endswith('/'):
+            dir = base_dir
+        else:
+            dir = root
+    else:
+        if base_dir.endswith('/'):
+            dir = base_dir
+    
+    if dir and not os.path.isdir(dir):
+        os.makedirs(dir)
+
+
+#
+# Supported command line tools and their call "signature"
+#
+xsltproc_com = {'xsltproc' : '$DOCBOOK_XSLTPROC $DOCBOOK_XSLTPROCFLAGS -o $TARGET $DOCBOOK_XSL $SOURCE',
+                'saxon' : '$DOCBOOK_XSLTPROC $DOCBOOK_XSLTPROCFLAGS -o $TARGET $DOCBOOK_XSL $SOURCE $DOCBOOK_XSLTPROCPARAMS',
+                'saxon-xslt' : '$DOCBOOK_XSLTPROC $DOCBOOK_XSLTPROCFLAGS -o $TARGET $DOCBOOK_XSL $SOURCE $DOCBOOK_XSLTPROCPARAMS',
+                'xalan' : '$DOCBOOK_XSLTPROC $DOCBOOK_XSLTPROCFLAGS -q -out $TARGET -xsl $DOCBOOK_XSL -in $SOURCE'}
+xmllint_com = {'xmllint' : '$DOCBOOK_XMLLINT $DOCBOOK_XMLLINTFLAGS --xinclude $SOURCE > $TARGET'}
+fop_com = {'fop' : '$DOCBOOK_FOP $DOCBOOK_FOPFLAGS -fo $SOURCE -pdf $TARGET',
+           'xep' : '$DOCBOOK_FOP $DOCBOOK_FOPFLAGS -valid -fo $SOURCE -pdf $TARGET',
+           'jw' : '$DOCBOOK_FOP $DOCBOOK_FOPFLAGS -f docbook -b pdf $SOURCE -o $TARGET'}
+
+def __detect_cl_tool(env, chainkey, cdict):
+    """
+    Helper function, picks a command line tool from the list
+    and initializes its environment variables.
+    """
+    if env.get(chainkey,'') == '':
+        clpath = ''
+        for cltool in cdict:
+            clpath = env.WhereIs(cltool)
+            if clpath:
+                env[chainkey] = clpath
+                if not env[chainkey + 'COM']:
+                    env[chainkey + 'COM'] = cdict[cltool]
+
+def _detect(env):
+    """
+    Detect all the command line tools that we might need for creating
+    the requested output formats.
+    """
+    global prefer_xsltproc
+    
+    if env.get('DOCBOOK_PREFER_XSLTPROC',''):
+        prefer_xsltproc = True
+        
+    if ((not has_libxml2 and not has_lxml) or (prefer_xsltproc)):
+        # Try to find the XSLT processors
+        __detect_cl_tool(env, 'DOCBOOK_XSLTPROC', xsltproc_com)
+        __detect_cl_tool(env, 'DOCBOOK_XMLLINT', xmllint_com)
+
+    __detect_cl_tool(env, 'DOCBOOK_FOP', fop_com)
+
+#
+# Scanners
+#
+include_re = re.compile('fileref\\s*=\\s*["|\']([^\\n]*)["|\']')
+sentity_re = re.compile('<!ENTITY\\s+%*\\s*[^\\s]+\\s+SYSTEM\\s+["|\']([^\\n]*)["|\']>')
+ 
+def __xml_scan(node, env, path, arg):
+    """ Simple XML file scanner, detecting local images and XIncludes as implicit dependencies. """
+    # Does the node exist yet?
+    if not os.path.isfile(str(node)):
+        return []
+    
+    if env.get('DOCBOOK_SCANENT',''):
+        # Use simple pattern matching for system entities..., no support 
+        # for recursion yet.
+        contents = node.get_text_contents()
+        return sentity_re.findall(contents)
+
+    xsl_file = os.path.join(scriptpath,'utils','xmldepend.xsl')
+    if not has_libxml2 or prefer_xsltproc:
+        if has_lxml and not prefer_xsltproc:
+            
+            from lxml import etree
+            
+            xsl_tree = etree.parse(xsl_file)
+            doc = etree.parse(str(node))
+            result = doc.xslt(xsl_tree)
+
+            depfiles = [x.strip() for x in str(result).splitlines() if x.strip() != "" and not x.startswith("<?xml ")]
+            return depfiles
+        else:
+            # Try to call xsltproc
+            xsltproc = env.subst("$DOCBOOK_XSLTPROC")
+            if xsltproc and xsltproc.endswith('xsltproc'):
+                result = env.backtick(' '.join([xsltproc, xsl_file, str(node)]))
+                depfiles = [x.strip() for x in str(result).splitlines() if x.strip() != "" and not x.startswith("<?xml ")]
+                return depfiles
+            else:
+                # Use simple pattern matching, there is currently no support
+                # for xi:includes...
+                contents = node.get_text_contents()
+                return include_re.findall(contents)
+
+    styledoc = libxml2.parseFile(xsl_file)
+    style = libxslt.parseStylesheetDoc(styledoc)
+    doc = libxml2.readFile(str(node), None, libxml2.XML_PARSE_NOENT)
+    result = style.applyStylesheet(doc, None)
+
+    depfiles = []
+    for x in str(result).splitlines():
+        if x.strip() != "" and not x.startswith("<?xml "):
+            depfiles.extend(x.strip().split())
+    
+    style.freeStylesheet()
+    doc.freeDoc()
+    result.freeDoc()
+
+    return depfiles
+
+# Creating the instance of our XML dependency scanner
+docbook_xml_scanner = SCons.Script.Scanner(function = __xml_scan,
+                                           argument = None)
+
+
+#
+# Action generators
+#
+def __generate_xsltproc_action(source, target, env, for_signature):
+    cmd = env['DOCBOOK_XSLTPROCCOM']    
+    # Does the environment have a base_dir defined?
+    base_dir = env.subst('$base_dir')
+    if base_dir:
+        # Yes, so replace target path by its filename
+        return cmd.replace('$TARGET','${TARGET.file}')
+    return cmd
+
+
+#
+# Emitters
+#
+def __emit_xsl_basedir(target, source, env):
+    # Does the environment have a base_dir defined?
+    base_dir = env.subst('$base_dir')
+    if base_dir:
+        # Yes, so prepend it to each target
+        return [os.path.join(base_dir, str(t)) for t in target], source
+    
+    # No, so simply pass target and source names through
+    return target, source
+
+
+#
+# Builders
+#
+def __build_libxml2(target, source, env):
+    """
+    General XSLT builder (HTML/FO), using the libxml2 module.
+    """
+    xsl_style = env.subst('$DOCBOOK_XSL')
+    styledoc = libxml2.parseFile(xsl_style)
+    style = libxslt.parseStylesheetDoc(styledoc)
+    doc = libxml2.readFile(str(source[0]),None,libxml2.XML_PARSE_NOENT)
+    # Support for additional parameters
+    parampass = {}
+    if parampass:
+        result = style.applyStylesheet(doc, parampass)
+    else:
+        result = style.applyStylesheet(doc, None)
+    style.saveResultToFilename(str(target[0]), result, 0)
+    style.freeStylesheet()
+    doc.freeDoc()
+    result.freeDoc()
+
+    return None
+
+def __build_lxml(target, source, env):
+    """
+    General XSLT builder (HTML/FO), using the lxml module.
+    """
+    from lxml import etree
+    
+    xslt_ac = etree.XSLTAccessControl(read_file=True, 
+                                      write_file=True, 
+                                      create_dir=True, 
+                                      read_network=False, 
+                                      write_network=False)
+    xsl_style = env.subst('$DOCBOOK_XSL')
+    xsl_tree = etree.parse(xsl_style)
+    transform = etree.XSLT(xsl_tree, access_control=xslt_ac)
+    doc = etree.parse(str(source[0]))
+    # Support for additional parameters
+    parampass = {}
+    if parampass:
+        result = transform(doc, **parampass)
+    else:
+        result = transform(doc)
+        
+    try:
+        of = open(str(target[0]), "w")
+        of.write(of.write(etree.tostring(result, pretty_print=True)))
+        of.close()
+    except:
+        pass
+
+    return None
+
+def __xinclude_libxml2(target, source, env):
+    """
+    Resolving XIncludes, using the libxml2 module.
+    """
+    doc = libxml2.readFile(str(source[0]), None, libxml2.XML_PARSE_NOENT)
+    doc.xincludeProcessFlags(libxml2.XML_PARSE_NOENT)
+    doc.saveFile(str(target[0]))
+    doc.freeDoc()
+
+    return None
+
+def __xinclude_lxml(target, source, env):
+    """
+    Resolving XIncludes, using the lxml module.
+    """
+    from lxml import etree
+    
+    doc = etree.parse(str(source[0]))
+    doc.xinclude()
+    try:
+        doc.write(str(target[0]), xml_declaration=True, 
+                  encoding="UTF-8", pretty_print=True)
+    except:
+        pass
+
+    return None
+
+__libxml2_builder = SCons.Builder.Builder(
+        action = __build_libxml2,
+        src_suffix = '.xml',
+        source_scanner = docbook_xml_scanner,
+        emitter = __emit_xsl_basedir)
+__lxml_builder = SCons.Builder.Builder(
+        action = __build_lxml,
+        src_suffix = '.xml',
+        source_scanner = docbook_xml_scanner,
+        emitter = __emit_xsl_basedir)
+
+__xinclude_libxml2_builder = SCons.Builder.Builder(
+        action = __xinclude_libxml2,
+        suffix = '.xml',
+        src_suffix = '.xml',
+        source_scanner = docbook_xml_scanner)
+__xinclude_lxml_builder = SCons.Builder.Builder(
+        action = __xinclude_lxml,
+        suffix = '.xml',
+        src_suffix = '.xml',
+        source_scanner = docbook_xml_scanner)
+
+__xsltproc_builder = SCons.Builder.Builder(
+        action = SCons.Action.CommandGeneratorAction(__generate_xsltproc_action,
+                                                     {'cmdstr' : '$DOCBOOK_XSLTPROCCOMSTR'}),
+        src_suffix = '.xml',
+        source_scanner = docbook_xml_scanner,
+        emitter = __emit_xsl_basedir)
+__xmllint_builder = SCons.Builder.Builder(
+        action = SCons.Action.Action('$DOCBOOK_XMLLINTCOM','$DOCBOOK_XMLLINTCOMSTR'),
+        suffix = '.xml',
+        src_suffix = '.xml',
+        source_scanner = docbook_xml_scanner)
+__fop_builder = SCons.Builder.Builder(
+        action = SCons.Action.Action('$DOCBOOK_FOPCOM','$DOCBOOK_FOPCOMSTR'),
+        suffix = '.pdf',
+        src_suffix = '.fo',
+        ensure_suffix=1)
+
+def DocbookEpub(env, target, source=None, *args, **kw):
+    """
+    A pseudo-Builder, providing a Docbook toolchain for ePub output.
+    """
+    import zipfile
+    import shutil
+    
+    def build_open_container(target, source, env):
+        """Generate the *.epub file from intermediate outputs
+
+        Constructs the epub file according to the Open Container Format. This 
+        function could be replaced by a call to the SCons Zip builder if support
+        was added for different compression formats for separate source nodes.
+        """
+        zf = zipfile.ZipFile(str(target[0]), 'w')
+        mime_file = open('mimetype', 'w')
+        mime_file.write('application/epub+zip')
+        mime_file.close()
+        zf.write(mime_file.name, compress_type = zipfile.ZIP_STORED)
+        for s in source:
+            if os.path.isfile(str(s)):
+                head, tail = os.path.split(str(s))
+                if not head:
+                    continue
+                s = head
+            for dirpath, dirnames, filenames in os.walk(str(s)):
+                for fname in filenames:
+                    path = os.path.join(dirpath, fname)
+                    if os.path.isfile(path):
+                        zf.write(path, os.path.relpath(path, str(env.get('ZIPROOT', ''))),
+                            zipfile.ZIP_DEFLATED)
+        zf.close()
+        
+    def add_resources(target, source, env):
+        """Add missing resources to the OEBPS directory
+
+        Ensure all the resources in the manifest are present in the OEBPS directory.
+        """
+        hrefs = []
+        content_file = os.path.join(source[0].get_abspath(), 'content.opf')
+        if not os.path.isfile(content_file):
+            return
+        
+        hrefs = []
+        if has_libxml2:
+            nsmap = {'opf' : 'http://www.idpf.org/2007/opf'}
+            # Read file and resolve entities
+            doc = libxml2.readFile(content_file, None, 0)
+            opf = doc.getRootElement()
+            # Create xpath context
+            xpath_context = doc.xpathNewContext()
+            # Register namespaces
+            for key, val in nsmap.iteritems():
+                xpath_context.xpathRegisterNs(key, val)
+
+            if hasattr(opf, 'xpathEval') and xpath_context:
+                # Use the xpath context
+                xpath_context.setContextNode(opf)
+                items = xpath_context.xpathEval(".//opf:item")
+            else:
+                items = opf.findall(".//{'http://www.idpf.org/2007/opf'}item")
+
+            for item in items:
+                if hasattr(item, 'prop'):
+                    hrefs.append(item.prop('href'))
+                else:
+                    hrefs.append(item.attrib['href'])
+
+            doc.freeDoc()
+            xpath_context.xpathFreeContext()            
+        elif has_lxml:
+            from lxml import etree
+            
+            opf = etree.parse(content_file)
+            # All the opf:item elements are resources
+            for item in opf.xpath('//opf:item', 
+                    namespaces= { 'opf': 'http://www.idpf.org/2007/opf' }):
+                hrefs.append(item.attrib['href'])
+        
+        for href in hrefs:
+            # If the resource was not already created by DocBook XSL itself, 
+            # copy it into the OEBPS folder
+            referenced_file = os.path.join(source[0].get_abspath(), href)
+            if not os.path.exists(referenced_file):
+                shutil.copy(href, os.path.join(source[0].get_abspath(), href))
+        
+    # Init list of targets/sources
+    target, source = __extend_targets_sources(target, source)
+    
+    # Init XSL stylesheet
+    __init_xsl_stylesheet(kw, env, '$DOCBOOK_DEFAULT_XSL_EPUB', ['epub','docbook.xsl'])
+
+    # Setup builder
+    __builder = __select_builder(__lxml_builder, __libxml2_builder, __xsltproc_builder)
+    
+    # Create targets
+    result = []
+    if not env.GetOption('clean'):        
+        # Ensure that the folders OEBPS and META-INF exist
+        __create_output_dir('OEBPS/')
+        __create_output_dir('META-INF/')
+    dirs = env.Dir(['OEBPS', 'META-INF'])
+    
+    # Set the fixed base_dir
+    kw['base_dir'] = 'OEBPS/'
+    tocncx = __builder.__call__(env, 'toc.ncx', source[0], **kw)
+    cxml = env.File('META-INF/container.xml')
+    env.SideEffect(cxml, tocncx)
+    
+    env.Depends(tocncx, kw['DOCBOOK_XSL'])
+    result.extend(tocncx+[cxml])
+
+    container = env.Command(__ensure_suffix(str(target[0]), '.epub'), 
+        tocncx+[cxml], [add_resources, build_open_container])    
+    mimetype = env.File('mimetype')
+    env.SideEffect(mimetype, container)
+
+    result.extend(container)
+    # Add supporting files for cleanup
+    env.Clean(tocncx, dirs)
+
+    return result
+
+def DocbookHtml(env, target, source=None, *args, **kw):
+    """
+    A pseudo-Builder, providing a Docbook toolchain for HTML output.
+    """
+    # Init list of targets/sources
+    target, source = __extend_targets_sources(target, source)
+    
+    # Init XSL stylesheet
+    __init_xsl_stylesheet(kw, env, '$DOCBOOK_DEFAULT_XSL_HTML', ['html','docbook.xsl'])
+
+    # Setup builder
+    __builder = __select_builder(__lxml_builder, __libxml2_builder, __xsltproc_builder)
+    
+    # Create targets
+    result = []
+    for t,s in zip(target,source):
+        r = __builder.__call__(env, __ensure_suffix(t,'.html'), s, **kw)
+        env.Depends(r, kw['DOCBOOK_XSL'])
+        result.extend(r)
+
+    return result
+
+def DocbookHtmlChunked(env, target, source=None, *args, **kw):
+    """
+    A pseudo-Builder, providing a Docbook toolchain for chunked HTML output.
+    """
+    # Init target/source
+    if not SCons.Util.is_List(target):
+        target = [target]
+    if not source:
+        source = target
+        target = ['index.html']
+    elif not SCons.Util.is_List(source):
+        source = [source]
+        
+    # Init XSL stylesheet
+    __init_xsl_stylesheet(kw, env, '$DOCBOOK_DEFAULT_XSL_HTMLCHUNKED', ['html','chunkfast.xsl'])
+
+    # Setup builder
+    __builder = __select_builder(__lxml_builder, __libxml2_builder, __xsltproc_builder)
+    
+    # Detect base dir
+    base_dir = kw.get('base_dir', '')
+    if base_dir:
+        __create_output_dir(base_dir)
+   
+    # Create targets
+    result = []
+    r = __builder.__call__(env, __ensure_suffix(str(target[0]), '.html'), source[0], **kw)
+    env.Depends(r, kw['DOCBOOK_XSL'])
+    result.extend(r)
+    # Add supporting files for cleanup
+    env.Clean(r, glob.glob(os.path.join(base_dir, '*.html')))
+
+    return result
+
+
+def DocbookHtmlhelp(env, target, source=None, *args, **kw):
+    """
+    A pseudo-Builder, providing a Docbook toolchain for HTMLHELP output.
+    """
+    # Init target/source
+    if not SCons.Util.is_List(target):
+        target = [target]
+    if not source:
+        source = target
+        target = ['index.html']
+    elif not SCons.Util.is_List(source):
+        source = [source]    
+    
+    # Init XSL stylesheet
+    __init_xsl_stylesheet(kw, env, '$DOCBOOK_DEFAULT_XSL_HTMLHELP', ['htmlhelp','htmlhelp.xsl'])
+
+    # Setup builder
+    __builder = __select_builder(__lxml_builder, __libxml2_builder, __xsltproc_builder)
+
+    # Detect base dir
+    base_dir = kw.get('base_dir', '')
+    if base_dir:
+        __create_output_dir(base_dir)
+    
+    # Create targets
+    result = []
+    r = __builder.__call__(env, __ensure_suffix(str(target[0]), '.html'), source[0], **kw)
+    env.Depends(r, kw['DOCBOOK_XSL'])
+    result.extend(r)
+    # Add supporting files for cleanup
+    env.Clean(r, ['toc.hhc', 'htmlhelp.hhp', 'index.hhk'] +
+                 glob.glob(os.path.join(base_dir, '[ar|bk|ch]*.html')))
+
+    return result
+
+def DocbookPdf(env, target, source=None, *args, **kw):
+    """
+    A pseudo-Builder, providing a Docbook toolchain for PDF output.
+    """
+    # Init list of targets/sources
+    target, source = __extend_targets_sources(target, source)
+
+    # Init XSL stylesheet
+    __init_xsl_stylesheet(kw, env, '$DOCBOOK_DEFAULT_XSL_PDF', ['fo','docbook.xsl'])
+
+    # Setup builder
+    __builder = __select_builder(__lxml_builder, __libxml2_builder, __xsltproc_builder)
+
+    # Create targets
+    result = []
+    for t,s in zip(target,source):
+        t, stem = __ensure_suffix_stem(t, '.pdf')
+        xsl = __builder.__call__(env, stem+'.fo', s, **kw)
+        result.extend(xsl)
+        env.Depends(xsl, kw['DOCBOOK_XSL'])
+        result.extend(__fop_builder.__call__(env, t, xsl, **kw))
+
+    return result
+
+def DocbookMan(env, target, source=None, *args, **kw):
+    """
+    A pseudo-Builder, providing a Docbook toolchain for Man page output.
+    """
+    # Init list of targets/sources
+    target, source = __extend_targets_sources(target, source)
+
+    # Init XSL stylesheet
+    __init_xsl_stylesheet(kw, env, '$DOCBOOK_DEFAULT_XSL_MAN', ['manpages','docbook.xsl'])
+
+    # Setup builder
+    __builder = __select_builder(__lxml_builder, __libxml2_builder, __xsltproc_builder)
+
+    # Create targets
+    result = []
+    for t,s in zip(target,source):
+        volnum = "1"
+        outfiles = []
+        srcfile = __ensure_suffix(str(s),'.xml')
+        if os.path.isfile(srcfile):
+            try:
+                import xml.dom.minidom
+                
+                dom = xml.dom.minidom.parse(__ensure_suffix(str(s),'.xml'))
+                # Extract volume number, default is 1
+                for node in dom.getElementsByTagName('refmeta'):
+                    for vol in node.getElementsByTagName('manvolnum'):
+                        volnum = __get_xml_text(vol)
+                        
+                # Extract output filenames
+                for node in dom.getElementsByTagName('refnamediv'):
+                    for ref in node.getElementsByTagName('refname'):
+                        outfiles.append(__get_xml_text(ref)+'.'+volnum)
+                        
+            except:
+                # Use simple regex parsing 
+                f = open(__ensure_suffix(str(s),'.xml'), 'r')
+                content = f.read()
+                f.close()
+                
+                for m in re_manvolnum.finditer(content):
+                    volnum = m.group(1)
+                    
+                for m in re_refname.finditer(content):
+                    outfiles.append(m.group(1)+'.'+volnum)
+            
+            if not outfiles:
+                # Use stem of the source file
+                spath = str(s)
+                if not spath.endswith('.xml'):
+                    outfiles.append(spath+'.'+volnum)
+                else:
+                    stem, ext = os.path.splitext(spath)
+                    outfiles.append(stem+'.'+volnum)
+        else:
+            # We have to completely rely on the given target name
+            outfiles.append(t)
+            
+        __builder.__call__(env, outfiles[0], s, **kw)
+        env.Depends(outfiles[0], kw['DOCBOOK_XSL'])
+        result.append(outfiles[0])
+        if len(outfiles) > 1:
+            env.Clean(outfiles[0], outfiles[1:])
+
+        
+    return result
+
+def DocbookSlidesPdf(env, target, source=None, *args, **kw):
+    """
+    A pseudo-Builder, providing a Docbook toolchain for PDF slides output.
+    """
+    # Init list of targets/sources
+    target, source = __extend_targets_sources(target, source)
+
+    # Init XSL stylesheet
+    __init_xsl_stylesheet(kw, env, '$DOCBOOK_DEFAULT_XSL_SLIDESPDF', ['slides','fo','plain.xsl'])
+
+    # Setup builder
+    __builder = __select_builder(__lxml_builder, __libxml2_builder, __xsltproc_builder)
+
+    # Create targets
+    result = []
+    for t,s in zip(target,source):
+        t, stem = __ensure_suffix_stem(t, '.pdf')
+        xsl = __builder.__call__(env, stem+'.fo', s, **kw)
+        env.Depends(xsl, kw['DOCBOOK_XSL'])        
+        result.extend(xsl)
+        result.extend(__fop_builder.__call__(env, t, xsl, **kw))
+
+    return result
+
+def DocbookSlidesHtml(env, target, source=None, *args, **kw):
+    """
+    A pseudo-Builder, providing a Docbook toolchain for HTML slides output.
+    """
+    # Init list of targets/sources
+    if not SCons.Util.is_List(target):
+        target = [target]
+    if not source:
+        source = target
+        target = ['index.html']
+    elif not SCons.Util.is_List(source):
+        source = [source]    
+
+    # Init XSL stylesheet
+    __init_xsl_stylesheet(kw, env, '$DOCBOOK_DEFAULT_XSL_SLIDESHTML', ['slides','html','plain.xsl'])
+
+    # Setup builder
+    __builder = __select_builder(__lxml_builder, __libxml2_builder, __xsltproc_builder)
+
+    # Detect base dir
+    base_dir = kw.get('base_dir', '')
+    if base_dir:
+        __create_output_dir(base_dir)
+
+    # Create targets
+    result = []
+    r = __builder.__call__(env, __ensure_suffix(str(target[0]), '.html'), source[0], **kw)
+    env.Depends(r, kw['DOCBOOK_XSL'])
+    result.extend(r)
+    # Add supporting files for cleanup
+    env.Clean(r, [os.path.join(base_dir, 'toc.html')] +
+                 glob.glob(os.path.join(base_dir, 'foil*.html')))
+
+    return result
+
+def DocbookXInclude(env, target, source, *args, **kw):
+    """
+    A pseudo-Builder, for resolving XIncludes in a separate processing step.
+    """
+    # Init list of targets/sources
+    target, source = __extend_targets_sources(target, source)
+
+    # Setup builder
+    __builder = __select_builder(__xinclude_lxml_builder,__xinclude_libxml2_builder,__xmllint_builder)
+            
+    # Create targets
+    result = []
+    for t,s in zip(target,source):
+        result.extend(__builder.__call__(env, t, s, **kw))
+        
+    return result
+
+def DocbookXslt(env, target, source=None, *args, **kw):
+    """
+    A pseudo-Builder, applying a simple XSL transformation to the input file.
+    """
+    # Init list of targets/sources
+    target, source = __extend_targets_sources(target, source)
+    
+    # Init XSL stylesheet
+    kw['DOCBOOK_XSL'] = kw.get('xsl', 'transform.xsl')
+
+    # Setup builder
+    __builder = __select_builder(__lxml_builder, __libxml2_builder, __xsltproc_builder)
+    
+    # Create targets
+    result = []
+    for t,s in zip(target,source):
+        r = __builder.__call__(env, t, s, **kw)
+        env.Depends(r, kw['DOCBOOK_XSL'])
+        result.extend(r)
+
+    return result
+
+
+def generate(env):
+    """Add Builders and construction variables for docbook to an Environment."""
+
+    env.SetDefault(
+        # Default names for customized XSL stylesheets
+        DOCBOOK_DEFAULT_XSL_EPUB = '',
+        DOCBOOK_DEFAULT_XSL_HTML = '',
+        DOCBOOK_DEFAULT_XSL_HTMLCHUNKED = '',
+        DOCBOOK_DEFAULT_XSL_HTMLHELP = '',
+        DOCBOOK_DEFAULT_XSL_PDF = '',
+        DOCBOOK_DEFAULT_XSL_MAN = '',
+        DOCBOOK_DEFAULT_XSL_SLIDESPDF = '',
+        DOCBOOK_DEFAULT_XSL_SLIDESHTML = '',
+        
+        # Paths to the detected executables
+        DOCBOOK_XSLTPROC = '',
+        DOCBOOK_XMLLINT = '',
+        DOCBOOK_FOP = '',
+        
+        # Additional flags for the text processors
+        DOCBOOK_XSLTPROCFLAGS = SCons.Util.CLVar(''),
+        DOCBOOK_XMLLINTFLAGS = SCons.Util.CLVar(''),
+        DOCBOOK_FOPFLAGS = SCons.Util.CLVar(''),
+        DOCBOOK_XSLTPROCPARAMS = SCons.Util.CLVar(''),
+        
+        # Default command lines for the detected executables
+        DOCBOOK_XSLTPROCCOM = xsltproc_com['xsltproc'],
+        DOCBOOK_XMLLINTCOM = xmllint_com['xmllint'],
+        DOCBOOK_FOPCOM = fop_com['fop'],
+
+        # Screen output for the text processors
+        DOCBOOK_XSLTPROCCOMSTR = None,
+        DOCBOOK_XMLLINTCOMSTR = None,
+        DOCBOOK_FOPCOMSTR = None,
+        
+        )
+    _detect(env)
+
+    try:
+        env.AddMethod(DocbookEpub, "DocbookEpub")
+        env.AddMethod(DocbookHtml, "DocbookHtml")
+        env.AddMethod(DocbookHtmlChunked, "DocbookHtmlChunked")
+        env.AddMethod(DocbookHtmlhelp, "DocbookHtmlhelp")
+        env.AddMethod(DocbookPdf, "DocbookPdf")
+        env.AddMethod(DocbookMan, "DocbookMan")
+        env.AddMethod(DocbookSlidesPdf, "DocbookSlidesPdf")
+        env.AddMethod(DocbookSlidesHtml, "DocbookSlidesHtml")
+        env.AddMethod(DocbookXInclude, "DocbookXInclude")
+        env.AddMethod(DocbookXslt, "DocbookXslt")
+    except AttributeError:
+        # Looks like we use a pre-0.98 version of SCons...
+        from SCons.Script.SConscript import SConsEnvironment
+        SConsEnvironment.DocbookEpub = DocbookEpub        
+        SConsEnvironment.DocbookHtml = DocbookHtml
+        SConsEnvironment.DocbookHtmlChunked = DocbookHtmlChunked
+        SConsEnvironment.DocbookHtmlhelp = DocbookHtmlhelp
+        SConsEnvironment.DocbookPdf = DocbookPdf
+        SConsEnvironment.DocbookMan = DocbookMan
+        SConsEnvironment.DocbookSlidesPdf = DocbookSlidesPdf
+        SConsEnvironment.DocbookSlidesHtml = DocbookSlidesHtml
+        SConsEnvironment.DocbookXInclude = DocbookXInclude
+        SConsEnvironment.DocbookXslt = DocbookXslt
+
+
+def exists(env):
+    return 1
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/dvi.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/dvi.py
similarity index 91%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/dvi.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/dvi.py
index 803758cfa3ece324460f22829134285875f332ae..aba71684aa7e4caefec58ad9f3b67f4c4b8b9ae5 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/dvi.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/dvi.py
@@ -5,7 +5,7 @@ Common DVI Builder definition for various other Tool modules that use it.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -27,7 +27,7 @@ Common DVI Builder definition for various other Tool modules that use it.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/dvi.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/dvi.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import SCons.Builder
 import SCons.Tool
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/dvipdf.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/dvipdf.py
similarity index 94%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/dvipdf.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/dvipdf.py
index b931cf56d2977990fc10993a63a97d5774c96448..0a6dde7db6ed32b35b833e379ec5c728ad5aa102 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/dvipdf.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/dvipdf.py
@@ -9,7 +9,7 @@ selection method.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -30,7 +30,7 @@ selection method.
 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
-__revision__ = "src/engine/SCons/Tool/dvipdf.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/dvipdf.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import SCons.Action
 import SCons.Defaults
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/dvips.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/dvips.py
similarity index 94%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/dvips.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/dvips.py
index 8b3ba0f54dfd3466fe01784aaf72f08179422496..f72f2fed7fa2a0ea53b07b7b38ebae656db628a0 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/dvips.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/dvips.py
@@ -9,7 +9,7 @@ selection method.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -31,7 +31,7 @@ selection method.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/dvips.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/dvips.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import SCons.Action
 import SCons.Builder
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/f03.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/f03.py
similarity index 89%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/f03.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/f03.py
index cc8f9d29df0ba52523ebaf027d87a0cdd8a357d2..77165ad7d452110ff637120b3fdde2bab5e4ce83 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/f03.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/f03.py
@@ -9,7 +9,7 @@ selection method.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -31,7 +31,7 @@ selection method.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/f03.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/f03.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import SCons.Defaults
 import SCons.Tool
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/f77.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/f77.py
similarity index 90%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/f77.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/f77.py
index cba5b0b218a0a73ae11882d55b2917ec780b3e35..593c517729a004b11ac1d1e09a87b655d19c3d5a 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/f77.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/f77.py
@@ -9,7 +9,7 @@ selection method.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -31,7 +31,7 @@ selection method.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/f77.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/f77.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import SCons.Defaults
 import SCons.Scanner.Fortran
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/f90.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/f90.py
similarity index 89%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/f90.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/f90.py
index 1df001405880b51dfeea8a8a75a5bcbfb24f9cfb..c4a8df36cc3e023261ec098e8835f6fb0f0d8939 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/f90.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/f90.py
@@ -9,7 +9,7 @@ selection method.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -31,7 +31,7 @@ selection method.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/f90.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/f90.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import SCons.Defaults
 import SCons.Scanner.Fortran
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/f95.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/f95.py
similarity index 89%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/f95.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/f95.py
index b325309053f2eea7b3fe607a0a3d145624372808..f361e1d7b7a6648d5c3015e325894119a5f484e7 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/f95.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/f95.py
@@ -9,7 +9,7 @@ selection method.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -31,7 +31,7 @@ selection method.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/f95.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/f95.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import SCons.Defaults
 import SCons.Tool
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/filesystem.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/filesystem.py
similarity index 93%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/filesystem.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/filesystem.py
index 2ac49548f744188881177341ad165ee8cce2fdfb..df5757934e812adab23e1c81b629a87dc3927674 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/filesystem.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/filesystem.py
@@ -8,7 +8,7 @@ selection method.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -30,7 +30,7 @@ selection method.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/filesystem.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/filesystem.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import SCons
 from SCons.Tool.install import copyFunc
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/fortran.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/fortran.py
similarity index 89%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/fortran.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/fortran.py
index 3da748a94bb49b70e87279d311b3667de1af9a2e..7a513218c09753078a59f24918cbb46131071a11 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/fortran.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/fortran.py
@@ -9,7 +9,7 @@ selection method.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -31,7 +31,7 @@ selection method.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/fortran.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/fortran.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import re
 
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/g++.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/g++.py
similarity index 66%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/g++.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/g++.py
index 484344c3cf8c83926f91a8af07e0cb05447d92a8..824686232316ba5b11333c493722ff158b184c7f 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/g++.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/g++.py
@@ -9,7 +9,7 @@ selection method.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -31,7 +31,7 @@ selection method.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/g++.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/g++.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import os.path
 import re
@@ -40,6 +40,8 @@ import subprocess
 import SCons.Tool
 import SCons.Util
 
+import gcc
+
 cplusplus = __import__('c++', globals(), locals(), [])
 
 compilers = ['g++']
@@ -48,9 +50,10 @@ def generate(env):
     """Add Builders and construction variables for g++ to an Environment."""
     static_obj, shared_obj = SCons.Tool.createObjBuilders(env)
 
-    cplusplus.generate(env)
+    if 'CXX' not in env:
+        env['CXX']    = env.Detect(compilers) or compilers[0]
 
-    env['CXX']        = env.Detect(compilers)
+    cplusplus.generate(env)
 
     # platform specific settings
     if env['PLATFORM'] == 'aix':
@@ -62,26 +65,13 @@ def generate(env):
     elif env['PLATFORM'] == 'sunos':
         env['SHOBJSUFFIX'] = '.pic.o'
     # determine compiler version
-    if env['CXX']:
-        #pipe = SCons.Action._subproc(env, [env['CXX'], '-dumpversion'],
-        pipe = SCons.Action._subproc(env, [env['CXX'], '--version'],
-                                     stdin = 'devnull',
-                                     stderr = 'devnull',
-                                     stdout = subprocess.PIPE)
-        if pipe.wait() != 0: return
-        # -dumpversion was added in GCC 3.0.  As long as we're supporting
-        # GCC versions older than that, we should use --version and a
-        # regular expression.
-        #line = pipe.stdout.read().strip()
-        #if line:
-        #    env['CXXVERSION'] = line
-        line = pipe.stdout.readline()
-        match = re.search(r'[0-9]+(\.[0-9]+)+', line)
-        if match:
-            env['CXXVERSION'] = match.group(0)
+    version = gcc.detect_version(env, env['CXX'])
+    if version:
+        env['CXXVERSION'] = version
 
 def exists(env):
-    return env.Detect(compilers)
+    # is executable, and is a GNU compiler (or accepts '--version' at least)
+    return gcc.detect_version(env, env.Detect(env.get('CXX', compilers)))
 
 # Local Variables:
 # tab-width:4
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/g77.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/g77.py
similarity index 91%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/g77.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/g77.py
index 97c2ef1846467bf0ca8fa18761fae2fff8cf2456..e09cf16f409e0843c77753653adca2870cf0e065 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/g77.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/g77.py
@@ -9,7 +9,7 @@ selection method.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -31,7 +31,7 @@ selection method.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/g77.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/g77.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import SCons.Util
 from SCons.Tool.FortranCommon import add_all_to_env, add_f77_to_env
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/gas.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/gas.py
similarity index 89%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/gas.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/gas.py
index 89aa2e344fbbd6ed04f9f45993b3db91b4765440..f987b95d14d3f715076e34bcef310faeacd4c557 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/gas.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/gas.py
@@ -9,7 +9,7 @@ selection method.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -31,7 +31,7 @@ selection method.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/gas.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/gas.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 as_module = __import__('as', globals(), locals(), [])
 
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/gcc.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/gcc.py
similarity index 52%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/gcc.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/gcc.py
index 814e1dec242e489e4b6a0198220f34a9daceb52f..d2375c6e4e882aa4530755ad4361123df26f93c1 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/gcc.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/gcc.py
@@ -9,7 +9,7 @@ selection method.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -31,7 +31,7 @@ selection method.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/gcc.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/gcc.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import cc
 import os
@@ -44,34 +44,54 @@ compilers = ['gcc', 'cc']
 
 def generate(env):
     """Add Builders and construction variables for gcc to an Environment."""
+
+    if 'CC' not in env:
+        env['CC'] = env.Detect(compilers) or compilers[0]
+
     cc.generate(env)
 
-    env['CC'] = env.Detect(compilers) or 'gcc'
     if env['PLATFORM'] in ['cygwin', 'win32']:
         env['SHCCFLAGS'] = SCons.Util.CLVar('$CCFLAGS')
     else:
         env['SHCCFLAGS'] = SCons.Util.CLVar('$CCFLAGS -fPIC')
     # determine compiler version
-    if env['CC']:
-        #pipe = SCons.Action._subproc(env, [env['CC'], '-dumpversion'],
-        pipe = SCons.Action._subproc(env, [env['CC'], '--version'],
-                                     stdin = 'devnull',
-                                     stderr = 'devnull',
-                                     stdout = subprocess.PIPE)
-        if pipe.wait() != 0: return
-        # -dumpversion was added in GCC 3.0.  As long as we're supporting
-        # GCC versions older than that, we should use --version and a
-        # regular expression.
-        #line = pipe.stdout.read().strip()
-        #if line:
-        #    env['CCVERSION'] = line
-        line = pipe.stdout.readline()
-        match = re.search(r'[0-9]+(\.[0-9]+)+', line)
-        if match:
-            env['CCVERSION'] = match.group(0)
+    version = detect_version(env, env['CC'])
+    if version:
+        env['CCVERSION'] = version
 
 def exists(env):
-    return env.Detect(compilers)
+    # is executable, and is a GNU compiler (or accepts '--version' at least)
+    return detect_version(env, env.Detect(env.get('CC', compilers)))
+
+def detect_version(env, cc):
+    """Return the version of the GNU compiler, or None if it is not a GNU compiler."""
+    cc = env.subst(cc)
+    if not cc:
+        return None
+    version = None
+    #pipe = SCons.Action._subproc(env, SCons.Util.CLVar(cc) + ['-dumpversion'],
+    pipe = SCons.Action._subproc(env, SCons.Util.CLVar(cc) + ['--version'],
+                                 stdin = 'devnull',
+                                 stderr = 'devnull',
+                                 stdout = subprocess.PIPE)
+    # -dumpversion was added in GCC 3.0.  As long as we're supporting
+    # GCC versions older than that, we should use --version and a
+    # regular expression.
+    #line = pipe.stdout.read().strip()
+    #if line:
+    #    version = line
+    line = pipe.stdout.readline()
+    match = re.search(r'[0-9]+(\.[0-9]+)+', line)
+    if match:
+        version = match.group(0)
+    # Non-GNU compiler's output (like AIX xlc's) may exceed the stdout buffer:
+    # So continue with reading to let the child process actually terminate.
+    while pipe.stdout.readline():
+        pass
+    ret = pipe.wait()
+    if ret != 0:
+        return None
+    return version
 
 # Local Variables:
 # tab-width:4
diff --git a/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/gdc.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/gdc.py
new file mode 100644
index 0000000000000000000000000000000000000000..7a67501726aac3cb1abed3b20f7358ed5b006c96
--- /dev/null
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/gdc.py
@@ -0,0 +1,128 @@
+"""SCons.Tool.gdc
+
+Tool-specific initialization for the GDC compiler.
+(https://github.com/D-Programming-GDC/GDC)
+
+Developed by Russel Winder (russel@winder.org.uk)
+2012-05-09 onwards
+
+Compiler variables:
+    DC - The name of the D compiler to use.  Defaults to gdc.
+    DPATH - List of paths to search for import modules.
+    DVERSIONS - List of version tags to enable when compiling.
+    DDEBUG - List of debug tags to enable when compiling.
+
+Linker related variables:
+    LIBS - List of library files to link in.
+    DLINK - Name of the linker to use.  Defaults to gdc.
+    DLINKFLAGS - List of linker flags.
+
+Lib tool variables:
+    DLIB - Name of the lib tool to use.  Defaults to lib.
+    DLIBFLAGS - List of flags to pass to the lib tool.
+    LIBS - Same as for the linker. (libraries to pull into the .lib)
+"""
+
+#
+# Copyright (c) 2001 - 2015 The SCons Foundation
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+
+__revision__ = "src/engine/SCons/Tool/gdc.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
+
+import SCons.Action
+import SCons.Defaults
+import SCons.Tool
+
+import SCons.Tool.DCommon
+
+
+def generate(env):
+    static_obj, shared_obj = SCons.Tool.createObjBuilders(env)
+
+    static_obj.add_action('.d', SCons.Defaults.DAction)
+    shared_obj.add_action('.d', SCons.Defaults.ShDAction)
+    static_obj.add_emitter('.d', SCons.Defaults.StaticObjectEmitter)
+    shared_obj.add_emitter('.d', SCons.Defaults.SharedObjectEmitter)
+
+    env['DC'] = env.Detect('gdc')
+    env['DCOM'] = '$DC $_DINCFLAGS $_DVERFLAGS $_DDEBUGFLAGS $_DFLAGS -c -o $TARGET $SOURCES'
+    env['_DINCFLAGS'] = '${_concat(DINCPREFIX, DPATH, DINCSUFFIX, __env__, RDirs, TARGET, SOURCE)}'
+    env['_DVERFLAGS'] = '${_concat(DVERPREFIX, DVERSIONS, DVERSUFFIX, __env__)}'
+    env['_DDEBUGFLAGS'] = '${_concat(DDEBUGPREFIX, DDEBUG, DDEBUGSUFFIX, __env__)}'
+    env['_DFLAGS'] = '${_concat(DFLAGPREFIX, DFLAGS, DFLAGSUFFIX, __env__)}'
+
+    env['SHDC'] = '$DC'
+    env['SHDCOM'] = '$SHDC $_DINCFLAGS $_DVERFLAGS $_DDEBUGFLAGS $_DFLAGS -fPIC -c -o $TARGET $SOURCES'
+
+    env['DPATH'] = ['#/']
+    env['DFLAGS'] = []
+    env['DVERSIONS'] = []
+    env['DDEBUG'] = []
+
+    if env['DC']:
+        SCons.Tool.DCommon.addDPATHToEnv(env, env['DC'])
+
+    env['DINCPREFIX'] = '-I'
+    env['DINCSUFFIX'] = ''
+    env['DVERPREFIX'] = '-version='
+    env['DVERSUFFIX'] = ''
+    env['DDEBUGPREFIX'] = '-debug='
+    env['DDEBUGSUFFIX'] = ''
+    env['DFLAGPREFIX'] = '-'
+    env['DFLAGSUFFIX'] = ''
+    env['DFILESUFFIX'] = '.d'
+
+    env['DLINK'] = '$DC'
+    env['DLINKFLAGS'] = SCons.Util.CLVar('')
+    env['DLINKCOM'] = '$DLINK -o $TARGET $DLINKFLAGS $__RPATH $SOURCES $_LIBDIRFLAGS $_LIBFLAGS'
+
+    env['DSHLINK'] = '$DC'
+    env['DSHLINKFLAGS'] = SCons.Util.CLVar('$DLINKFLAGS -shared')
+    env['SHDLINKCOM'] = '$DLINK -o $TARGET $DSHLINKFLAGS $__RPATH $SOURCES $_LIBDIRFLAGS $_LIBFLAGS'
+
+    env['DLIB'] = 'lib' if env['PLATFORM'] == 'win32' else 'ar cr'
+    env['DLIBCOM'] = '$DLIB $_DLIBFLAGS {0}$TARGET $SOURCES $_DLINKLIBFLAGS'.format('-c ' if env['PLATFORM'] == 'win32' else '')
+
+    env['_DLIBFLAGS'] = '${_concat(DLIBFLAGPREFIX, DLIBFLAGS, DLIBFLAGSUFFIX, __env__)}'
+
+    env['DLIBFLAGPREFIX'] = '-'
+    env['DLIBFLAGSUFFIX'] = ''
+    env['DLINKFLAGPREFIX'] = '-'
+    env['DLINKFLAGSUFFIX'] = ''
+
+    # __RPATH is set to $_RPATH in the platform specification if that
+    # platform supports it.
+    env['RPATHPREFIX'] = '-Wl,-rpath='
+    env['RPATHSUFFIX'] = ''
+    env['_RPATH'] = '${_concat(RPATHPREFIX, RPATH, RPATHSUFFIX, __env__)}'
+
+    SCons.Tool.createStaticLibBuilder(env)
+
+
+def exists(env):
+    return env.Detect('gdc')
+
+# Local Variables:
+# tab-width:4
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=4 shiftwidth=4:
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/gettext.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/gettext.py
similarity index 84%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/gettext.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/gettext.py
index 9f2c7071551ce6ce3411e896965ca95fa9be0f80..e53ebdba421761bb852aac98000557140a95ebf1 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/gettext.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/gettext.py
@@ -2,7 +2,7 @@
 """
 
 
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 # 
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -23,7 +23,7 @@
 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
-__revision__ = "src/engine/SCons/Tool/gettext.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/gettext.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 #############################################################################
 def generate(env,**kw):
@@ -40,6 +40,9 @@ def exists(env):
   from SCons.Tool.GettextCommon \
   import _xgettext_exists, _msginit_exists, \
          _msgmerge_exists, _msgfmt_exists
-  return _xgettext_exists(env) and _msginit_exists(env) \
-     and _msgmerge_exists(env) and _msgfmt_exists(env)
+  try:
+    return _xgettext_exists(env) and _msginit_exists(env) \
+       and _msgmerge_exists(env) and _msgfmt_exists(env)
+  except:
+    return False
 #############################################################################
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/gfortran.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/gfortran.py
similarity index 88%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/gfortran.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/gfortran.py
index 2f9bddc64e9eecd5944dab6d5b9d0f6e43c870a0..02da3023825c56a73b08037c4de3dc783cc925eb 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/gfortran.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/gfortran.py
@@ -10,7 +10,7 @@ selection method.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -32,7 +32,7 @@ selection method.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/gfortran.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/gfortran.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import SCons.Util
 
@@ -43,7 +43,7 @@ def generate(env):
     Environment."""
     fortran.generate(env)
 
-    for dialect in ['F77', 'F90', 'FORTRAN', 'F95', 'F03']:
+    for dialect in ['F77', 'F90', 'FORTRAN', 'F95', 'F03', 'F08']:
         env['%s' % dialect] = 'gfortran'
         env['SH%s' % dialect] = '$%s' % dialect
         if env['PLATFORM'] in ['cygwin', 'win32']:
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/gnulink.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/gnulink.py
similarity index 77%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/gnulink.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/gnulink.py
index ee9f584e953be687f952a2b055bffa91d836acf9..81c013042eb4d4b7649f93fd7a4d786bcde40bba 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/gnulink.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/gnulink.py
@@ -9,7 +9,7 @@ selection method.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -31,14 +31,12 @@ selection method.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/gnulink.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/gnulink.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import SCons.Util
 
 import link
 
-linkers = ['g++', 'gcc']
-
 def generate(env):
     """Add Builders and construction variables for gnulink to an Environment."""
     link.generate(env)
@@ -53,7 +51,14 @@ def generate(env):
     env['_RPATH'] = '${_concat(RPATHPREFIX, RPATH, RPATHSUFFIX, __env__)}'
     
 def exists(env):
-    return env.Detect(linkers)
+    # TODO: sync with link.smart_link() to choose a linker
+    linkers = { 'CXX': ['g++'], 'CC': ['gcc'] }
+    alltools = []
+    for langvar, linktools in linkers.items():
+        if langvar in env: # use CC over CXX when user specified CC but not CXX
+            return SCons.Tool.FindTool(linktools, env)
+        alltools.extend(linktools)
+    return SCons.Tool.FindTool(alltools, env) # find CXX or CC
 
 # Local Variables:
 # tab-width:4
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/gs.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/gs.py
similarity index 72%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/gs.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/gs.py
index 12e71d282117e31e48795b3732b6f265e0831606..3e2eeccf19ec025c0b29fcaecd4098fd3b756db9 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/gs.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/gs.py
@@ -9,7 +9,7 @@ selection method.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -31,9 +31,10 @@ selection method.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/gs.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/gs.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import SCons.Action
+import SCons.Builder
 import SCons.Platform
 import SCons.Util
 
@@ -52,17 +53,26 @@ GhostscriptAction = None
 def generate(env):
     """Add Builders and construction variables for Ghostscript to an
     Environment."""
-
     global GhostscriptAction
-    if GhostscriptAction is None:
-        GhostscriptAction = SCons.Action.Action('$GSCOM', '$GSCOMSTR')
-
-    import pdf
-    pdf.generate(env)
-
-    bld = env['BUILDERS']['PDF']
-    bld.add_action('.ps', GhostscriptAction)
-
+    # The following try-except block enables us to use the Tool
+    # in standalone mode (without the accompanying pdf.py),
+    # whenever we need an explicit call of gs via the Gs()
+    # Builder ...
+    try:
+        if GhostscriptAction is None:
+            GhostscriptAction = SCons.Action.Action('$GSCOM', '$GSCOMSTR')
+    
+        import pdf
+        pdf.generate(env)
+    
+        bld = env['BUILDERS']['PDF']
+        bld.add_action('.ps', GhostscriptAction)
+    except ImportError, e:
+        pass
+
+    gsbuilder = SCons.Builder.Builder(action = SCons.Action.Action('$GSCOM', '$GSCOMSTR'))
+    env['BUILDERS']['Gs'] = gsbuilder
+    
     env['GS']      = gs
     env['GSFLAGS'] = SCons.Util.CLVar('-dNOPAUSE -dBATCH -sDEVICE=pdfwrite')
     env['GSCOM']   = '$GS $GSFLAGS -sOutputFile=$TARGET $SOURCES'
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/hpc++.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/hpc++.py
similarity index 92%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/hpc++.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/hpc++.py
index 5f75e18078fddc69cc5a063f90328207b1d75455..eb23e94f03660ae3d35bc41ef4b690ebce27a8ac 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/hpc++.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/hpc++.py
@@ -9,7 +9,7 @@ selection method.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -31,7 +31,7 @@ selection method.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/hpc++.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/hpc++.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import os.path
 
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/hpcc.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/hpcc.py
similarity index 88%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/hpcc.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/hpcc.py
index 29586f623267ace3ea48e5f532943b2e76379e21..827460dd521924962df587ac934e9ee63acb0433 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/hpcc.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/hpcc.py
@@ -8,7 +8,7 @@ selection method.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -30,7 +30,7 @@ selection method.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/hpcc.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/hpcc.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import SCons.Util
 
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/hplink.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/hplink.py
similarity index 91%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/hplink.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/hplink.py
index d979545e62503c17b7184d7f63ba6bd836548943..e3512a22fbacd6b182cc6fa42e87568854d234f3 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/hplink.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/hplink.py
@@ -8,7 +8,7 @@ selection method.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -30,7 +30,7 @@ selection method.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/hplink.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/hplink.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import os
 import os.path
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/icc.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/icc.py
similarity index 90%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/icc.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/icc.py
index 1f7f0284778f69cdfc62563517091dfa700f11f1..d6e3663ca36f20f79a6bf10e63da18bb0c4785d6 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/icc.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/icc.py
@@ -9,7 +9,7 @@ selection method.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -31,7 +31,7 @@ selection method.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/icc.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/icc.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import cc
 
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/icl.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/icl.py
similarity index 89%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/icl.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/icl.py
index e3ee4ea5d2b8c35acc127e41a11fd820366e8e5c..88c68815dad30208a9794e2122f0fe4958fd240b 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/icl.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/icl.py
@@ -9,7 +9,7 @@ selection method.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -31,7 +31,7 @@ selection method.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/icl.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/icl.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import SCons.Tool.intelc
 
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/ifl.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/ifl.py
similarity index 92%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/ifl.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/ifl.py
index 6ad250abb9ee1f66578691cd2a5f97992b5c905b..ef5bdd61fc2ae976ea66295a0fa5379003086635 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/ifl.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/ifl.py
@@ -9,7 +9,7 @@ selection method.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -31,7 +31,7 @@ selection method.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/ifl.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/ifl.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import SCons.Defaults
 from SCons.Scanner.Fortran import FortranScan
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/ifort.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/ifort.py
similarity index 93%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/ifort.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/ifort.py
index fde2e864f14f9e725e6095a0af8f804811b65afc..275c5c884049dc25e993facd50f57ac9d49f4e8e 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/ifort.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/ifort.py
@@ -10,7 +10,7 @@ selection method.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -32,7 +32,7 @@ selection method.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/ifort.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/ifort.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import SCons.Defaults
 from SCons.Scanner.Fortran import FortranScan
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/ilink.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/ilink.py
similarity index 90%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/ilink.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/ilink.py
index 4f37906b90055c270d1450e200ee7eedb82f95e8..b2c3513de6b0cd173d5626b0591371c8668c5e6b 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/ilink.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/ilink.py
@@ -9,7 +9,7 @@ selection method.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -31,7 +31,7 @@ selection method.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/ilink.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/ilink.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import SCons.Defaults
 import SCons.Tool
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/ilink32.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/ilink32.py
similarity index 90%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/ilink32.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/ilink32.py
index 399501b6b098494e1e3d230cd224b0af05789f1e..a2f1e67ba8f18cec0564cff19cce7b5262db9f7e 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/ilink32.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/ilink32.py
@@ -5,7 +5,7 @@ XXX
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -27,7 +27,7 @@ XXX
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/ilink32.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/ilink32.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import SCons.Tool
 import SCons.Tool.bcc32
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/install.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/install.py
similarity index 51%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/install.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/install.py
index 8b0673b06b9a895ec0fc54728791f442a98dfe55..0b3642cd556bbeb58858aa208e344ee6bb1aedfa 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/install.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/install.py
@@ -8,7 +8,7 @@ selection method.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -30,9 +30,10 @@ selection method.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/install.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/install.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import os
+import re
 import shutil
 import stat
 
@@ -121,6 +122,119 @@ def copyFunc(dest, source, env):
 
     return 0
 
+#
+# Functions doing the actual work of the InstallVersionedLib Builder.
+#
+def copyFuncVersionedLib(dest, source, env):
+    """Install a versioned library into a destination by copying,
+    (including copying permission/mode bits) and then creating
+    required symlinks."""
+
+    if os.path.isdir(source):
+        raise SCons.Errors.UserError("cannot install directory `%s' as a version library" % str(source) )
+    else:
+        # remove the link if it is already there
+        try:
+            os.remove(dest)
+        except:
+            pass
+        shutil.copy2(source, dest)
+        st = os.stat(source)
+        os.chmod(dest, stat.S_IMODE(st[stat.ST_MODE]) | stat.S_IWRITE)
+        versionedLibLinks(dest, source, env)
+
+    return 0
+
+def versionedLibVersion(dest, source, env):
+    """Check if dest is a version shared library name. Return version, libname, & install_dir if it is."""
+    Verbose = False
+    platform = env.subst('$PLATFORM')
+    if not (platform == 'posix'  or platform == 'darwin' or platform == 'sunos'):
+        return (None, None, None)
+
+    if (hasattr(source[0], 'attributes') and
+        hasattr(source[0].attributes, 'shlibname')):
+        libname = source[0].attributes.shlibname
+    else:
+        libname = os.path.basename(str(dest))
+    install_dir = os.path.dirname(str(dest))
+    shlib_suffix = env.subst('$SHLIBSUFFIX')
+    # See if the source name is a versioned shared library, get the version number
+    result = False
+    
+    version_re = re.compile("[0-9]+\\.[0-9]+\\.[0-9a-zA-Z]+")
+    version_File = None
+    if platform == 'posix' or platform == 'sunos':
+        # handle unix names
+        versioned_re = re.compile(re.escape(shlib_suffix + '.') + "[0-9]+\\.[0-9]+\\.[0-9a-zA-Z]+")
+        result = versioned_re.findall(libname)
+        if result:
+            version_File = version_re.findall(versioned_re.findall(libname)[-1])[-1]
+    elif platform == 'darwin':
+        # handle OSX names
+        versioned_re = re.compile("\\.[0-9]+\\.[0-9]+\\.[0-9a-zA-Z]+" + re.escape(shlib_suffix) )
+        result = versioned_re.findall(libname)
+        if result:
+            version_File = version_re.findall(versioned_re.findall(libname)[-1])[-1]
+    
+    if Verbose:
+        print "install: version_File ", version_File
+    # result is False if we did not find a versioned shared library name, so return and empty list
+    if not result:
+        return (None, libname, install_dir)
+
+    version = None
+    # get version number from the environment
+    try:
+        version = env.subst('$SHLIBVERSION')
+    except KeyError:
+        version = None
+    
+    if version != version_File:
+        #raise SCons.Errors.UserError("SHLIBVERSION '%s' does not match the version # '%s' in the filename" % (version, version_File) )
+        print "SHLIBVERSION '%s' does not match the version # '%s' in the filename, proceeding based on file name" % (version, version_File)
+        version = version_File
+    return (version, libname, install_dir)
+
+def versionedLibLinks(dest, source, env):
+    """If we are installing a versioned shared library create the required links."""
+    Verbose = False
+    linknames = []
+    version, libname, install_dir = versionedLibVersion(dest, source, env)
+
+    if version != None:
+        # libname includes the version number if one was given
+        linknames = SCons.Tool.VersionShLibLinkNames(version,libname,env)
+        if Verbose:
+            print "versionedLibLinks: linknames ",linknames
+        # Here we just need the file name w/o path as the target of the link
+        lib_ver = libname
+        # make symlink of adjacent names in linknames
+        for count in range(len(linknames)):
+            linkname = linknames[count]
+            fulllinkname = os.path.join(install_dir, linkname)
+            if Verbose:
+                print "full link name ",fulllinkname
+            if count > 0:
+                try:
+                    os.remove(lastlinkname)
+                except:
+                    pass
+                os.symlink(os.path.basename(fulllinkname),lastlinkname)
+                if Verbose:
+                    print "versionedLibLinks: made sym link of %s -> %s" % (lastlinkname,os.path.basename(fulllinkname))
+            lastlinkname = fulllinkname
+        # finish chain of sym links with link to the actual library
+        if len(linknames)>0:
+            try:
+                os.remove(lastlinkname)
+            except:
+                pass
+            os.symlink(lib_ver,lastlinkname)
+            if Verbose:
+                print "versionedLibLinks: made sym link of %s -> %s" % (lib_ver,lastlinkname)
+    return
+
 def installFunc(target, source, env):
     """Install a source file into a target using the function specified
     as the INSTALL construction variable."""
@@ -137,6 +251,26 @@ def installFunc(target, source, env):
 
     return 0
 
+def installFuncVersionedLib(target, source, env):
+    """Install a versioned library into a target using the function specified
+    as the INSTALLVERSIONEDLIB construction variable."""
+    try:
+        install = env['INSTALLVERSIONEDLIB']
+    except KeyError:
+        raise SCons.Errors.UserError('Missing INSTALLVERSIONEDLIB construction variable.')
+
+    assert len(target)==len(source), \
+           "Installing source %s into target %s: target and source lists must have same length."%(list(map(str, source)), list(map(str, target)))
+    for t,s in zip(target,source):
+        if hasattr(t.attributes, 'shlibname'):
+            tpath = os.path.join(t.get_dir(), t.attributes.shlibname)
+        else:
+            tpath = t.get_path()
+        if install(tpath,s.get_path(),env):
+            return 1
+
+    return 0
+
 def stringFunc(target, source, env):
     installstr = env.get('INSTALLSTR')
     if installstr:
@@ -159,6 +293,36 @@ def add_targets_to_INSTALLED_FILES(target, source, env):
     """
     global _INSTALLED_FILES, _UNIQUE_INSTALLED_FILES
     _INSTALLED_FILES.extend(target)
+
+    _UNIQUE_INSTALLED_FILES = None
+    return (target, source)
+
+def add_versioned_targets_to_INSTALLED_FILES(target, source, env):
+    """ an emitter that adds all target files to the list stored in the
+    _INSTALLED_FILES global variable. This way all installed files of one
+    scons call will be collected.
+    """
+    global _INSTALLED_FILES, _UNIQUE_INSTALLED_FILES
+    Verbose = False
+    _INSTALLED_FILES.extend(target)
+    if Verbose:
+        print "ver lib emitter ",repr(target)
+
+    # see if we have a versioned shared library, if so generate side effects
+    version, libname, install_dir = versionedLibVersion(target[0], source, env)
+    if version != None:
+        # generate list of link names
+        linknames = SCons.Tool.VersionShLibLinkNames(version,libname,env)
+        for linkname in linknames:
+            if Verbose:
+                print "make side effect of %s" % os.path.join(install_dir, linkname)
+            fulllinkname = os.path.join(install_dir, linkname)
+            env.SideEffect(fulllinkname,target[0])
+            env.Clean(target[0],fulllinkname)
+            _INSTALLED_FILES.append(fulllinkname)
+            if Verbose:
+                print "installed list ", _INSTALLED_FILES
+        
     _UNIQUE_INSTALLED_FILES = None
     return (target, source)
 
@@ -181,8 +345,9 @@ class DESTDIR_factory(object):
 #
 # The Builder Definition
 #
-install_action   = SCons.Action.Action(installFunc, stringFunc)
-installas_action = SCons.Action.Action(installFunc, stringFunc)
+install_action       = SCons.Action.Action(installFunc, stringFunc)
+installas_action     = SCons.Action.Action(installFunc, stringFunc)
+installVerLib_action = SCons.Action.Action(installFuncVersionedLib, stringFunc)
 
 BaseInstallBuilder               = None
 
@@ -223,6 +388,37 @@ def InstallAsBuilderWrapper(env, target=None, source=None, **kw):
         result.extend(BaseInstallBuilder(env, tgt, src, **kw))
     return result
 
+BaseVersionedInstallBuilder = None
+
+def InstallVersionedBuilderWrapper(env, target=None, source=None, dir=None, **kw):
+    if target and dir:
+        import SCons.Errors
+        raise SCons.Errors.UserError("Both target and dir defined for Install(), only one may be defined.")
+    if not dir:
+        dir=target
+
+    import SCons.Script
+    install_sandbox = SCons.Script.GetOption('install_sandbox')
+    if install_sandbox:
+        target_factory = DESTDIR_factory(env, install_sandbox)
+    else:
+        target_factory = env.fs
+
+    try:
+        dnodes = env.arg2nodes(dir, target_factory.Dir)
+    except TypeError:
+        raise SCons.Errors.UserError("Target `%s' of Install() is a file, but should be a directory.  Perhaps you have the Install() arguments backwards?" % str(dir))
+    sources = env.arg2nodes(source, env.fs.Entry)
+    tgt = []
+    for dnode in dnodes:
+        for src in sources:
+            # Prepend './' so the lookup doesn't interpret an initial
+            # '#' on the file name portion as meaning the Node should
+            # be relative to the top-level SConstruct directory.
+            target = env.fs.Entry('.'+os.sep+src.name, dnode)
+            tgt.extend(BaseVersionedInstallBuilder(env, target, src, **kw))
+    return tgt
+
 added = None
 
 def generate(env):
@@ -253,8 +449,25 @@ def generate(env):
                               emitter        = [ add_targets_to_INSTALLED_FILES, ],
                               name           = 'InstallBuilder')
 
+    global BaseVersionedInstallBuilder
+    if BaseVersionedInstallBuilder is None:
+        install_sandbox = GetOption('install_sandbox')
+        if install_sandbox:
+            target_factory = DESTDIR_factory(env, install_sandbox)
+        else:
+            target_factory = env.fs
+
+        BaseVersionedInstallBuilder = SCons.Builder.Builder(
+                                       action         = installVerLib_action,
+                                       target_factory = target_factory.Entry,
+                                       source_factory = env.fs.Entry,
+                                       multi          = 1,
+                                       emitter        = [ add_versioned_targets_to_INSTALLED_FILES, ],
+                                       name           = 'InstallVersionedBuilder')
+
     env['BUILDERS']['_InternalInstall'] = InstallBuilderWrapper
     env['BUILDERS']['_InternalInstallAs'] = InstallAsBuilderWrapper
+    env['BUILDERS']['_InternalInstallVersionedLib'] = InstallVersionedBuilderWrapper
 
     # We'd like to initialize this doing something like the following,
     # but there isn't yet support for a ${SOURCE.type} expansion that
@@ -273,6 +486,11 @@ def generate(env):
     except KeyError:
         env['INSTALL']    = copyFunc
 
+    try:
+        env['INSTALLVERSIONEDLIB']
+    except KeyError:
+        env['INSTALLVERSIONEDLIB']    = copyFuncVersionedLib
+
 def exists(env):
     return 1
 
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/intelc.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/intelc.py
similarity index 79%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/intelc.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/intelc.py
index 92529afdc5d9ee6e58235e9a2a47d6eb4824a5d1..256f32e6c1b498a94c7ccf3589ffa6b10fb897c4 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/intelc.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/intelc.py
@@ -10,7 +10,7 @@ selection method.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -32,7 +32,7 @@ selection method.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 from __future__ import division
 
-__revision__ = "src/engine/SCons/Tool/intelc.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/intelc.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import math, sys, os.path, glob, string, re
 
@@ -78,6 +78,7 @@ def linux_ver_normalize(vstr):
     Always returns an old-style float like 80 or 90 for compatibility with Windows.
     Shades of Y2K!"""
     # Check for version number like 9.1.026: return 91.026
+    # XXX needs to be updated for 2011+ versions (like 2011.11.344 which is compiler v12.1.5)
     m = re.match(r'([0-9]+)\.([0-9]+)\.([0-9]+)', vstr)
     if m:
         vmaj,vmin,build = m.groups()
@@ -155,7 +156,43 @@ def get_intel_registry_value(valuename, version=None, abi=None):
     try:
         k = SCons.Util.RegOpenKeyEx(SCons.Util.HKEY_LOCAL_MACHINE, K)
     except SCons.Util.RegError:
-        raise MissingRegistryError("%s was not found in the registry, for Intel compiler version %s, abi='%s'"%(K, version,abi))
+        # For version 13 and later, check UUID subkeys for valuename
+        if is_win64:
+            K = 'Software\\Wow6432Node\\Intel\\Suites\\' + version + "\\Defaults\\C++\\" + abi.upper()
+        else:
+            K = 'Software\\Intel\\Suites\\' + version + "\\Defaults\\C++\\" + abi.upper()
+        try:
+            k = SCons.Util.RegOpenKeyEx(SCons.Util.HKEY_LOCAL_MACHINE, K)
+            uuid = SCons.Util.RegQueryValueEx(k, 'SubKey')[0]
+
+            if is_win64:
+                K = 'Software\\Wow6432Node\\Intel\\Suites\\' + version + "\\" + uuid + "\\C++"
+            else:
+                K = 'Software\\Intel\\Suites\\' + version + "\\" + uuid + "\\C++"
+            k = SCons.Util.RegOpenKeyEx(SCons.Util.HKEY_LOCAL_MACHINE, K)
+
+            try:
+                v = SCons.Util.RegQueryValueEx(k, valuename)[0]
+                return v  # or v.encode('iso-8859-1', 'replace') to remove unicode?
+            except SCons.Util.RegError:
+                if abi.upper() == 'EM64T':
+                    abi = 'em64t_native'
+                if is_win64:
+                    K = 'Software\\Wow6432Node\\Intel\\Suites\\' + version + "\\" + uuid + "\\C++\\" + abi.upper()
+                else:
+                    K = 'Software\\Intel\\Suites\\' + version + "\\" + uuid + "\\C++\\" + abi.upper()
+                k = SCons.Util.RegOpenKeyEx(SCons.Util.HKEY_LOCAL_MACHINE, K)
+
+            try:
+                v = SCons.Util.RegQueryValueEx(k, valuename)[0]
+                return v  # or v.encode('iso-8859-1', 'replace') to remove unicode?
+            except SCons.Util.RegError:
+                raise MissingRegistryError("%s was not found in the registry, for Intel compiler version %s, abi='%s'"%(K, version,abi))
+
+        except SCons.Util.RegError:
+            raise MissingRegistryError("%s was not found in the registry, for Intel compiler version %s, abi='%s'"%(K, version,abi))
+        except WindowsError:
+            raise MissingRegistryError("%s was not found in the registry, for Intel compiler version %s, abi='%s'"%(K, version,abi))
 
     # Get the value:
     try:
@@ -179,7 +216,16 @@ def get_all_compiler_versions():
             k = SCons.Util.RegOpenKeyEx(SCons.Util.HKEY_LOCAL_MACHINE,
                                         keyname)
         except WindowsError:
-            return []
+            # For version 13 or later, check for default instance UUID
+            if is_win64:
+                keyname = 'Software\\WoW6432Node\\Intel\\Suites'
+            else:
+                keyname = 'Software\\Intel\\Suites'
+            try:
+                k = SCons.Util.RegOpenKeyEx(SCons.Util.HKEY_LOCAL_MACHINE,
+                                            keyname)
+            except WindowsError:
+                return []
         i = 0
         versions = []
         try:
@@ -191,6 +237,9 @@ def get_all_compiler_versions():
                 # and then the install directory deleted or moved (rather
                 # than uninstalling properly), so the registry values
                 # are still there.
+                if subkey == 'Defaults': # Ignore default instances
+                    i = i + 1
+                    continue
                 ok = False
                 for try_abi in ('IA32', 'IA32e',  'IA64', 'EM64T'):
                     try:
@@ -221,7 +270,7 @@ def get_all_compiler_versions():
         except EnvironmentError:
             # no more subkeys
             pass
-    elif is_linux:
+    elif is_linux or is_mac:
         for d in glob.glob('/opt/intel_cc_*'):
             # Typical dir here is /opt/intel_cc_80.
             m = re.search(r'cc_(.*)$', d)
@@ -238,13 +287,17 @@ def get_all_compiler_versions():
             m = re.search(r'([0-9][0-9.]*)$', d)
             if m:
                 versions.append(m.group(1))
-    elif is_mac:
-        for d in glob.glob('/opt/intel/cc*/*'):
-            # Typical dir here is /opt/intel/cc/9.0 for IA32,
-            # /opt/intel/cce/9.0 for EMT64 (AMD64)
+        for d in glob.glob('/opt/intel/composerxe-*'):
+            # Typical dir here is /opt/intel/composerxe-2011.4.184
             m = re.search(r'([0-9][0-9.]*)$', d)
             if m:
                 versions.append(m.group(1))
+        for d in glob.glob('/opt/intel/composer_xe_*'):
+            # Typical dir here is /opt/intel/composer_xe_2011_sp1.11.344
+            # The _sp1 is useless, the installers are named 2011.9.x, 2011.10.x, 2011.11.x
+            m = re.search(r'([0-9]{0,4})(?:_sp\d*)?\.([0-9][0-9.]*)$', d)
+            if m:
+                versions.append("%s.%s"%(m.group(1), m.group(2)))
     def keyfunc(str):
         """Given a dot-separated version string, return a tuple of ints representing it."""
         return [int(x) for x in str.split('.')]
@@ -263,9 +316,17 @@ def get_intel_compiler_top(version, abi):
         if not SCons.Util.can_read_reg:
             raise NoRegistryModuleError("No Windows registry module was found")
         top = get_intel_registry_value('ProductDir', version, abi)
+        archdir={'x86_64': 'intel64',
+                 'amd64' : 'intel64',
+                 'em64t' : 'intel64',
+                 'x86'   : 'ia32',
+                 'i386'  : 'ia32',
+                 'ia32'  : 'ia32'
+        }[abi] # for v11 and greater
         # pre-11, icl was in Bin.  11 and later, it's in Bin/<abi> apparently.
         if not os.path.exists(os.path.join(top, "Bin", "icl.exe")) \
-              and not os.path.exists(os.path.join(top, "Bin", abi, "icl.exe")):
+              and not os.path.exists(os.path.join(top, "Bin", abi, "icl.exe")) \
+              and not os.path.exists(os.path.join(top, "Bin", archdir, "icl.exe")):
             raise MissingDirError("Can't find Intel compiler in %s"%(top))
     elif is_mac or is_linux:
         def find_in_2008style_dir(version):
@@ -293,8 +354,33 @@ def get_intel_compiler_top(version, abi):
                     top = d
                     break
             return top
-        top = find_in_2010style_dir(version) or find_in_2008style_dir(version)
-        print "INTELC: top=",top
+        def find_in_2011style_dir(version):
+            # The 2011 (compiler v12) dirs are inconsistent, so just redo the search from
+            # get_all_compiler_versions and look for a match (search the newest form first)
+            top=None
+            for d in glob.glob('/opt/intel/composer_xe_*'):
+                # Typical dir here is /opt/intel/composer_xe_2011_sp1.11.344
+                # The _sp1 is useless, the installers are named 2011.9.x, 2011.10.x, 2011.11.x
+                m = re.search(r'([0-9]{0,4})(?:_sp\d*)?\.([0-9][0-9.]*)$', d)
+                if m:
+                    cur_ver = "%s.%s"%(m.group(1), m.group(2))
+                    if cur_ver == version and \
+                        (os.path.exists(os.path.join(d, "bin", "ia32", "icc")) or
+                        os.path.exists(os.path.join(d, "bin", "intel64", "icc"))):
+                        top = d
+                        break
+            if not top:
+                for d in glob.glob('/opt/intel/composerxe-*'):
+                    # Typical dir here is /opt/intel/composerxe-2011.4.184
+                    m = re.search(r'([0-9][0-9.]*)$', d)
+                    if m and m.group(1) == version and \
+                        (os.path.exists(os.path.join(d, "bin", "ia32", "icc")) or
+                        os.path.exists(os.path.join(d, "bin", "intel64", "icc"))):
+                            top = d
+                            break
+            return top
+        top = find_in_2011style_dir(version) or find_in_2010style_dir(version) or find_in_2008style_dir(version)
+        # print "INTELC: top=",top
         if not top:
             raise MissingDirError("Can't find version %s Intel compiler in %s (abi='%s')"%(version,top, abi))
     return top
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/ipkg.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/ipkg.py
similarity index 91%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/ipkg.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/ipkg.py
index bc56dcd38328d62ee6b35bf8f336d913d3cfdbfe..bf2b49671f3a9ffe8c7fd79cb9b60c4e169b89dd 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/ipkg.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/ipkg.py
@@ -11,7 +11,7 @@ packages fake_root.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -33,7 +33,7 @@ packages fake_root.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/ipkg.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/ipkg.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import os
 
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/jar.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/jar.py
similarity index 93%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/jar.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/jar.py
index 321006c8ffaa601eb91e79b854e7053796ecc0e9..50d3fc0dd42cd0e014b11cc958d5bbd76f46fe67 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/jar.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/jar.py
@@ -9,7 +9,7 @@ selection method.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -31,7 +31,7 @@ selection method.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/jar.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/jar.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import SCons.Subst
 import SCons.Util
@@ -97,7 +97,7 @@ def generate(env):
     env['_JARMANIFEST'] = jarManifest
     env['_JARSOURCES'] = jarSources
     env['_JARCOM']    = '$JAR $_JARFLAGS $TARGET $_JARMANIFEST $_JARSOURCES'
-    env['JARCOM']     = "${TEMPFILE('$_JARCOM')}"
+    env['JARCOM']     = "${TEMPFILE('$_JARCOM','$JARCOMSTR')}"
     env['JARSUFFIX']  = '.jar'
 
 def exists(env):
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/javac.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/javac.py
similarity index 96%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/javac.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/javac.py
index b682cbf0faf4d3a1acb6979c84a20331ff8941d9..bb57208916a66f5e058c785a8a45820acd6f86ea 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/javac.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/javac.py
@@ -9,7 +9,7 @@ selection method.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -30,7 +30,7 @@ selection method.
 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
-__revision__ = "src/engine/SCons/Tool/javac.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/javac.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import os
 import os.path
@@ -218,7 +218,7 @@ def generate(env):
     env['_JAVASOURCEPATH']          = '${_javapathopt("-sourcepath", "JAVASOURCEPATH", "_JAVASOURCEPATHDEFAULT")} '
     env['_JAVASOURCEPATHDEFAULT']   = '${TARGET.attributes.java_sourcedir}'
     env['_JAVACCOM']                = '$JAVAC $JAVACFLAGS $_JAVABOOTCLASSPATH $_JAVACLASSPATH -d ${TARGET.attributes.java_classdir} $_JAVASOURCEPATH $SOURCES'
-    env['JAVACCOM']                 = "${TEMPFILE('$_JAVACCOM')}"
+    env['JAVACCOM']                 = "${TEMPFILE('$_JAVACCOM','$JAVACCOMSTR')}"
     env['JAVACLASSSUFFIX']          = '.class'
     env['JAVASUFFIX']               = '.java'
 
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/javah.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/javah.py
similarity index 95%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/javah.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/javah.py
index be5145d482cb7722adc7595a593d1e62e6a97610..1d667b9efef26b6444add7f67405ddb75b9d5ce6 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/javah.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/javah.py
@@ -9,7 +9,7 @@ selection method.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -31,7 +31,7 @@ selection method.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/javah.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/javah.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import os.path
 
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/latex.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/latex.py
similarity index 92%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/latex.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/latex.py
index 427c373246777af5eb6bf5ca7dbd381375737564..69413cc3205648bbc0f3d65736723ca6c6146d17 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/latex.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/latex.py
@@ -10,7 +10,7 @@ selection method.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -32,7 +32,7 @@ selection method.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/latex.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/latex.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import SCons.Action
 import SCons.Defaults
diff --git a/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/ldc.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/ldc.py
new file mode 100644
index 0000000000000000000000000000000000000000..c1b558ff3cc9c3640e5bcf2693c04a4ebbbbb700
--- /dev/null
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/ldc.py
@@ -0,0 +1,144 @@
+"""SCons.Tool.ldc
+
+Tool-specific initialization for the LDC compiler.
+(http://www.dsource.org/projects/ldc)
+
+Developed by Russel Winder (russel@winder.org.uk)
+2012-05-09 onwards
+
+Compiler variables:
+    DC - The name of the D compiler to use.  Defaults to ldc2.
+    DPATH - List of paths to search for import modules.
+    DVERSIONS - List of version tags to enable when compiling.
+    DDEBUG - List of debug tags to enable when compiling.
+
+Linker related variables:
+    LIBS - List of library files to link in.
+    DLINK - Name of the linker to use.  Defaults to ldc2.
+    DLINKFLAGS - List of linker flags.
+
+Lib tool variables:
+    DLIB - Name of the lib tool to use.  Defaults to lib.
+    DLIBFLAGS - List of flags to pass to the lib tool.
+    LIBS - Same as for the linker. (libraries to pull into the .lib)
+"""
+
+#
+# Copyright (c) 2001 - 2015 The SCons Foundation
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+
+__revision__ = "src/engine/SCons/Tool/ldc.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
+
+import os
+import subprocess
+
+import SCons.Action
+import SCons.Builder
+import SCons.Defaults
+import SCons.Scanner.D
+import SCons.Tool
+
+import SCons.Tool.DCommon
+
+
+def generate(env):
+    static_obj, shared_obj = SCons.Tool.createObjBuilders(env)
+
+    static_obj.add_action('.d', SCons.Defaults.DAction)
+    shared_obj.add_action('.d', SCons.Defaults.ShDAction)
+    static_obj.add_emitter('.d', SCons.Defaults.StaticObjectEmitter)
+    shared_obj.add_emitter('.d', SCons.Defaults.SharedObjectEmitter)
+
+    env['DC'] = env.Detect('ldc2')
+    env['DCOM'] = '$DC $_DINCFLAGS $_DVERFLAGS $_DDEBUGFLAGS $_DFLAGS -c -of=$TARGET $SOURCES'
+    env['_DINCFLAGS'] = '${_concat(DINCPREFIX, DPATH, DINCSUFFIX, __env__, RDirs, TARGET, SOURCE)}'
+    env['_DVERFLAGS'] = '${_concat(DVERPREFIX, DVERSIONS, DVERSUFFIX, __env__)}'
+    env['_DDEBUGFLAGS'] = '${_concat(DDEBUGPREFIX, DDEBUG, DDEBUGSUFFIX, __env__)}'
+    env['_DFLAGS'] = '${_concat(DFLAGPREFIX, DFLAGS, DFLAGSUFFIX, __env__)}'
+
+    env['SHDC'] = '$DC'
+    env['SHDCOM'] = '$DC $_DINCFLAGS $_DVERFLAGS $_DDEBUGFLAGS $_DFLAGS -c -relocation-model=pic -of=$TARGET $SOURCES'
+
+    env['DPATH'] = ['#/']
+    env['DFLAGS'] = []
+    env['DVERSIONS'] = []
+    env['DDEBUG'] = []
+
+    if env['DC']:
+        SCons.Tool.DCommon.addDPATHToEnv(env, env['DC'])
+
+    env['DINCPREFIX'] = '-I='
+    env['DINCSUFFIX'] = ''
+    env['DVERPREFIX'] = '-version='
+    env['DVERSUFFIX'] = ''
+    env['DDEBUGPREFIX'] = '-debug='
+    env['DDEBUGSUFFIX'] = ''
+    env['DFLAGPREFIX'] = '-'
+    env['DFLAGSUFFIX'] = ''
+    env['DFILESUFFIX'] = '.d'
+
+    env['DLINK'] = '$DC'
+    env['DLINKFLAGS'] = SCons.Util.CLVar('')
+    env['DLINKCOM'] = '$DLINK -of=$TARGET $DLINKFLAGS $__DRPATH $SOURCES $_DLIBDIRFLAGS $_DLIBFLAGS'
+
+    env['DSHLINK'] = '$DC'
+    env['DSHLINKFLAGS'] = SCons.Util.CLVar('$DLINKFLAGS -shared -defaultlib=phobos2-ldc')
+    # Hack for Fedora the packages of which use the wrong name :-(
+    if os.path.exists('/usr/lib64/libphobos-ldc.so') or  os.path.exists('/usr/lib32/libphobos-ldc.so') or os.path.exists('/usr/lib/libphobos-ldc.so') :
+        env['DSHLINKFLAGS'] = SCons.Util.CLVar('$DLINKFLAGS -shared -defaultlib=phobos-ldc')
+    env['SHDLINKCOM'] = '$DLINK -of=$TARGET $DSHLINKFLAGS $__DRPATH $SOURCES $_DLIBDIRFLAGS $_DLIBFLAGS'
+
+    env['DLIBLINKPREFIX'] = '' if env['PLATFORM'] == 'win32' else '-L-l'
+    env['DLIBLINKSUFFIX'] = '.lib' if env['PLATFORM'] == 'win32' else ''
+    #env['_DLIBFLAGS'] = '${_concat(DLIBLINKPREFIX, LIBS, DLIBLINKSUFFIX, __env__, RDirs, TARGET, SOURCE)}'
+    env['_DLIBFLAGS'] = '${_stripixes(DLIBLINKPREFIX, LIBS, DLIBLINKSUFFIX, LIBPREFIXES, LIBSUFFIXES,  __env__)}'
+
+    env['DLIBDIRPREFIX'] = '-L-L'
+    env['DLIBDIRSUFFIX'] = ''
+    env['_DLIBDIRFLAGS'] = '${_concat(DLIBDIRPREFIX, LIBPATH, DLIBDIRSUFFIX, __env__, RDirs, TARGET, SOURCE)}'
+
+
+    env['DLIB'] = 'lib' if env['PLATFORM'] == 'win32' else 'ar cr'
+    env['DLIBCOM'] = '$DLIB $_DLIBFLAGS {0}$TARGET $SOURCES $_DLIBFLAGS'.format('-c ' if env['PLATFORM'] == 'win32' else '')
+
+    #env['_DLIBFLAGS'] = '${_concat(DLIBFLAGPREFIX, DLIBFLAGS, DLIBFLAGSUFFIX, __env__)}'
+
+    env['DLIBFLAGPREFIX'] = '-'
+    env['DLIBFLAGSUFFIX'] = ''
+
+    # __RPATH is set to $_RPATH in the platform specification if that
+    # platform supports it.
+    env['DRPATHPREFIX'] = '-L-rpath='
+    env['DRPATHSUFFIX'] = ''
+    env['_DRPATH'] = '${_concat(DRPATHPREFIX, RPATH, DRPATHSUFFIX, __env__)}'
+
+    SCons.Tool.createStaticLibBuilder(env)
+
+
+def exists(env):
+    return env.Detect('ldc2')
+
+# Local Variables:
+# tab-width:4
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=4 shiftwidth=4:
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/lex.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/lex.py
similarity index 93%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/lex.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/lex.py
index 76e899248a406c17818a86f81a2d93eb8c2aa806..9f6557de73d245da6d10b7251849d2eeba9a205c 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/lex.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/lex.py
@@ -9,7 +9,7 @@ selection method.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -31,7 +31,7 @@ selection method.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/lex.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/lex.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import os.path
 
diff --git a/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/link.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/link.py
new file mode 100644
index 0000000000000000000000000000000000000000..6874301dc4a6b2deb49e79456a870dc822c26b12
--- /dev/null
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/link.py
@@ -0,0 +1,218 @@
+"""SCons.Tool.link
+
+Tool-specific initialization for the generic Posix linker.
+
+There normally shouldn't be any need to import this module directly.
+It will usually be imported through the generic SCons.Tool.Tool()
+selection method.
+
+"""
+
+#
+# Copyright (c) 2001 - 2015 The SCons Foundation
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+
+__revision__ = "src/engine/SCons/Tool/link.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
+
+import re
+
+import SCons.Defaults
+import SCons.Tool
+import SCons.Util
+import SCons.Warnings
+
+from SCons.Tool.FortranCommon import isfortran
+
+from SCons.Tool.DCommon import isD
+
+cplusplus = __import__('c++', globals(), locals(), [])
+
+issued_mixed_link_warning = False
+
+def smart_link(source, target, env, for_signature):
+    has_cplusplus = cplusplus.iscplusplus(source)
+    has_fortran = isfortran(env, source)
+    has_d = isD(env, source)
+    if has_cplusplus and has_fortran and not has_d:
+        global issued_mixed_link_warning
+        if not issued_mixed_link_warning:
+            msg = "Using $CXX to link Fortran and C++ code together.\n\t" + \
+              "This may generate a buggy executable if the '%s'\n\t" + \
+              "compiler does not know how to deal with Fortran runtimes."
+            SCons.Warnings.warn(SCons.Warnings.FortranCxxMixWarning,
+                                msg % env.subst('$CXX'))
+            issued_mixed_link_warning = True
+        return '$CXX'
+    elif has_d:
+        env['LINKCOM'] = env['DLINKCOM']
+        env['SHLINKCOM'] = env['SHDLINKCOM']
+        return '$DC'
+    elif has_fortran:
+        return '$FORTRAN'
+    elif has_cplusplus:
+        return '$CXX'
+    return '$CC'
+
+def shlib_emitter(target, source, env):
+    Verbose = False
+    platform = env.subst('$PLATFORM')
+    for tgt in target:
+        tgt.attributes.shared = 1
+    try:
+        # target[0] comes in as libtest.so. Add the version extensions
+        version = env.subst('$SHLIBVERSION')
+        if version:
+            version_names = shlib_emitter_names(target, source, env)
+            # mark the target with the shared libraries name, including
+            # the version number
+            target[0].attributes.shlibname = version_names[0]
+            shlib = env.File(version_names[0], directory=target[0].get_dir())
+            target[0].attributes.shlibpath = shlib.get_internal_path()
+            for name in version_names[1:]:
+                env.SideEffect(name, shlib)
+                env.Clean(shlib, name)
+                if Verbose:
+                    print "shlib_emitter: add side effect - ",name
+            env.Clean(shlib, target[0])
+            return ([shlib], source)
+    except KeyError:
+        version = None
+    return (target, source)
+
+def shlib_emitter_names(target, source, env):
+    """Return list of file names that are side effects for a versioned library build. The first name in the list is the new name for the target"""
+    Verbose = False
+    platform = env.subst('$PLATFORM')
+    version_names = []
+    try:
+        # target[0] comes in as libtest.so. Add the version extensions
+        version = env.subst('$SHLIBVERSION')
+        if version.count(".") != 2:
+            # We need a version of the form x.y.z to proceed
+            raise ValueError
+        if version:
+            if platform == 'posix' or platform == 'sunos':
+                versionparts = version.split('.')
+                if hasattr(target[0].attributes, 'shlibname'):
+                    name = target[0].attributes.shlibname
+                else:
+                    name = target[0].name
+                # generate library name with the version number
+                version_name = name + '.' + version
+                if Verbose:
+                    print "shlib_emitter_names: target is ", version_name
+                    print "shlib_emitter_names: side effect: ", name
+                # add version_name to list of names to be a Side effect
+                version_names.append(version_name)
+                if Verbose:
+                    print "shlib_emitter_names: versionparts ",versionparts
+                for ver in versionparts[0:-1]:
+                    name = name + '.' + ver
+                    if Verbose:
+                        print "shlib_emitter_names: side effect: ", name
+                    # add name to list of names to be a Side effect
+                    version_names.append(name)
+            elif platform == 'darwin':
+                shlib_suffix = env.subst('$SHLIBSUFFIX')
+                if hasattr(target[0].attributes, 'shlibname'):
+                    name = target[0].attributes.shlibname
+                else:
+                    name = target[0].name
+                # generate library name with the version number
+                suffix_re = re.escape(shlib_suffix)
+                version_name = re.sub(suffix_re, '.' + version + shlib_suffix, name)
+                if Verbose:
+                    print "shlib_emitter_names: target is ", version_name
+                    print "shlib_emitter_names: side effect: ", name
+                # add version_name to list of names to be a Side effect
+                version_names.append(version_name)
+            elif platform == 'cygwin':
+                shlib_suffix = env.subst('$SHLIBSUFFIX')
+                if hasattr(target[0].attributes, 'shlibname'):
+                    name = target[0].attributes.shlibname
+                else:
+                    name = target[0].name
+                # generate library name with the version number
+                suffix_re = re.escape(shlib_suffix)
+                version_name = re.sub(suffix_re, '-' + re.sub('\.', '-', version) + shlib_suffix, name)
+                if Verbose:
+                    print "shlib_emitter_names: target is ", version_name
+                    print "shlib_emitter_names: side effect: ", name
+                # add version_name to list of names to be a Side effect
+                version_names.append(version_name)
+
+    except KeyError:
+        version = None
+    return version_names
+
+def generate(env):
+    """Add Builders and construction variables for gnulink to an Environment."""
+    SCons.Tool.createSharedLibBuilder(env)
+    SCons.Tool.createProgBuilder(env)
+
+    env['SHLINK']      = '$LINK'
+    env['SHLINKFLAGS'] = SCons.Util.CLVar('$LINKFLAGS -shared')
+    env['SHLINKCOM']   = '$SHLINK -o $TARGET $SHLINKFLAGS $__RPATH $SOURCES $_LIBDIRFLAGS $_LIBFLAGS'
+    # don't set up the emitter, cause AppendUnique will generate a list
+    # starting with None :-(
+    env.Append(SHLIBEMITTER = [shlib_emitter])
+    env['SMARTLINK']   = smart_link
+    env['LINK']        = "$SMARTLINK"
+    env['LINKFLAGS']   = SCons.Util.CLVar('')
+    # __RPATH is only set to something ($_RPATH typically) on platforms that support it.
+    env['LINKCOM']     = '$LINK -o $TARGET $LINKFLAGS $__RPATH $SOURCES $_LIBDIRFLAGS $_LIBFLAGS'
+    env['LIBDIRPREFIX']='-L'
+    env['LIBDIRSUFFIX']=''
+    env['_LIBFLAGS']='${_stripixes(LIBLINKPREFIX, LIBS, LIBLINKSUFFIX, LIBPREFIXES, LIBSUFFIXES, __env__)}'
+    env['LIBLINKPREFIX']='-l'
+    env['LIBLINKSUFFIX']=''
+
+    if env['PLATFORM'] == 'hpux':
+        env['SHLIBSUFFIX'] = '.sl'
+    elif env['PLATFORM'] == 'aix':
+        env['SHLIBSUFFIX'] = '.a'
+
+    # For most platforms, a loadable module is the same as a shared
+    # library.  Platforms which are different can override these, but
+    # setting them the same means that LoadableModule works everywhere.
+    SCons.Tool.createLoadableModuleBuilder(env)
+    env['LDMODULE'] = '$SHLINK'
+    # don't set up the emitter, cause AppendUnique will generate a list
+    # starting with None :-(
+    env.Append(LDMODULEEMITTER='$SHLIBEMITTER')
+    env['LDMODULEPREFIX'] = '$SHLIBPREFIX'
+    env['LDMODULESUFFIX'] = '$SHLIBSUFFIX'
+    env['LDMODULEFLAGS'] = '$SHLINKFLAGS'
+    env['LDMODULECOM'] = '$LDMODULE -o $TARGET $LDMODULEFLAGS $__RPATH $SOURCES $_LIBDIRFLAGS $_LIBFLAGS'
+
+
+
+def exists(env):
+    # This module isn't really a Tool on its own, it's common logic for
+    # other linkers.
+    return None
+
+# Local Variables:
+# tab-width:4
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=4 shiftwidth=4:
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/linkloc.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/linkloc.py
similarity index 94%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/linkloc.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/linkloc.py
index 50a1a5159520e294b49d872f3b137fd6b9debd0e..d2c218f7b36976dbb898acfed89013053da75a4f 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/linkloc.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/linkloc.py
@@ -10,7 +10,7 @@ selection method.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -32,7 +32,7 @@ selection method.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/linkloc.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/linkloc.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import os.path
 import re
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/m4.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/m4.py
similarity index 91%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/m4.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/m4.py
index 9bd4ef7c8cbb41dea0c5ba2b6d1931b6a0472f7b..dfc4665301b37a55b96a19d542ae15dbd025dff0 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/m4.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/m4.py
@@ -9,7 +9,7 @@ selection method.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -31,7 +31,7 @@ selection method.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/m4.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/m4.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import SCons.Action
 import SCons.Builder
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/masm.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/masm.py
similarity index 93%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/masm.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/masm.py
index f41f700a25b936bda5aa12a7ac0769d90914f709..7036de62e7a9d63376c47acede26ee0fd56e685d 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/masm.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/masm.py
@@ -9,7 +9,7 @@ selection method.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -31,7 +31,7 @@ selection method.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/masm.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/masm.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import SCons.Defaults
 import SCons.Tool
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/midl.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/midl.py
similarity index 93%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/midl.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/midl.py
index 2cdcd5ae15f85f0eda46dc19684d9f47769580bc..0d9307346d0c8189e45de0428c72aa3685a945c3 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/midl.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/midl.py
@@ -9,7 +9,7 @@ selection method.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -31,7 +31,7 @@ selection method.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/midl.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/midl.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import SCons.Action
 import SCons.Builder
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/mingw.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/mingw.py
similarity index 95%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/mingw.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/mingw.py
index 1c9c0829fc4e576bd09962bbcd88c76e05ecf7ba..236ce32b21b715c54726b4f30da7cdbcdfa06f0d 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/mingw.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/mingw.py
@@ -9,7 +9,7 @@ selection method.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -31,7 +31,7 @@ selection method.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/mingw.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/mingw.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import os
 import os.path
@@ -133,7 +133,7 @@ def generate(env):
         
 
     # Most of mingw is the same as gcc and friends...
-    gnu_tools = ['gcc', 'g++', 'gnulink', 'ar', 'gas', 'm4']
+    gnu_tools = ['gcc', 'g++', 'gnulink', 'ar', 'gas', 'gfortran', 'm4']
     for tool in gnu_tools:
         SCons.Tool.Tool(tool)(env)
 
@@ -168,6 +168,7 @@ def generate(env):
     env['OBJSUFFIX'] = '.o'
     env['LIBPREFIX'] = 'lib'
     env['LIBSUFFIX'] = '.a'
+    env['PROGSUFFIX'] = '.exe'
 
 def exists(env):
     return find(env)
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/msgfmt.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/msgfmt.py
similarity index 93%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/msgfmt.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/msgfmt.py
index 4fcd8fcc43f9659bf76c72df94fda79d6d75b760..4cfe6868d57dbc4a0efbc2bd8558808f9617aab7 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/msgfmt.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/msgfmt.py
@@ -1,6 +1,6 @@
 """ msgfmt tool """
 
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 # 
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -21,7 +21,7 @@
 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
-__revision__ = "src/engine/SCons/Tool/msgfmt.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/msgfmt.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 from SCons.Builder import BuilderBase
 #############################################################################
@@ -77,7 +77,10 @@ def generate(env,**kw):
   """ Generate `msgfmt` tool """
   import SCons.Util
   from SCons.Tool.GettextCommon import _detect_msgfmt
-  env['MSGFMT'] = _detect_msgfmt(env)
+  try:
+    env['MSGFMT'] = _detect_msgfmt(env)
+  except:
+    env['MSGFMT'] = 'msgfmt'
   env.SetDefault(
     MSGFMTFLAGS = [ SCons.Util.CLVar('-c') ],
     MSGFMTCOM = '$MSGFMT $MSGFMTFLAGS -o $TARGET $SOURCE',
@@ -92,7 +95,10 @@ def generate(env,**kw):
 def exists(env):
   """ Check if the tool exists """
   from SCons.Tool.GettextCommon import _msgfmt_exists
-  return _msgfmt_exists(env)
+  try:
+    return _msgfmt_exists(env)
+  except:
+    return False
 #############################################################################
 
 # Local Variables:
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/msginit.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/msginit.py
similarity index 93%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/msginit.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/msginit.py
index 210fbca58d0f474f263bef0bf97b30475edd1ea0..53046d6e72650007e27034554e22f76b79563331 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/msginit.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/msginit.py
@@ -3,7 +3,7 @@
 Tool specific initialization of msginit tool.
 """
 
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 # 
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -24,7 +24,7 @@ Tool specific initialization of msginit tool.
 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
-__revision__ = "src/engine/SCons/Tool/msginit.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/msginit.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import SCons.Warnings
 import SCons.Builder
@@ -79,7 +79,10 @@ def generate(env,**kw):
   """ Generate the `msginit` tool """
   import SCons.Util
   from SCons.Tool.GettextCommon import _detect_msginit
-  env['MSGINIT'] = _detect_msginit(env)
+  try:
+    env['MSGINIT'] = _detect_msginit(env)
+  except:
+    env['MSGINIT'] = 'msginit'
   msginitcom = '$MSGINIT ${_MSGNoTranslator(__env__)} -l ${_MSGINITLOCALE}' \
              + ' $MSGINITFLAGS -i $SOURCE -o $TARGET'
   # NOTE: We set POTSUFFIX here, in case the 'xgettext' is not loaded
@@ -104,7 +107,10 @@ def generate(env,**kw):
 def exists(env):
   """ Check if the tool exists """
   from SCons.Tool.GettextCommon import _msginit_exists
-  return  _msginit_exists(env)
+  try:
+    return  _msginit_exists(env)
+  except:
+    return False
 #############################################################################
 
 # Local Variables:
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/msgmerge.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/msgmerge.py
similarity index 92%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/msgmerge.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/msgmerge.py
index 2bc89f4d5016b87efbf4872e928b63aadb3c61c8..e2d06f4de717b5c2374442cab3f7fddccf654aac 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/msgmerge.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/msgmerge.py
@@ -3,7 +3,7 @@
 Tool specific initialization for `msgmerge` tool.
 """
 
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 # 
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -24,7 +24,7 @@ Tool specific initialization for `msgmerge` tool.
 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
-__revision__ = "src/engine/SCons/Tool/msgmerge.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/msgmerge.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 #############################################################################
 def _update_or_init_po_files(target, source, env):
@@ -70,7 +70,10 @@ def _POUpdateBuilderWrapper(env, target=None, source=_null, **kw):
 def generate(env,**kw):
   """ Generate the `xgettext` tool """
   from SCons.Tool.GettextCommon import _detect_msgmerge
-  env['MSGMERGE'] = _detect_msgmerge(env)
+  try:
+    env['MSGMERGE'] = _detect_msgmerge(env)
+  except:
+    env['MSGMERGE'] = 'msgmerge'
   env.SetDefault(
     POTSUFFIX = ['.pot'],
     POSUFFIX = ['.po'],
@@ -88,7 +91,10 @@ def generate(env,**kw):
 def exists(env):
   """ Check if the tool exists """
   from SCons.Tool.GettextCommon import _msgmerge_exists
-  return  _msgmerge_exists(env)
+  try:
+    return  _msgmerge_exists(env)
+  except:
+    return False
 #############################################################################
 
 # Local Variables:
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/mslib.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/mslib.py
similarity index 90%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/mslib.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/mslib.py
index 82ea503239bed9a86152965fb054600fe3c49b65..a82e88db5051f7359b6490d1cfc8c26f9cd32ea2 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/mslib.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/mslib.py
@@ -9,7 +9,7 @@ selection method.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -31,7 +31,7 @@ selection method.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/mslib.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/mslib.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import SCons.Defaults
 import SCons.Tool
@@ -50,7 +50,7 @@ def generate(env):
 
     env['AR']          = 'lib'
     env['ARFLAGS']     = SCons.Util.CLVar('/nologo')
-    env['ARCOM']       = "${TEMPFILE('$AR $ARFLAGS /OUT:$TARGET $SOURCES')}"
+    env['ARCOM']       = "${TEMPFILE('$AR $ARFLAGS /OUT:$TARGET $SOURCES','$ARCOMSTR')}"
     env['LIBPREFIX']   = ''
     env['LIBSUFFIX']   = '.lib'
 
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/mslink.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/mslink.py
similarity index 94%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/mslink.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/mslink.py
index 1f53295da8d605525919c462299f5dad4a2778c2..690630346fee48448252953f070dbaa4c6ae3448 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/mslink.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/mslink.py
@@ -9,7 +9,7 @@ selection method.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -31,7 +31,7 @@ selection method.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/mslink.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/mslink.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import os.path
 
@@ -129,6 +129,14 @@ def _dllEmitter(target, source, env, paramtp):
         extratargets.append(pdb)
         target[0].attributes.pdb = pdb
 
+    if version_num >= 11.0 and env.get('PCH', 0):
+        # MSVC 11 and above need the PCH object file to be added to the link line,
+        # otherwise you get link error LNK2011.
+        pchobj = SCons.Util.splitext(str(env['PCH']))[0] + '.obj'
+        # print "prog_emitter, version %s, appending pchobj %s"%(version_num, pchobj)
+        if pchobj not in extrasources:
+            extrasources.append(pchobj)
+
     if not no_import_lib and \
        not env.FindIxes(target, "LIBPREFIX", "LIBSUFFIX"):
         # Append an import library to the list of targets.
@@ -208,7 +216,7 @@ def embedManifestDllCheck(target, source, env):
     """Function run by embedManifestDllCheckAction to check for existence of manifest
     and other conditions, and embed the manifest by calling embedManifestDllAction if so."""
     if env.get('WINDOWS_EMBED_MANIFEST', 0):
-        manifestSrc = target[0].abspath + '.manifest'
+        manifestSrc = target[0].get_abspath() + '.manifest'
         if os.path.exists(manifestSrc):
             ret = (embedManifestDllAction) ([target[0]],None,env)        
             if ret:
@@ -222,7 +230,7 @@ def embedManifestExeCheck(target, source, env):
     """Function run by embedManifestExeCheckAction to check for existence of manifest
     and other conditions, and embed the manifest by calling embedManifestExeAction if so."""
     if env.get('WINDOWS_EMBED_MANIFEST', 0):
-        manifestSrc = target[0].abspath + '.manifest'
+        manifestSrc = target[0].get_abspath() + '.manifest'
         if os.path.exists(manifestSrc):
             ret = (embedManifestExeAction) ([target[0]],None,env)
             if ret:
@@ -237,11 +245,11 @@ embedManifestExeCheckAction = SCons.Action.Action(embedManifestExeCheck, None)
 
 regServerAction = SCons.Action.Action("$REGSVRCOM", "$REGSVRCOMSTR")
 regServerCheck = SCons.Action.Action(RegServerFunc, None)
-shlibLinkAction = SCons.Action.Action('${TEMPFILE("$SHLINK $SHLINKFLAGS $_SHLINK_TARGETS $_LIBDIRFLAGS $_LIBFLAGS $_PDB $_SHLINK_SOURCES")}', '$SHLINKCOMSTR')
+shlibLinkAction = SCons.Action.Action('${TEMPFILE("$SHLINK $SHLINKFLAGS $_SHLINK_TARGETS $_LIBDIRFLAGS $_LIBFLAGS $_PDB $_SHLINK_SOURCES", "$SHLINKCOMSTR")}', '$SHLINKCOMSTR')
 compositeShLinkAction = shlibLinkAction + regServerCheck + embedManifestDllCheckAction
-ldmodLinkAction = SCons.Action.Action('${TEMPFILE("$LDMODULE $LDMODULEFLAGS $_LDMODULE_TARGETS $_LIBDIRFLAGS $_LIBFLAGS $_PDB $_LDMODULE_SOURCES")}', '$LDMODULECOMSTR')
+ldmodLinkAction = SCons.Action.Action('${TEMPFILE("$LDMODULE $LDMODULEFLAGS $_LDMODULE_TARGETS $_LIBDIRFLAGS $_LIBFLAGS $_PDB $_LDMODULE_SOURCES", "$LDMODULECOMSTR")}', '$LDMODULECOMSTR')
 compositeLdmodAction = ldmodLinkAction + regServerCheck + embedManifestDllCheckAction
-exeLinkAction = SCons.Action.Action('${TEMPFILE("$LINK $LINKFLAGS /OUT:$TARGET.windows $_LIBDIRFLAGS $_LIBFLAGS $_PDB $SOURCES.windows")}', '$LINKCOMSTR')
+exeLinkAction = SCons.Action.Action('${TEMPFILE("$LINK $LINKFLAGS /OUT:$TARGET.windows $_LIBDIRFLAGS $_LIBFLAGS $_PDB $SOURCES.windows", "$LINKCOMSTR")}', '$LINKCOMSTR')
 compositeLinkAction = exeLinkAction + embedManifestExeCheckAction
 
 def generate(env):
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/mssdk.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/mssdk.py
similarity index 88%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/mssdk.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/mssdk.py
index f871c7d5a3e52e2d7efc61a2ae73817595412fe2..38368171d14cb34c00d369c40b12c28f505bba3f 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/mssdk.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/mssdk.py
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -21,7 +21,7 @@
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/mssdk.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/mssdk.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 """engine.SCons.Tool.mssdk
 
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/msvc.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/msvc.py
similarity index 96%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/msvc.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/msvc.py
index eb479a35b2d9ec8bf15ebc8c9cdc5c8596086273..03d65ee6789a29c3667dea9f3ec081c0c5f3613c 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/msvc.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/msvc.py
@@ -9,7 +9,7 @@ selection method.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -31,7 +31,7 @@ selection method.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/msvc.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/msvc.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import os.path
 import re
@@ -224,17 +224,17 @@ def generate(env):
     env['CC']         = 'cl'
     env['CCFLAGS']    = SCons.Util.CLVar('/nologo')
     env['CFLAGS']     = SCons.Util.CLVar('')
-    env['CCCOM']      = '${TEMPFILE("$CC $_MSVC_OUTPUT_FLAG /c $CHANGED_SOURCES $CFLAGS $CCFLAGS $_CCCOMCOM")}'
+    env['CCCOM']      = '${TEMPFILE("$CC $_MSVC_OUTPUT_FLAG /c $CHANGED_SOURCES $CFLAGS $CCFLAGS $_CCCOMCOM","$CCCOMSTR")}'
     env['SHCC']       = '$CC'
     env['SHCCFLAGS']  = SCons.Util.CLVar('$CCFLAGS')
     env['SHCFLAGS']   = SCons.Util.CLVar('$CFLAGS')
-    env['SHCCCOM']    = '${TEMPFILE("$SHCC $_MSVC_OUTPUT_FLAG /c $CHANGED_SOURCES $SHCFLAGS $SHCCFLAGS $_CCCOMCOM")}'
+    env['SHCCCOM']    = '${TEMPFILE("$SHCC $_MSVC_OUTPUT_FLAG /c $CHANGED_SOURCES $SHCFLAGS $SHCCFLAGS $_CCCOMCOM","$SHCCCOMSTR")}'
     env['CXX']        = '$CC'
     env['CXXFLAGS']   = SCons.Util.CLVar('$( /TP $)')
-    env['CXXCOM']     = '${TEMPFILE("$CXX $_MSVC_OUTPUT_FLAG /c $CHANGED_SOURCES $CXXFLAGS $CCFLAGS $_CCCOMCOM")}'
+    env['CXXCOM']     = '${TEMPFILE("$CXX $_MSVC_OUTPUT_FLAG /c $CHANGED_SOURCES $CXXFLAGS $CCFLAGS $_CCCOMCOM","$CXXCOMSTR")}'
     env['SHCXX']      = '$CXX'
     env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS')
-    env['SHCXXCOM']   = '${TEMPFILE("$SHCXX $_MSVC_OUTPUT_FLAG /c $CHANGED_SOURCES $SHCXXFLAGS $SHCCFLAGS $_CCCOMCOM")}'
+    env['SHCXXCOM']   = '${TEMPFILE("$SHCXX $_MSVC_OUTPUT_FLAG /c $CHANGED_SOURCES $SHCXXFLAGS $SHCCFLAGS $_CCCOMCOM","$SHCXXCOMSTR")}'
     env['CPPDEFPREFIX']  = '/D'
     env['CPPDEFSUFFIX']  = ''
     env['INCPREFIX']  = '/I'
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/msvs.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/msvs.py
similarity index 89%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/msvs.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/msvs.py
index c0443d96d50848ed9a2771b7f5a2cb655f22bfd7..0ad4c780f1da53c0429a92f2024c249488be0b2d 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/msvs.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/msvs.py
@@ -9,7 +9,7 @@ selection method.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -30,7 +30,7 @@ selection method.
 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
-__revision__ = "src/engine/SCons/Tool/msvs.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/msvs.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import SCons.compat
 
@@ -63,6 +63,7 @@ def xmlify(s):
     s = s.replace("&", "&amp;") # do this first
     s = s.replace("'", "&apos;")
     s = s.replace('"', "&quot;")
+    s = s.replace('\n', '&#x0A;')
     return s
 
 # Process a CPPPATH list in includes, given the env, target and source.
@@ -198,6 +199,209 @@ def makeHierarchy(sources):
         #    print 'Warning: failed to decompose path for '+str(file)
     return hierarchy
 
+class _UserGenerator(object):
+    '''
+    Base class for .dsp.user file generator
+    '''
+    # Default instance values.
+    # Ok ... a bit defensive, but it does not seems reasonable to crash the 
+    # build for a workspace user file. :-)
+    usrhead = None
+    usrdebg = None 
+    usrconf = None
+    createfile = False 
+    def __init__(self, dspfile, source, env):
+        # DebugSettings should be a list of debug dictionary sorted in the same order
+        # than the target list and variants 
+        if 'variant' not in env:
+            raise SCons.Errors.InternalError("You must specify a 'variant' argument (i.e. 'Debug' or " +\
+                  "'Release') to create an MSVSProject.")
+        elif SCons.Util.is_String(env['variant']):
+            variants = [env['variant']]
+        elif SCons.Util.is_List(env['variant']):
+            variants = env['variant']
+        
+        if 'DebugSettings' not in env or env['DebugSettings'] == None:
+            dbg_settings = []
+        elif SCons.Util.is_Dict(env['DebugSettings']):
+            dbg_settings = [env['DebugSettings']]
+        elif SCons.Util.is_List(env['DebugSettings']):
+            if len(env['DebugSettings']) != len(variants):
+                raise SCons.Errors.InternalError("Sizes of 'DebugSettings' and 'variant' lists must be the same.")
+            dbg_settings = []
+            for ds in env['DebugSettings']:
+                if SCons.Util.is_Dict(ds):
+                    dbg_settings.append(ds)
+                else:
+                    dbg_settings.append({})
+        else:
+            dbg_settings = []
+            
+        if len(dbg_settings) == 1:
+            dbg_settings = dbg_settings * len(variants)
+            
+        self.createfile = self.usrhead and self.usrdebg and self.usrconf and \
+                            dbg_settings and bool([ds for ds in dbg_settings if ds]) 
+
+        if self.createfile:
+            dbg_settings = dict(zip(variants, dbg_settings))
+            for var, src in dbg_settings.items():
+                # Update only expected keys
+                trg = {}
+                for key in [k for k in self.usrdebg.keys() if k in src]:
+                    trg[key] = str(src[key])
+                self.configs[var].debug = trg
+    
+    def UserHeader(self):
+        encoding = self.env.subst('$MSVSENCODING')
+        versionstr = self.versionstr
+        self.usrfile.write(self.usrhead % locals())
+   
+    def UserProject(self):
+        pass
+    
+    def Build(self):
+        if not self.createfile:
+            return
+        try:
+            filename = self.dspabs +'.user'
+            self.usrfile = open(filename, 'w')
+        except IOError, detail:
+            raise SCons.Errors.InternalError('Unable to open "' + filename + '" for writing:' + str(detail))
+        else:
+            self.UserHeader()
+            self.UserProject()
+            self.usrfile.close()
+
+V9UserHeader = """\
+<?xml version="1.0" encoding="%(encoding)s"?>
+<VisualStudioUserFile
+\tProjectType="Visual C++"
+\tVersion="%(versionstr)s"
+\tShowAllFiles="false"
+\t>
+\t<Configurations>
+"""
+
+V9UserConfiguration = """\
+\t\t<Configuration
+\t\t\tName="%(variant)s|%(platform)s"
+\t\t\t>
+\t\t\t<DebugSettings
+%(debug_settings)s
+\t\t\t/>
+\t\t</Configuration>
+"""
+
+V9DebugSettings = {
+'Command':'$(TargetPath)',
+'WorkingDirectory': None,
+'CommandArguments': None,
+'Attach':'false',
+'DebuggerType':'3',
+'Remote':'1',
+'RemoteMachine': None,
+'RemoteCommand': None,
+'HttpUrl': None,
+'PDBPath': None,
+'SQLDebugging': None,
+'Environment': None,
+'EnvironmentMerge':'true',
+'DebuggerFlavor': None,
+'MPIRunCommand': None,
+'MPIRunArguments': None,
+'MPIRunWorkingDirectory': None,
+'ApplicationCommand': None,
+'ApplicationArguments': None,
+'ShimCommand': None,
+'MPIAcceptMode': None,
+'MPIAcceptFilter': None,
+}
+
+class _GenerateV7User(_UserGenerator):
+    """Generates a Project file for MSVS .NET"""
+    def __init__(self, dspfile, source, env):
+        if self.version_num >= 9.0:
+            self.usrhead = V9UserHeader
+            self.usrconf = V9UserConfiguration
+            self.usrdebg = V9DebugSettings
+        _UserGenerator.__init__(self, dspfile, source, env)
+    
+    def UserProject(self):
+        confkeys = sorted(self.configs.keys())
+        for kind in confkeys:
+            variant = self.configs[kind].variant
+            platform = self.configs[kind].platform
+            debug = self.configs[kind].debug
+            if debug:
+                debug_settings = '\n'.join(['\t\t\t\t%s="%s"' % (key, xmlify(value)) 
+                                            for key, value in debug.items() 
+                                            if value is not None])
+                self.usrfile.write(self.usrconf % locals())
+        self.usrfile.write('\t</Configurations>\n</VisualStudioUserFile>')
+
+V10UserHeader = """\
+<?xml version="1.0" encoding="%(encoding)s"?>
+<Project ToolsVersion="%(versionstr)s" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+"""
+
+V10UserConfiguration = """\
+\t<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='%(variant)s|%(platform)s'">
+%(debug_settings)s
+\t</PropertyGroup>
+"""
+
+V10DebugSettings = {
+'LocalDebuggerCommand': None,
+'LocalDebuggerCommandArguments': None,
+'LocalDebuggerEnvironment': None,
+'DebuggerFlavor': 'WindowsLocalDebugger',
+'LocalDebuggerWorkingDirectory': None,
+'LocalDebuggerAttach': None,
+'LocalDebuggerDebuggerType': None,
+'LocalDebuggerMergeEnvironment': None,
+'LocalDebuggerSQLDebugging': None,
+'RemoteDebuggerCommand': None,
+'RemoteDebuggerCommandArguments': None,
+'RemoteDebuggerWorkingDirectory': None,
+'RemoteDebuggerServerName': None,
+'RemoteDebuggerConnection': None,
+'RemoteDebuggerDebuggerType': None,
+'RemoteDebuggerAttach': None,
+'RemoteDebuggerSQLDebugging': None,
+'DeploymentDirectory': None,
+'AdditionalFiles': None,
+'RemoteDebuggerDeployDebugCppRuntime': None,
+'WebBrowserDebuggerHttpUrl': None,
+'WebBrowserDebuggerDebuggerType': None,
+'WebServiceDebuggerHttpUrl': None,
+'WebServiceDebuggerDebuggerType': None,
+'WebServiceDebuggerSQLDebugging': None,
+}
+
+class _GenerateV10User(_UserGenerator):
+    """Generates a Project'user file for MSVS 2010"""
+    
+    def __init__(self, dspfile, source, env):
+        self.versionstr = '4.0'
+        self.usrhead = V10UserHeader
+        self.usrconf = V10UserConfiguration
+        self.usrdebg = V10DebugSettings
+        _UserGenerator.__init__(self, dspfile, source, env)
+
+    def UserProject(self):
+        confkeys = sorted(self.configs.keys())
+        for kind in confkeys:
+            variant = self.configs[kind].variant
+            platform = self.configs[kind].platform
+            debug = self.configs[kind].debug
+            if debug:
+                debug_settings = '\n'.join(['\t\t<%s>%s</%s>' % (key, xmlify(value), key) 
+                                            for key, value in debug.items() 
+                                            if value is not None])
+                self.usrfile.write(self.usrconf % locals())
+        self.usrfile.write('</Project>')
+
 class _DSPGenerator(object):
     """ Base class for DSP generators """
 
@@ -289,9 +493,17 @@ class _DSPGenerator(object):
                 runfile.append(s)
 
         self.sconscript = env['MSVSSCONSCRIPT']
-
-        cmdargs = env.get('cmdargs', '')
-
+        
+        if 'cmdargs' not in env or env['cmdargs'] == None:
+            cmdargs = [''] * len(variants)
+        elif SCons.Util.is_String(env['cmdargs']):
+            cmdargs = [env['cmdargs']] * len(variants)
+        elif SCons.Util.is_List(env['cmdargs']):
+            if len(env['cmdargs']) != len(variants):
+                raise SCons.Errors.InternalError("Sizes of 'cmdargs' and 'variant' lists must be the same.")
+            else:
+                cmdargs = env['cmdargs']
+                
         self.env = env
 
         if 'name' in self.env:
@@ -354,7 +566,7 @@ class _DSPGenerator(object):
             print "Adding '" + self.name + ' - ' + config.variant + '|' + config.platform + "' to '" + str(dspfile) + "'"
 
         for i in range(len(variants)):
-            AddConfig(self, variants[i], buildtarget[i], outdir[i], runfile[i], cmdargs)
+            AddConfig(self, variants[i], buildtarget[i], outdir[i], runfile[i], cmdargs[i])
 
         self.platforms = []
         for key in self.configs.keys():
@@ -620,7 +832,7 @@ V8DSPConfiguration = """\
 \t\t\t/>
 \t\t</Configuration>
 """
-class _GenerateV7DSP(_DSPGenerator):
+class _GenerateV7DSP(_DSPGenerator, _GenerateV7User):
     """Generates a Project file for MSVS .NET"""
 
     def __init__(self, dspfile, source, env):
@@ -643,6 +855,8 @@ class _GenerateV7DSP(_DSPGenerator):
             self.dspheader = V7DSPHeader
             self.dspconfiguration = V7DSPConfiguration
         self.file = None
+        
+        _GenerateV7User.__init__(self, dspfile, source, env)
 
     def PrintHeader(self):
         env = self.env
@@ -867,7 +1081,9 @@ class _GenerateV7DSP(_DSPGenerator):
             self.PrintHeader()
             self.PrintProject()
             self.file.close()
-			
+            
+        _GenerateV7User.Build(self)
+
 V10DSPHeader = """\
 <?xml version="1.0" encoding="%(encoding)s"?>
 <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
@@ -892,6 +1108,7 @@ V10DSPPropertyGroupCondition = """\
 \t<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='%(variant)s|%(platform)s'" Label="Configuration">
 \t\t<ConfigurationType>Makefile</ConfigurationType>
 \t\t<UseOfMfc>false</UseOfMfc>
+\t\t<PlatformToolset>%(toolset)s</PlatformToolset>
 \t</PropertyGroup>
 """
 
@@ -913,15 +1130,16 @@ V10DSPCommandLine = """\
 \t\t<NMakeForcedUsingAssemblies Condition="'$(Configuration)|$(Platform)'=='%(variant)s|%(platform)s'">$(NMakeForcedUsingAssemblies)</NMakeForcedUsingAssemblies>
 """
 
-class _GenerateV10DSP(_DSPGenerator):
+class _GenerateV10DSP(_DSPGenerator, _GenerateV10User):
     """Generates a Project file for MSVS 2010"""
 
     def __init__(self, dspfile, source, env):
         _DSPGenerator.__init__(self, dspfile, source, env)
-        
         self.dspheader = V10DSPHeader
         self.dspconfiguration = V10DSPProjectConfiguration
         self.dspglobals = V10DSPGlobals
+        
+        _GenerateV10User.__init__(self, dspfile, source, env)
 
     def PrintHeader(self):
         env = self.env
@@ -972,6 +1190,10 @@ class _GenerateV10DSP(_DSPGenerator):
              
         self.file.write('\t<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />\n')
         
+        toolset = ''
+        if 'MSVC_VERSION' in self.env:
+            version_num, suite = msvs_parse_version(self.env['MSVC_VERSION'])
+            toolset = 'v%d' % (version_num * 10)
         for kind in confkeys:
             variant = self.configs[kind].variant
             platform = self.configs[kind].platform
@@ -1169,6 +1391,8 @@ class _GenerateV10DSP(_DSPGenerator):
             self.PrintHeader()
             self.PrintProject()
             self.file.close()
+            
+        _GenerateV10User.Build(self)
 
 class _DSWGenerator(object):
     """ Base class for DSW generators """
@@ -1206,7 +1430,7 @@ class _GenerateV7DSW(_DSWGenerator):
         self.version_num, self.suite = msvs_parse_version(self.version)
         self.versionstr = '7.00'
         if self.version_num >= 11.0:
-            self.versionstr = '12.0'
+            self.versionstr = '12.00'
         elif self.version_num >= 10.0:
             self.versionstr = '11.00'
         elif self.version_num >= 9.0:
@@ -1311,7 +1535,9 @@ class _GenerateV7DSW(_DSWGenerator):
     def PrintSolution(self):
         """Writes a solution file"""
         self.file.write('Microsoft Visual Studio Solution File, Format Version %s\n' % self.versionstr)
-        if self.versionstr >= 11.0:
+        if self.version_num >= 12.0:
+            self.file.write('# Visual Studio 14\n')
+        elif self.version_num >= 11.0:
             self.file.write('# Visual Studio 11\n')
         elif self.version_num >= 10.0:
             self.file.write('# Visual Studio 2010\n')
@@ -1654,6 +1880,10 @@ def projectEmitter(target, source, env):
         t, s = solutionEmitter(target, target, env)
         targetlist = targetlist + t
 
+    # Beginning with Visual Studio 2010 for each project file (.vcxproj) we have additional file (.vcxproj.filters)
+    if float(env['MSVS_VERSION']) >= 10.0:
+        targetlist.append(targetlist[0] + '.filters')
+
     return (targetlist, sourcelist)
 
 def solutionEmitter(target, source, env):
@@ -1753,7 +1983,7 @@ def generate(env):
         env['MSVSSCONSCRIPT'] = default_MSVS_SConscript
 
     env['MSVSSCONS'] = '"%s" -c "%s"' % (python_executable, getExecScriptMain(env))
-    env['MSVSSCONSFLAGS'] = '-C "${MSVSSCONSCRIPT.dir.abspath}" -f ${MSVSSCONSCRIPT.name}'
+    env['MSVSSCONSFLAGS'] = '-C "${MSVSSCONSCRIPT.dir.get_abspath()}" -f ${MSVSSCONSCRIPT.name}'
     env['MSVSSCONSCOM'] = '$MSVSSCONS $MSVSSCONSFLAGS'
     env['MSVSBUILDCOM'] = '$MSVSSCONSCOM "$MSVSBUILDTARGET"'
     env['MSVSREBUILDCOM'] = '$MSVSSCONSCOM "$MSVSBUILDTARGET"'
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/mwcc.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/mwcc.py
similarity index 96%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/mwcc.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/mwcc.py
index 689c2739ab3032cfd1ed3c50abefa4214408b9c7..a130d0fd86194feacfb8536f739825c0612dea3a 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/mwcc.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/mwcc.py
@@ -8,7 +8,7 @@ selection method.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -30,7 +30,7 @@ selection method.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/mwcc.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/mwcc.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import os
 import os.path
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/mwld.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/mwld.py
similarity index 94%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/mwld.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/mwld.py
index 30149c37e6d53ab7f9e0e87e7ea68db9463e4a39..8f6f3a2b0b23e6705a0d1a40f5aeb4a814ac879f 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/mwld.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/mwld.py
@@ -8,7 +8,7 @@ selection method.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -30,7 +30,7 @@ selection method.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/mwld.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/mwld.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import SCons.Tool
 
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/nasm.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/nasm.py
similarity index 92%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/nasm.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/nasm.py
index e76b51ab17446a752dbb28be15decb5f5347eef7..86a7ef81c6a84343366989573907919a787ead9e 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/nasm.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/nasm.py
@@ -9,7 +9,7 @@ selection method.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -31,7 +31,7 @@ selection method.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/nasm.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/nasm.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import SCons.Defaults
 import SCons.Tool
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/packaging/__init__.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/packaging/__init__.py
similarity index 94%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/packaging/__init__.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/packaging/__init__.py
index f2b953d67d27bc19713ab75333dbb5fa6c4cc640..2107d5f728dc9937f4948f116ba095ca70f9810d 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/packaging/__init__.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/packaging/__init__.py
@@ -4,7 +4,7 @@ SCons Packaging Tool.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -25,7 +25,7 @@ SCons Packaging Tool.
 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
-__revision__ = "src/engine/SCons/Tool/packaging/__init__.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/packaging/__init__.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import SCons.Environment
 from SCons.Variables import *
@@ -80,7 +80,7 @@ def Tag(env, target, source, *more_tags, **kw_tags):
             #if not k.startswith('PACKAGING_'):
             if k[:10] != 'PACKAGING_':
                 k='PACKAGING_'+k
-            setattr(t, k, v)
+            t.Tag(k, v)
 
 def Package(env, target=None, source=None, **kw):
     """ Entry point for the package tool.
@@ -235,9 +235,11 @@ def copy_attr(f1, f2):
     #pattrs = [x for x in dir(f1) if not hasattr(f2, x) and\
     #                                x.startswith('PACKAGING_')]
     copyit = lambda x: not hasattr(f2, x) and x[:10] == 'PACKAGING_'
-    pattrs = list(filter(copyit, dir(f1)))
-    for attr in pattrs:
-        setattr(f2, attr, getattr(f1, attr))
+    if f1._tags:
+        pattrs = list(filter(copyit, f1._tags))
+        for attr in pattrs:
+            f2.Tag(attr, f1.GetTag(attr))
+
 def putintopackageroot(target, source, env, pkgroot, honor_install_location=1):
     """ Uses the CopyAs builder to copy all source files to the directory given
     in pkgroot.
@@ -262,9 +264,9 @@ def putintopackageroot(target, source, env, pkgroot, honor_install_location=1):
         if file.is_under(pkgroot):
             new_source.append(file)
         else:
-            if hasattr(file, 'PACKAGING_INSTALL_LOCATION') and\
+            if file.GetTag('PACKAGING_INSTALL_LOCATION') and\
                        honor_install_location:
-                new_name=make_path_relative(file.PACKAGING_INSTALL_LOCATION)
+                new_name=make_path_relative(file.GetTag('PACKAGING_INSTALL_LOCATION'))
             else:
                 new_name=make_path_relative(file.get_path())
 
@@ -301,7 +303,7 @@ def stripinstallbuilder(target, source, env):
             for ss in s.sources:
                 n_source.append(ss)
                 copy_attr(s, ss)
-                setattr(ss, 'PACKAGING_INSTALL_LOCATION', s.get_path())
+                ss.Tag('PACKAGING_INSTALL_LOCATION', s.get_path())
 
     return (target, n_source)
 
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/packaging/ipk.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/packaging/ipk.py
similarity index 95%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/packaging/ipk.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/packaging/ipk.py
index 251de8a330578f655abce0d1eb1f9300c643e030..51c3381e3568d393dbac1a44e6e65f48c4181719 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/packaging/ipk.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/packaging/ipk.py
@@ -2,7 +2,7 @@
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 # 
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -24,7 +24,7 @@
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/packaging/ipk.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/packaging/ipk.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import SCons.Builder
 import SCons.Node.FS
@@ -120,7 +120,7 @@ def build_specfiles(source, target, env):
             return opened_files[needle]
         except KeyError:
             file=filter(lambda x: x.get_path().rfind(needle)!=-1, haystack)[0]
-            opened_files[needle]=open(file.abspath, 'w')
+            opened_files[needle]=open(file.get_abspath(), 'w')
             return opened_files[needle]
 
     control_file=open_file('control', target)
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/packaging/msi.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/packaging/msi.py
similarity index 98%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/packaging/msi.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/packaging/msi.py
index dc593b3380eeabb3d5f5208f5fef772e5c2626b2..41b7c77708b2ed89816e5cff115de1d5b7009e7e 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/packaging/msi.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/packaging/msi.py
@@ -4,7 +4,7 @@ The msi packager.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 # 
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -25,7 +25,7 @@ The msi packager.
 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
-__revision__ = "src/engine/SCons/Tool/packaging/msi.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/packaging/msi.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import os
 import SCons
@@ -189,7 +189,7 @@ def build_wxsfile(target, source, env):
     """ compiles a .wxs file from the keywords given in env['msi_spec'] and
         by analyzing the tree of source nodes and their tags.
     """
-    file = open(target[0].abspath, 'w')
+    file = open(target[0].get_abspath(), 'w')
 
     try:
         # Create a document with the Wix root tag
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/packaging/rpm.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/packaging/rpm.py
similarity index 94%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/packaging/rpm.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/packaging/rpm.py
index 1c83b6bbaaea3af103f0a16102ce50f60b948def..f7e25770ff02e83670017f04b46afbcdd96b47c3 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/packaging/rpm.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/packaging/rpm.py
@@ -4,7 +4,7 @@ The rpm packager.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -25,11 +25,12 @@ The rpm packager.
 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
-__revision__ = "src/engine/SCons/Tool/packaging/rpm.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/packaging/rpm.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import os
 
 import SCons.Builder
+import SCons.Tool.rpmutils
 
 from SCons.Environment import OverrideEnvironment
 from SCons.Tool.packaging import stripinstallbuilder, src_targz
@@ -52,16 +53,7 @@ def package(env, target, source, PACKAGEROOT, NAME, VERSION,
     else:
         # This should be overridable from the construction environment,
         # which it is by using ARCHITECTURE=.
-        # Guessing based on what os.uname() returns at least allows it
-        # to work for both i386 and x86_64 Linux systems.
-        archmap = {
-            'i686'  : 'i386',
-            'i586'  : 'i386',
-            'i486'  : 'i386',
-        }
-
-        buildarchitecture = os.uname()[4]
-        buildarchitecture = archmap.get(buildarchitecture, buildarchitecture)
+        buildarchitecture = SCons.Tool.rpmutils.defaultMachine()
 
         if 'ARCHITECTURE' in kw:
             buildarchitecture = kw['ARCHITECTURE']
@@ -138,8 +130,7 @@ def build_specfile(target, source, env):
     """ Builds a RPM specfile from a dictionary with string metadata and
     by analyzing a tree of nodes.
     """
-    file = open(target[0].abspath, 'w')
-    str  = ""
+    file = open(target[0].get_abspath(), 'w')
 
     try:
         file.write( build_specfile_header(env) )
@@ -190,7 +181,7 @@ def build_specfile_sections(spec):
         spec['X_RPM_PREP'] = '[ -n "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != / ] && rm -rf "$RPM_BUILD_ROOT"' + '\n%setup -q'
 
     if 'X_RPM_BUILD' not in spec:
-        spec['X_RPM_BUILD'] = 'mkdir "$RPM_BUILD_ROOT"'
+        spec['X_RPM_BUILD'] = '[ ! -e "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != / ] && mkdir "$RPM_BUILD_ROOT"'
 
     if 'X_RPM_INSTALL' not in spec:
         spec['X_RPM_INSTALL'] = 'scons --install-sandbox="$RPM_BUILD_ROOT" "$RPM_BUILD_ROOT"'
@@ -287,7 +278,9 @@ def build_specfile_filesection(spec, files):
         tags = {}
         for k in supported_tags.keys():
             try:
-                tags[k]=getattr(file, k)
+                v = file.GetTag(k)
+                if v:
+                    tags[k] = v
             except AttributeError:
                 pass
 
@@ -295,7 +288,7 @@ def build_specfile_filesection(spec, files):
         str = str + SimpleTagCompiler(supported_tags, mandatory=0).compile( tags )
 
         str = str + ' '
-        str = str + file.PACKAGING_INSTALL_LOCATION
+        str = str + file.GetTag('PACKAGING_INSTALL_LOCATION')
         str = str + '\n\n'
 
     return str
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/packaging/src_tarbz2.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/packaging/src_tarbz2.py
similarity index 87%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/packaging/src_tarbz2.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/packaging/src_tarbz2.py
index 41c37ac4bf6887ba65bdfc34cb65182eaa975d90..438fc2099be7a6e4688794225d1adda66e397eb1 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/packaging/src_tarbz2.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/packaging/src_tarbz2.py
@@ -4,7 +4,7 @@ The tarbz2 SRC packager.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 # 
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -26,7 +26,7 @@ The tarbz2 SRC packager.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/packaging/src_tarbz2.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/packaging/src_tarbz2.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 from SCons.Tool.packaging import putintopackageroot
 
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/packaging/src_targz.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/packaging/src_targz.py
similarity index 87%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/packaging/src_targz.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/packaging/src_targz.py
index dbf1c2bbea4db3644735efa3da7b2ca29379dbae..6a85869c279599451d8663fc7c5da84b9ab815a0 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/packaging/src_targz.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/packaging/src_targz.py
@@ -4,7 +4,7 @@ The targz SRC packager.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -26,7 +26,7 @@ The targz SRC packager.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/packaging/src_targz.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/packaging/src_targz.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 from SCons.Tool.packaging import putintopackageroot
 
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/packaging/src_zip.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/packaging/src_zip.py
similarity index 87%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/packaging/src_zip.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/packaging/src_zip.py
index e12c3667b8aaa3c8f4e1ed4c0d8e8ef23b05014e..e1a1d4963518ba553690b3d65da8410b241d8eca 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/packaging/src_zip.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/packaging/src_zip.py
@@ -4,7 +4,7 @@ The zip SRC packager.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 # 
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -26,7 +26,7 @@ The zip SRC packager.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/packaging/src_zip.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/packaging/src_zip.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 from SCons.Tool.packaging import putintopackageroot
 
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/packaging/tarbz2.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/packaging/tarbz2.py
similarity index 87%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/packaging/tarbz2.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/packaging/tarbz2.py
index 73964eb8315157d87f67105e6d0dd36a1d0cfc3b..79f82198d8953fd70ba9372184e7f53e104bb9eb 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/packaging/tarbz2.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/packaging/tarbz2.py
@@ -4,7 +4,7 @@ The tarbz2 SRC packager.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 # 
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -26,7 +26,7 @@ The tarbz2 SRC packager.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/packaging/tarbz2.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/packaging/tarbz2.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 from SCons.Tool.packaging import stripinstallbuilder, putintopackageroot
 
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/packaging/targz.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/packaging/targz.py
similarity index 87%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/packaging/targz.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/packaging/targz.py
index 1019bdbf52ae17b14a27a15c673c63ed8ceb017c..eeb3d6a325ce897484bf5378911d2b76ecf0a98c 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/packaging/targz.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/packaging/targz.py
@@ -4,7 +4,7 @@ The targz SRC packager.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 # 
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -26,7 +26,7 @@ The targz SRC packager.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/packaging/targz.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/packaging/targz.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 from SCons.Tool.packaging import stripinstallbuilder, putintopackageroot
 
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/packaging/zip.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/packaging/zip.py
similarity index 87%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/packaging/zip.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/packaging/zip.py
index a96278749bea66a0b3078665253d9da7550b3bab..6c4037d528cc3b977fd1d39322ef9bb755170fc9 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/packaging/zip.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/packaging/zip.py
@@ -4,7 +4,7 @@ The zip SRC packager.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 # 
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -26,7 +26,7 @@ The zip SRC packager.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/packaging/zip.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/packaging/zip.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 from SCons.Tool.packaging import stripinstallbuilder, putintopackageroot
 
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/pdf.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/pdf.py
similarity index 93%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/pdf.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/pdf.py
index beae6dd2a39186bcc6e5a48d375b9b6cdc352767..0ccb49b0db9a163d190222aaa9c8859dfc0ea8cc 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/pdf.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/pdf.py
@@ -6,7 +6,7 @@ Add an explicit action to run epstopdf to convert .eps files to .pdf
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -28,7 +28,7 @@ Add an explicit action to run epstopdf to convert .eps files to .pdf
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/pdf.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/pdf.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import SCons.Builder
 import SCons.Tool
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/pdflatex.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/pdflatex.py
similarity index 92%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/pdflatex.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/pdflatex.py
index 9d2a449ecf5229c4b94ada01a884521b8463694f..42188f414eff36af3ba3aec80343063d8f3fc174 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/pdflatex.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/pdflatex.py
@@ -10,7 +10,7 @@ selection method.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -32,7 +32,7 @@ selection method.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/pdflatex.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/pdflatex.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import SCons.Action
 import SCons.Util
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/pdftex.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/pdftex.py
similarity index 94%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/pdftex.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/pdftex.py
index b5898c17f258c20b9e1da168ed0583ed40731304..e38a27866276843755fe73e7ca1991cd1c504719 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/pdftex.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/pdftex.py
@@ -10,7 +10,7 @@ selection method.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -32,7 +32,7 @@ selection method.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/pdftex.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/pdftex.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import os
 import SCons.Action
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/qt.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/qt.py
similarity index 98%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/qt.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/qt.py
index d40337d44df02f55cb6d28ffe38a2c2e77387def..b8233c06c3e3c29ac1f70fbcc75836c81de09a8b 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/qt.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/qt.py
@@ -10,7 +10,7 @@ selection method.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -32,7 +32,7 @@ selection method.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/qt.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/qt.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import os.path
 import re
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/rmic.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/rmic.py
similarity index 95%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/rmic.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/rmic.py
index 0b32f06bd058bb3e41c7f0e395aae06c35e66904..6045b7fcc415de203dd5f0f530aa14b5028afe65 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/rmic.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/rmic.py
@@ -9,7 +9,7 @@ selection method.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -31,7 +31,7 @@ selection method.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/rmic.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/rmic.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import os.path
 
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/rpcgen.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/rpcgen.py
similarity index 92%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/rpcgen.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/rpcgen.py
index c1542dc551a32d18ad48755cd139d1f01ad7ca3b..1a3de76e943713c6ec14f5c336554e2b85414caa 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/rpcgen.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/rpcgen.py
@@ -8,7 +8,7 @@ selection method.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -30,7 +30,7 @@ selection method.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/rpcgen.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/rpcgen.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 from SCons.Builder import Builder
 import SCons.Util
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/rpm.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/rpm.py
similarity index 88%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/rpm.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/rpm.py
index 3a4d6a928af82700f05a2c27afa30ce4932963e3..46b31124b7b6b9ed092e8d5ed58c2171eaca7143 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/rpm.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/rpm.py
@@ -11,7 +11,7 @@ tar.gz consisting of the source file and a specfile.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -33,7 +33,7 @@ tar.gz consisting of the source file and a specfile.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/rpm.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/rpm.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import os
 import re
@@ -51,11 +51,11 @@ def get_cmd(source, env):
     if SCons.Util.is_List(source):
         tar_file_with_included_specfile = source[0]
     return "%s %s %s"%(env['RPM'], env['RPMFLAGS'],
-                       tar_file_with_included_specfile.abspath )
+                       tar_file_with_included_specfile.get_abspath() )
 
 def build_rpm(target, source, env):
     # create a temporary rpm build root.
-    tmpdir = os.path.join( os.path.dirname( target[0].abspath ), 'rpmtemp' )
+    tmpdir = os.path.join( os.path.dirname( target[0].get_abspath() ), 'rpmtemp' )
     if os.path.exists(tmpdir):
         shutil.rmtree(tmpdir)
 
@@ -79,7 +79,7 @@ def build_rpm(target, source, env):
                                        errstr=output,
                                        filename=str(target[0]) )
     else:
-        # XXX: assume that LC_ALL=c is set while running rpmbuild
+        # XXX: assume that LC_ALL=C is set while running rpmbuild
         output_files = re.compile( 'Wrote: (.*)' ).findall( output )
 
         for output, input in zip( output_files, target ):
@@ -87,7 +87,7 @@ def build_rpm(target, source, env):
             expected   = os.path.basename(input.get_path())
 
             assert expected == rpm_output, "got %s but expected %s" % (rpm_output, expected)
-            shutil.copy( output, input.abspath )
+            shutil.copy( output, input.get_abspath() )
 
 
     # cleanup before leaving.
@@ -117,7 +117,7 @@ def generate(env):
         bld = RpmBuilder
         env['BUILDERS']['Rpm'] = bld
 
-    env.SetDefault(RPM          = 'LC_ALL=c rpmbuild')
+    env.SetDefault(RPM          = 'LC_ALL=C rpmbuild')
     env.SetDefault(RPMFLAGS     = SCons.Util.CLVar('-ta'))
     env.SetDefault(RPMCOM       = rpmAction)
     env.SetDefault(RPMSUFFIX    = '.rpm')
diff --git a/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/rpmutils.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/rpmutils.py
new file mode 100644
index 0000000000000000000000000000000000000000..10b5560059d22abd3aeaa2d240adec408bd1f080
--- /dev/null
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/rpmutils.py
@@ -0,0 +1,543 @@
+"""SCons.Tool.rpmutils.py
+
+RPM specific helper routines for general usage in the test framework
+and SCons core modules.
+
+Since we check for the RPM package target name in several places,
+we have to know which machine/system name RPM will use for the current
+hardware setup. The following dictionaries and functions try to
+mimic the exact naming rules of the RPM source code.
+They were directly derived from the file "rpmrc.in" of the version
+rpm-4.9.1.3. For updating to a more recent version of RPM, this Python
+script can be used standalone. The usage() function below shows the
+exact syntax.
+
+"""
+
+# Copyright (c) 2001 - 2015 The SCons Foundation
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+__revision__ = "src/engine/SCons/Tool/rpmutils.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
+
+
+import platform
+import subprocess
+
+# Start of rpmrc dictionaries (Marker, don't change or remove!)
+os_canon = {
+  'AIX' : ['AIX','5'],
+  'AmigaOS' : ['AmigaOS','5'],
+  'BSD_OS' : ['bsdi','12'],
+  'CYGWIN32_95' : ['cygwin32','15'],
+  'CYGWIN32_NT' : ['cygwin32','14'],
+  'Darwin' : ['darwin','21'],
+  'FreeBSD' : ['FreeBSD','8'],
+  'HP-UX' : ['hpux10','6'],
+  'IRIX' : ['Irix','2'],
+  'IRIX64' : ['Irix64','10'],
+  'Linux' : ['Linux','1'],
+  'Linux/390' : ['OS/390','20'],
+  'Linux/ESA' : ['VM/ESA','20'],
+  'MacOSX' : ['macosx','21'],
+  'MiNT' : ['FreeMiNT','17'],
+  'NEXTSTEP' : ['NextStep','11'],
+  'OS/390' : ['OS/390','18'],
+  'OSF1' : ['osf1','7'],
+  'SCO_SV' : ['SCO_SV3.2v5.0.2','9'],
+  'SunOS4' : ['SunOS','4'],
+  'SunOS5' : ['solaris','3'],
+  'UNIX_SV' : ['MP_RAS','16'],
+  'VM/ESA' : ['VM/ESA','19'],
+  'machten' : ['machten','13'],
+  'osf3.2' : ['osf1','7'],
+  'osf4.0' : ['osf1','7'],
+}
+
+buildarch_compat = {
+  'alpha' : ['noarch'],
+  'alphaev5' : ['alpha'],
+  'alphaev56' : ['alphaev5'],
+  'alphaev6' : ['alphapca56'],
+  'alphaev67' : ['alphaev6'],
+  'alphapca56' : ['alphaev56'],
+  'amd64' : ['x86_64'],
+  'armv3l' : ['noarch'],
+  'armv4b' : ['noarch'],
+  'armv4l' : ['armv3l'],
+  'armv4tl' : ['armv4l'],
+  'armv5tejl' : ['armv5tel'],
+  'armv5tel' : ['armv4tl'],
+  'armv6l' : ['armv5tejl'],
+  'armv7l' : ['armv6l'],
+  'atariclone' : ['m68kmint','noarch'],
+  'atarist' : ['m68kmint','noarch'],
+  'atariste' : ['m68kmint','noarch'],
+  'ataritt' : ['m68kmint','noarch'],
+  'athlon' : ['i686'],
+  'falcon' : ['m68kmint','noarch'],
+  'geode' : ['i586'],
+  'hades' : ['m68kmint','noarch'],
+  'hppa1.0' : ['parisc'],
+  'hppa1.1' : ['hppa1.0'],
+  'hppa1.2' : ['hppa1.1'],
+  'hppa2.0' : ['hppa1.2'],
+  'i386' : ['noarch','fat'],
+  'i486' : ['i386'],
+  'i586' : ['i486'],
+  'i686' : ['i586'],
+  'ia32e' : ['x86_64'],
+  'ia64' : ['noarch'],
+  'm68k' : ['noarch'],
+  'milan' : ['m68kmint','noarch'],
+  'mips' : ['noarch'],
+  'mipsel' : ['noarch'],
+  'parisc' : ['noarch'],
+  'pentium3' : ['i686'],
+  'pentium4' : ['pentium3'],
+  'ppc' : ['noarch','fat'],
+  'ppc32dy4' : ['noarch'],
+  'ppc64' : ['noarch','fat'],
+  'ppc64iseries' : ['ppc64'],
+  'ppc64pseries' : ['ppc64'],
+  'ppc8260' : ['noarch'],
+  'ppc8560' : ['noarch'],
+  'ppciseries' : ['noarch'],
+  'ppcpseries' : ['noarch'],
+  's390' : ['noarch'],
+  's390x' : ['noarch'],
+  'sh3' : ['noarch'],
+  'sh4' : ['noarch'],
+  'sh4a' : ['sh4'],
+  'sparc' : ['noarch'],
+  'sparc64' : ['sparcv9v'],
+  'sparc64v' : ['sparc64'],
+  'sparcv8' : ['sparc'],
+  'sparcv9' : ['sparcv8'],
+  'sparcv9v' : ['sparcv9'],
+  'sun4c' : ['noarch'],
+  'sun4d' : ['noarch'],
+  'sun4m' : ['noarch'],
+  'sun4u' : ['noarch'],
+  'x86_64' : ['noarch'],
+}
+
+os_compat = {
+  'BSD_OS' : ['bsdi'],
+  'Darwin' : ['MacOSX'],
+  'FreeMiNT' : ['mint','MiNT','TOS'],
+  'IRIX64' : ['IRIX'],
+  'MiNT' : ['FreeMiNT','mint','TOS'],
+  'TOS' : ['FreeMiNT','MiNT','mint'],
+  'bsdi4.0' : ['bsdi'],
+  'hpux10.00' : ['hpux9.07'],
+  'hpux10.01' : ['hpux10.00'],
+  'hpux10.10' : ['hpux10.01'],
+  'hpux10.20' : ['hpux10.10'],
+  'hpux10.30' : ['hpux10.20'],
+  'hpux11.00' : ['hpux10.30'],
+  'hpux9.05' : ['hpux9.04'],
+  'hpux9.07' : ['hpux9.05'],
+  'mint' : ['FreeMiNT','MiNT','TOS'],
+  'ncr-sysv4.3' : ['ncr-sysv4.2'],
+  'osf4.0' : ['osf3.2','osf1'],
+  'solaris2.4' : ['solaris2.3'],
+  'solaris2.5' : ['solaris2.3','solaris2.4'],
+  'solaris2.6' : ['solaris2.3','solaris2.4','solaris2.5'],
+  'solaris2.7' : ['solaris2.3','solaris2.4','solaris2.5','solaris2.6'],
+}
+
+arch_compat = {
+  'alpha' : ['axp','noarch'],
+  'alphaev5' : ['alpha'],
+  'alphaev56' : ['alphaev5'],
+  'alphaev6' : ['alphapca56'],
+  'alphaev67' : ['alphaev6'],
+  'alphapca56' : ['alphaev56'],
+  'amd64' : ['x86_64','athlon','noarch'],
+  'armv3l' : ['noarch'],
+  'armv4b' : ['noarch'],
+  'armv4l' : ['armv3l'],
+  'armv4tl' : ['armv4l'],
+  'armv5tejl' : ['armv5tel'],
+  'armv5tel' : ['armv4tl'],
+  'armv6l' : ['armv5tejl'],
+  'armv7l' : ['armv6l'],
+  'atariclone' : ['m68kmint','noarch'],
+  'atarist' : ['m68kmint','noarch'],
+  'atariste' : ['m68kmint','noarch'],
+  'ataritt' : ['m68kmint','noarch'],
+  'athlon' : ['i686'],
+  'falcon' : ['m68kmint','noarch'],
+  'geode' : ['i586'],
+  'hades' : ['m68kmint','noarch'],
+  'hppa1.0' : ['parisc'],
+  'hppa1.1' : ['hppa1.0'],
+  'hppa1.2' : ['hppa1.1'],
+  'hppa2.0' : ['hppa1.2'],
+  'i370' : ['noarch'],
+  'i386' : ['noarch','fat'],
+  'i486' : ['i386'],
+  'i586' : ['i486'],
+  'i686' : ['i586'],
+  'ia32e' : ['x86_64','athlon','noarch'],
+  'ia64' : ['noarch'],
+  'milan' : ['m68kmint','noarch'],
+  'mips' : ['noarch'],
+  'mipsel' : ['noarch'],
+  'osfmach3_i386' : ['i486'],
+  'osfmach3_i486' : ['i486','osfmach3_i386'],
+  'osfmach3_i586' : ['i586','osfmach3_i486'],
+  'osfmach3_i686' : ['i686','osfmach3_i586'],
+  'osfmach3_ppc' : ['ppc'],
+  'parisc' : ['noarch'],
+  'pentium3' : ['i686'],
+  'pentium4' : ['pentium3'],
+  'powerpc' : ['ppc'],
+  'powerppc' : ['ppc'],
+  'ppc' : ['rs6000'],
+  'ppc32dy4' : ['ppc'],
+  'ppc64' : ['ppc'],
+  'ppc64iseries' : ['ppc64'],
+  'ppc64pseries' : ['ppc64'],
+  'ppc8260' : ['ppc'],
+  'ppc8560' : ['ppc'],
+  'ppciseries' : ['ppc'],
+  'ppcpseries' : ['ppc'],
+  'rs6000' : ['noarch','fat'],
+  's390' : ['noarch'],
+  's390x' : ['s390','noarch'],
+  'sh3' : ['noarch'],
+  'sh4' : ['noarch'],
+  'sh4a' : ['sh4'],
+  'sparc' : ['noarch'],
+  'sparc64' : ['sparcv9'],
+  'sparc64v' : ['sparc64'],
+  'sparcv8' : ['sparc'],
+  'sparcv9' : ['sparcv8'],
+  'sparcv9v' : ['sparcv9'],
+  'sun4c' : ['sparc'],
+  'sun4d' : ['sparc'],
+  'sun4m' : ['sparc'],
+  'sun4u' : ['sparc64'],
+  'x86_64' : ['amd64','athlon','noarch'],
+}
+
+buildarchtranslate = {
+  'alphaev5' : ['alpha'],
+  'alphaev56' : ['alpha'],
+  'alphaev6' : ['alpha'],
+  'alphaev67' : ['alpha'],
+  'alphapca56' : ['alpha'],
+  'amd64' : ['x86_64'],
+  'armv3l' : ['armv3l'],
+  'armv4b' : ['armv4b'],
+  'armv4l' : ['armv4l'],
+  'armv4tl' : ['armv4tl'],
+  'armv5tejl' : ['armv5tejl'],
+  'armv5tel' : ['armv5tel'],
+  'armv6l' : ['armv6l'],
+  'armv7l' : ['armv7l'],
+  'atariclone' : ['m68kmint'],
+  'atarist' : ['m68kmint'],
+  'atariste' : ['m68kmint'],
+  'ataritt' : ['m68kmint'],
+  'athlon' : ['i386'],
+  'falcon' : ['m68kmint'],
+  'geode' : ['i386'],
+  'hades' : ['m68kmint'],
+  'i386' : ['i386'],
+  'i486' : ['i386'],
+  'i586' : ['i386'],
+  'i686' : ['i386'],
+  'ia32e' : ['x86_64'],
+  'ia64' : ['ia64'],
+  'milan' : ['m68kmint'],
+  'osfmach3_i386' : ['i386'],
+  'osfmach3_i486' : ['i386'],
+  'osfmach3_i586' : ['i386'],
+  'osfmach3_i686' : ['i386'],
+  'osfmach3_ppc' : ['ppc'],
+  'pentium3' : ['i386'],
+  'pentium4' : ['i386'],
+  'powerpc' : ['ppc'],
+  'powerppc' : ['ppc'],
+  'ppc32dy4' : ['ppc'],
+  'ppc64iseries' : ['ppc64'],
+  'ppc64pseries' : ['ppc64'],
+  'ppc8260' : ['ppc'],
+  'ppc8560' : ['ppc'],
+  'ppciseries' : ['ppc'],
+  'ppcpseries' : ['ppc'],
+  's390' : ['s390'],
+  's390x' : ['s390x'],
+  'sh3' : ['sh3'],
+  'sh4' : ['sh4'],
+  'sh4a' : ['sh4'],
+  'sparc64v' : ['sparc64'],
+  'sparcv8' : ['sparc'],
+  'sparcv9' : ['sparc'],
+  'sparcv9v' : ['sparc'],
+  'sun4c' : ['sparc'],
+  'sun4d' : ['sparc'],
+  'sun4m' : ['sparc'],
+  'sun4u' : ['sparc64'],
+  'x86_64' : ['x86_64'],
+}
+
+optflags = {
+  'alpha' : ['-O2','-g','-mieee'],
+  'alphaev5' : ['-O2','-g','-mieee','-mtune=ev5'],
+  'alphaev56' : ['-O2','-g','-mieee','-mtune=ev56'],
+  'alphaev6' : ['-O2','-g','-mieee','-mtune=ev6'],
+  'alphaev67' : ['-O2','-g','-mieee','-mtune=ev67'],
+  'alphapca56' : ['-O2','-g','-mieee','-mtune=pca56'],
+  'amd64' : ['-O2','-g'],
+  'armv3l' : ['-O2','-g','-march=armv3'],
+  'armv4b' : ['-O2','-g','-march=armv4'],
+  'armv4l' : ['-O2','-g','-march=armv4'],
+  'armv4tl' : ['-O2','-g','-march=armv4t'],
+  'armv5tejl' : ['-O2','-g','-march=armv5te'],
+  'armv5tel' : ['-O2','-g','-march=armv5te'],
+  'armv6l' : ['-O2','-g','-march=armv6'],
+  'armv7l' : ['-O2','-g','-march=armv7'],
+  'atariclone' : ['-O2','-g','-fomit-frame-pointer'],
+  'atarist' : ['-O2','-g','-fomit-frame-pointer'],
+  'atariste' : ['-O2','-g','-fomit-frame-pointer'],
+  'ataritt' : ['-O2','-g','-fomit-frame-pointer'],
+  'athlon' : ['-O2','-g','-march=athlon'],
+  'falcon' : ['-O2','-g','-fomit-frame-pointer'],
+  'fat' : ['-O2','-g','-arch','i386','-arch','ppc'],
+  'geode' : ['-Os','-g','-m32','-march=geode'],
+  'hades' : ['-O2','-g','-fomit-frame-pointer'],
+  'hppa1.0' : ['-O2','-g','-mpa-risc-1-0'],
+  'hppa1.1' : ['-O2','-g','-mpa-risc-1-0'],
+  'hppa1.2' : ['-O2','-g','-mpa-risc-1-0'],
+  'hppa2.0' : ['-O2','-g','-mpa-risc-1-0'],
+  'i386' : ['-O2','-g','-march=i386','-mtune=i686'],
+  'i486' : ['-O2','-g','-march=i486'],
+  'i586' : ['-O2','-g','-march=i586'],
+  'i686' : ['-O2','-g','-march=i686'],
+  'ia32e' : ['-O2','-g'],
+  'ia64' : ['-O2','-g'],
+  'm68k' : ['-O2','-g','-fomit-frame-pointer'],
+  'milan' : ['-O2','-g','-fomit-frame-pointer'],
+  'mips' : ['-O2','-g'],
+  'mipsel' : ['-O2','-g'],
+  'parisc' : ['-O2','-g','-mpa-risc-1-0'],
+  'pentium3' : ['-O2','-g','-march=pentium3'],
+  'pentium4' : ['-O2','-g','-march=pentium4'],
+  'ppc' : ['-O2','-g','-fsigned-char'],
+  'ppc32dy4' : ['-O2','-g','-fsigned-char'],
+  'ppc64' : ['-O2','-g','-fsigned-char'],
+  'ppc8260' : ['-O2','-g','-fsigned-char'],
+  'ppc8560' : ['-O2','-g','-fsigned-char'],
+  'ppciseries' : ['-O2','-g','-fsigned-char'],
+  'ppcpseries' : ['-O2','-g','-fsigned-char'],
+  's390' : ['-O2','-g'],
+  's390x' : ['-O2','-g'],
+  'sh3' : ['-O2','-g'],
+  'sh4' : ['-O2','-g','-mieee'],
+  'sh4a' : ['-O2','-g','-mieee'],
+  'sparc' : ['-O2','-g','-m32','-mtune=ultrasparc'],
+  'sparc64' : ['-O2','-g','-m64','-mtune=ultrasparc'],
+  'sparc64v' : ['-O2','-g','-m64','-mtune=niagara'],
+  'sparcv8' : ['-O2','-g','-m32','-mtune=ultrasparc','-mv8'],
+  'sparcv9' : ['-O2','-g','-m32','-mtune=ultrasparc'],
+  'sparcv9v' : ['-O2','-g','-m32','-mtune=niagara'],
+  'x86_64' : ['-O2','-g'],
+}
+
+arch_canon = {
+  'IP' : ['sgi','7'],
+  'alpha' : ['alpha','2'],
+  'alphaev5' : ['alphaev5','2'],
+  'alphaev56' : ['alphaev56','2'],
+  'alphaev6' : ['alphaev6','2'],
+  'alphaev67' : ['alphaev67','2'],
+  'alphapca56' : ['alphapca56','2'],
+  'amd64' : ['amd64','1'],
+  'armv3l' : ['armv3l','12'],
+  'armv4b' : ['armv4b','12'],
+  'armv4l' : ['armv4l','12'],
+  'armv5tejl' : ['armv5tejl','12'],
+  'armv5tel' : ['armv5tel','12'],
+  'armv6l' : ['armv6l','12'],
+  'armv7l' : ['armv7l','12'],
+  'atariclone' : ['m68kmint','13'],
+  'atarist' : ['m68kmint','13'],
+  'atariste' : ['m68kmint','13'],
+  'ataritt' : ['m68kmint','13'],
+  'athlon' : ['athlon','1'],
+  'falcon' : ['m68kmint','13'],
+  'geode' : ['geode','1'],
+  'hades' : ['m68kmint','13'],
+  'i370' : ['i370','14'],
+  'i386' : ['i386','1'],
+  'i486' : ['i486','1'],
+  'i586' : ['i586','1'],
+  'i686' : ['i686','1'],
+  'ia32e' : ['ia32e','1'],
+  'ia64' : ['ia64','9'],
+  'm68k' : ['m68k','6'],
+  'm68kmint' : ['m68kmint','13'],
+  'milan' : ['m68kmint','13'],
+  'mips' : ['mips','4'],
+  'mipsel' : ['mipsel','11'],
+  'pentium3' : ['pentium3','1'],
+  'pentium4' : ['pentium4','1'],
+  'ppc' : ['ppc','5'],
+  'ppc32dy4' : ['ppc32dy4','5'],
+  'ppc64' : ['ppc64','16'],
+  'ppc64iseries' : ['ppc64iseries','16'],
+  'ppc64pseries' : ['ppc64pseries','16'],
+  'ppc8260' : ['ppc8260','5'],
+  'ppc8560' : ['ppc8560','5'],
+  'ppciseries' : ['ppciseries','5'],
+  'ppcpseries' : ['ppcpseries','5'],
+  'rs6000' : ['rs6000','8'],
+  's390' : ['s390','14'],
+  's390x' : ['s390x','15'],
+  'sh' : ['sh','17'],
+  'sh3' : ['sh3','17'],
+  'sh4' : ['sh4','17'],
+  'sh4a' : ['sh4a','17'],
+  'sparc' : ['sparc','3'],
+  'sparc64' : ['sparc64','2'],
+  'sparc64v' : ['sparc64v','2'],
+  'sparcv8' : ['sparcv8','3'],
+  'sparcv9' : ['sparcv9','3'],
+  'sparcv9v' : ['sparcv9v','3'],
+  'sun4' : ['sparc','3'],
+  'sun4c' : ['sparc','3'],
+  'sun4d' : ['sparc','3'],
+  'sun4m' : ['sparc','3'],
+  'sun4u' : ['sparc64','2'],
+  'x86_64' : ['x86_64','1'],
+  'xtensa' : ['xtensa','18'],
+}
+
+# End of rpmrc dictionaries (Marker, don't change or remove!)
+
+def defaultMachine(use_rpm_default=True):
+    """ Return the canonicalized machine name. """
+
+    if use_rpm_default:
+        try:
+            # This should be the most reliable way to get the default arch
+            rmachine = subprocess.check_output(['rpm', '--eval=%_target_cpu'], shell=False).rstrip()
+        except Exception as e:
+            # Something went wrong, try again by looking up platform.machine()
+            return defaultMachine(False)
+    else:
+        rmachine = platform.machine()
+
+        # Try to lookup the string in the canon table
+        if rmachine in arch_canon:
+            rmachine = arch_canon[rmachine][0]
+
+    return rmachine
+
+def defaultSystem():
+    """ Return the canonicalized system name. """
+    rsystem = platform.system()
+
+    # Try to lookup the string in the canon tables
+    if rsystem in os_canon:
+        rsystem = os_canon[rsystem][0]
+
+    return rsystem
+
+def defaultNames():
+    """ Return the canonicalized machine and system name. """
+    return defaultMachine(), defaultSystem()
+
+def updateRpmDicts(rpmrc, pyfile):
+    """ Read the given rpmrc file with RPM definitions and update the
+        info dictionaries in the file pyfile with it.
+        The arguments will usually be 'rpmrc.in' from a recent RPM source
+        tree, and 'rpmutils.py' referring to this script itself.
+        See also usage() below.
+    """
+    try:
+        # Read old rpmutils.py file
+        oldpy = open(pyfile,"r").readlines()
+        # Read current rpmrc.in file
+        rpm = open(rpmrc,"r").readlines()
+        # Parse for data
+        data = {}
+        # Allowed section names that get parsed
+        sections = ['optflags',
+                    'arch_canon',
+                    'os_canon',
+                    'buildarchtranslate',
+                    'arch_compat',
+                    'os_compat',
+                    'buildarch_compat']
+        for l in rpm:
+            l = l.rstrip('\n').replace(':',' ')
+            # Skip comments
+            if l.lstrip().startswith('#'):
+                continue
+            tokens = l.strip().split()
+            if len(tokens):
+                key = tokens[0]
+                if key in sections:
+                    # Have we met this section before?
+                    if not data.has_key(tokens[0]):
+                        # No, so insert it
+                        data[key] = {}
+                    # Insert data
+                    data[key][tokens[1]] = tokens[2:]
+        # Write new rpmutils.py file
+        out = open(pyfile,"w")
+        pm = 0
+        for l in oldpy:
+            if pm:
+                if l.startswith('# End of rpmrc dictionaries'):
+                    pm = 0
+                    out.write(l)
+            else:
+                out.write(l)
+                if l.startswith('# Start of rpmrc dictionaries'):
+                    pm = 1
+                    # Write data sections to single dictionaries
+                    for key, entries in data.iteritems():
+                        out.write("%s = {\n" % key)
+                        for arch in sorted(entries.keys()):
+                            out.write("  '%s' : ['%s'],\n" % (arch, "','".join(entries[arch])))
+                        out.write("}\n\n")
+        out.close()
+    except:
+        pass
+
+def usage():
+    print "rpmutils.py rpmrc.in rpmutils.py"
+
+def main():
+    import sys
+
+    if len(sys.argv) < 3:
+        usage()
+        sys.exit(0)
+    updateRpmDicts(sys.argv[1], sys.argv[2])
+
+if __name__ == "__main__":
+    main()
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/sgiar.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/sgiar.py
similarity index 91%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/sgiar.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/sgiar.py
index 42d07a2ed636bc66c82324e76544b0df6f076d08..6be4c6509f1eaabfbef0a7efdd78288cd634e921 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/sgiar.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/sgiar.py
@@ -11,7 +11,7 @@ selection method.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -33,7 +33,7 @@ selection method.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/sgiar.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/sgiar.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import SCons.Defaults
 import SCons.Tool
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/sgic++.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/sgic++.py
similarity index 89%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/sgic++.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/sgic++.py
index 5358c4b6659e20e227037cfaa6e0c249dae5327e..8ae115a2a3aff17ff3cb737b64f153e6aefb8d38 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/sgic++.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/sgic++.py
@@ -9,7 +9,7 @@ selection method.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -31,7 +31,7 @@ selection method.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/sgic++.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/sgic++.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import SCons.Util
 
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/sgicc.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/sgicc.py
similarity index 88%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/sgicc.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/sgicc.py
index c69d4fc9ec2e50fa07a160b606b355cffa34ea8f..ec26bf11ff65a49dd55e109e9a40151e38bd4293 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/sgicc.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/sgicc.py
@@ -9,7 +9,7 @@ selection method.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -31,7 +31,7 @@ selection method.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/sgicc.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/sgicc.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import cc
 
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/sgilink.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/sgilink.py
similarity index 90%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/sgilink.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/sgilink.py
index f651446970af183d665b94a365b1dfd5adaec59e..828f6d0ee90d1792880df8efbd5e2250396f8e94 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/sgilink.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/sgilink.py
@@ -9,7 +9,7 @@ selection method.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -31,7 +31,7 @@ selection method.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/sgilink.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/sgilink.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import SCons.Util
 
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/sunar.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/sunar.py
similarity index 91%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/sunar.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/sunar.py
index 6e5f235f7026c2edcc00ccb8cd24cb26757eaa95..9c3e4810624ebeeea0715afc971bdaa71aec3f6c 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/sunar.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/sunar.py
@@ -10,7 +10,7 @@ selection method.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -32,7 +32,7 @@ selection method.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/sunar.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/sunar.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import SCons.Defaults
 import SCons.Tool
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/sunc++.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/sunc++.py
similarity index 95%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/sunc++.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/sunc++.py
index 6effe32f8e226c59f3c5346c5c22763dc76461d6..75fe4355c471f3ce5833217769f75adf4c1fccef 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/sunc++.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/sunc++.py
@@ -9,7 +9,7 @@ selection method.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -31,7 +31,7 @@ selection method.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/sunc++.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/sunc++.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import SCons
 
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/suncc.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/suncc.py
similarity index 89%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/suncc.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/suncc.py
index 6b1461f85b9dae190f78be4c2d64ced74b655026..b543b956da11a49cc0da300da4bd0ddc81b2fd52 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/suncc.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/suncc.py
@@ -8,7 +8,7 @@ selection method.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -30,7 +30,7 @@ selection method.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/suncc.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/suncc.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import SCons.Util
 
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/sunf77.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/sunf77.py
similarity index 90%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/sunf77.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/sunf77.py
index 1536c7126baa669d1b687b9bef301ae3373d08d1..bff5c1a5d009203292f46be78531c37e958cc230 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/sunf77.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/sunf77.py
@@ -9,7 +9,7 @@ selection method.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -31,7 +31,7 @@ selection method.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/sunf77.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/sunf77.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import SCons.Util
 
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/sunf90.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/sunf90.py
similarity index 90%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/sunf90.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/sunf90.py
index 65417f153af140e4edf4e59f1957b8357163142c..b0e31d1160445fbba704401433019466b45d9fbd 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/sunf90.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/sunf90.py
@@ -9,7 +9,7 @@ selection method.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -31,7 +31,7 @@ selection method.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/sunf90.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/sunf90.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import SCons.Util
 
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/sunf95.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/sunf95.py
similarity index 90%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/sunf95.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/sunf95.py
index c5300ad3b4a4cabc512687dab3fd2b02ff849196..5263f5ae7f615ed87a91a81d0468329f22f15afe 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/sunf95.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/sunf95.py
@@ -9,7 +9,7 @@ selection method.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -31,7 +31,7 @@ selection method.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/sunf95.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/sunf95.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import SCons.Util
 
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/sunlink.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/sunlink.py
similarity index 91%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/sunlink.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/sunlink.py
index b747c8f2e32415197a66a82f6bf71dcb9ab9da1a..d8a941f10806ebe0d3923be83efd00403e968a74 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/sunlink.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/sunlink.py
@@ -8,7 +8,7 @@ selection method.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -30,7 +30,7 @@ selection method.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/sunlink.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/sunlink.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import os
 import os.path
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/swig.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/swig.py
similarity index 93%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/swig.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/swig.py
index 9f2a3800d5029b4b6e7e96b5e785bbe0f86d66bc..83cd315930f398610c5261650e426c3f6743c58e 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/swig.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/swig.py
@@ -9,7 +9,7 @@ selection method.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -31,7 +31,7 @@ selection method.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/swig.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/swig.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import os.path
 import re
@@ -42,6 +42,7 @@ import SCons.Defaults
 import SCons.Scanner
 import SCons.Tool
 import SCons.Util
+import SCons.Node
 
 SwigAction = SCons.Action.Action('$SWIGCOM', '$SWIGCOMSTR')
 
@@ -117,9 +118,13 @@ def _swigEmitter(target, source, env):
             if outdir:
                  java_files = [os.path.join(outdir, j) for j in java_files]
             java_files = list(map(env.fs.File, java_files))
+            def t_from_s(t, p, s, x):
+                return t.dir
+            tsm = SCons.Node._target_from_source_map
+            tkey = len(tsm)
+            tsm[tkey] = t_from_s
             for jf in java_files:
-                t_from_s = lambda t, p, s, x: t.dir
-                SCons.Util.AddMethod(jf, t_from_s, 'target_from_source')
+                jf._func_target_from_source = tkey
             target.extend(java_files)
     return (target, source)
 
@@ -174,7 +179,8 @@ def generate(env):
     env.Append(SCANNERS = scanner)
 
 def exists(env):
-    return env.Detect(['swig'])
+    swig = env.get('SWIG') or env.Detect(['swig'])
+    return swig
 
 # Local Variables:
 # tab-width:4
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/tar.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/tar.py
similarity index 91%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/tar.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/tar.py
index 7cb9836b48bae1bdaf01a390402200ecc753da59..50afeae94289d6fa3793ad32e192bbcc691723dd 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/tar.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/tar.py
@@ -9,7 +9,7 @@ selection method.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -31,7 +31,7 @@ selection method.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/tar.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/tar.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import SCons.Action
 import SCons.Builder
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/tex.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/tex.py
similarity index 90%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/tex.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/tex.py
index ce394e4f5769511f30ccc3feec0f754eacaa6a62..9dd462eceb54f63800ca68e487d89f1dc6f2d3ac 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/tex.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/tex.py
@@ -10,7 +10,7 @@ selection method.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -32,7 +32,7 @@ selection method.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/tex.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/tex.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import os.path
 import re
@@ -100,6 +100,11 @@ makeglossary_re = re.compile(r"^[^%\n]*\\makeglossary", re.MULTILINE)
 makeglossaries_re = re.compile(r"^[^%\n]*\\makeglossaries", re.MULTILINE)
 makeacronyms_re = re.compile(r"^[^%\n]*\\makeglossaries", re.MULTILINE)
 beamer_re = re.compile(r"^[^%\n]*\\documentclass\{beamer\}", re.MULTILINE)
+regex = r'^[^%\n]*\\newglossary\s*\[([^\]]+)\]?\s*\{([^}]*)\}\s*\{([^}]*)\}\s*\{([^}]*)\}\s*\{([^}]*)\}'
+newglossary_re = re.compile(regex, re.MULTILINE)
+biblatex_re = re.compile(r"^[^%\n]*\\usepackage.*\{biblatex\}", re.MULTILINE)
+
+newglossary_suffix = []
 
 # search to find all files included by Latex
 include_re = re.compile(r'^[^%\n]*\\(?:include|input){([^}]*)}', re.MULTILINE)
@@ -125,6 +130,9 @@ LaTeXAction = None
 # An action to run BibTeX on a file.
 BibTeXAction = None
 
+# An action to run Biber on a file.
+BiberAction = None
+
 # An action to run MakeIndex on a file.
 MakeIndexAction = None
 
@@ -137,6 +145,9 @@ MakeGlossaryAction = None
 # An action to run MakeIndex (for acronyms) on a file.
 MakeAcronymsAction = None
 
+# An action to run MakeIndex (for newglossary commands) on a file.
+MakeNewGlossaryAction = None
+
 # Used as a return value of modify_env_var if the variable is not set.
 _null = SCons.Scanner.LaTeX._null
 
@@ -232,7 +243,8 @@ def InternalLaTeXAuxAction(XXXLaTeXAction, target = None, source= None, env=None
     saved_hashes = {}
     suffix_nodes = {}
 
-    for suffix in all_suffixes:
+
+    for suffix in all_suffixes+sum(newglossary_suffix, []):
         theNode = env.fs.File(targetbase + suffix)
         suffix_nodes[suffix] = theNode
         saved_hashes[suffix] = theNode.get_csig()
@@ -336,7 +348,9 @@ def InternalLaTeXAuxAction(XXXLaTeXAction, target = None, source= None, env=None
                         must_rerun_latex = True
 
         # Now decide if biber will need to be run.
-        # The information that bibtex reads from the .bcf file is
+        # When the backend for biblatex is biber (by choice or default) the
+        # citation information is put in the .bcf file.
+        # The information that biber reads from the .bcf file is
         # pass-independent. If we find (below) that the .bbl file is unchanged,
         # then the last latex saw a correct bibliography.
         # Therefore only do this once
@@ -349,11 +363,11 @@ def InternalLaTeXAuxAction(XXXLaTeXAction, target = None, source= None, env=None
                     content = open(target_bcf, "rb").read()
                     if content.find("bibdata") != -1:
                         if Verbose:
-                            print "Need to run bibtex on ",bcffilename
+                            print "Need to run biber on ",bcffilename
                         bibfile = env.fs.File(SCons.Util.splitext(target_bcf)[0])
-                        result = BibTeXAction(bibfile, bibfile, env)
+                        result = BiberAction(bibfile, bibfile, env)
                         if result != 0:
-                            check_file_error_message(env['BIBTEX'], 'blg')
+                            check_file_error_message(env['BIBER'], 'blg')
                         must_rerun_latex = True
 
         # Now decide if latex will need to be run again due to index.
@@ -410,6 +424,21 @@ def InternalLaTeXAuxAction(XXXLaTeXAction, target = None, source= None, env=None
                                          'alg')
                 return result
 
+        # Now decide if latex will need to be run again due to newglossary command.
+        for ig in range(len(newglossary_suffix)):
+            if check_MD5(suffix_nodes[newglossary_suffix[ig][2]],newglossary_suffix[ig][2]) or (count == 1):
+                # We must run makeindex
+                if Verbose:
+                    print "Need to run makeindex for newglossary"
+                newglfile = suffix_nodes[newglossary_suffix[ig][2]]
+                MakeNewGlossaryAction = SCons.Action.Action("$MAKENEWGLOSSARYCOM ${SOURCE.filebase}%s -s ${SOURCE.filebase}.ist -t ${SOURCE.filebase}%s -o ${SOURCE.filebase}%s" % (newglossary_suffix[ig][2],newglossary_suffix[ig][0],newglossary_suffix[ig][1]), "$MAKENEWGLOSSARYCOMSTR")
+
+                result = MakeNewGlossaryAction(newglfile, newglfile, env)
+                if result != 0:
+                    check_file_error_message('%s (newglossary)' % env['MAKENEWGLOSSARY'],
+                                             newglossary_suffix[ig][0])
+                    return result
+
         # Now decide if latex needs to be run yet again to resolve warnings.
         if warning_rerun_re.search(logContent):
             must_rerun_latex = True
@@ -595,9 +624,23 @@ def ScanFiles(theFile, target, paths, file_tests, file_tests_search, env, graphi
 
     for i in range(len(file_tests_search)):
         if file_tests[i][0] is None:
+            if Verbose:
+                print "scan i ",i," files_tests[i] ",file_tests[i], file_tests[i][1]
             file_tests[i][0] = file_tests_search[i].search(content)
             if Verbose and file_tests[i][0]:
-                print "   found match for ",file_tests[i][-1][-1]
+                print "   found match for ",file_tests[i][1][-1]
+            # for newglossary insert the suffixes in file_tests[i]
+            if file_tests[i][0] and file_tests[i][1][-1] == 'newglossary':
+                findresult = file_tests_search[i].findall(content)
+                for l in range(len(findresult)) :
+                    (file_tests[i][1]).insert(0,'.'+findresult[l][3])
+                    (file_tests[i][1]).insert(0,'.'+findresult[l][2])
+                    (file_tests[i][1]).insert(0,'.'+findresult[l][0])
+                    suffix_list = ['.'+findresult[l][0],'.'+findresult[l][2],'.'+findresult[l][3] ]
+                    newglossary_suffix.append(suffix_list)
+                if Verbose:
+                    print " new suffixes for newglossary ",newglossary_suffix
+                
 
     incResult = includeOnly_re.search(content)
     if incResult:
@@ -642,15 +685,18 @@ def tex_emitter_core(target, source, env, graphics_extensions):
     auxfilename = targetbase + '.aux'
     logfilename = targetbase + '.log'
     flsfilename = targetbase + '.fls'
+    syncfilename = targetbase + '.synctex.gz'
 
     env.SideEffect(auxfilename,target[0])
     env.SideEffect(logfilename,target[0])
     env.SideEffect(flsfilename,target[0])
+    env.SideEffect(syncfilename,target[0])
     if Verbose:
-        print "side effect :",auxfilename,logfilename,flsfilename
+        print "side effect :",auxfilename,logfilename,flsfilename,syncfilename
     env.Clean(target[0],auxfilename)
     env.Clean(target[0],logfilename)
     env.Clean(target[0],flsfilename)
+    env.Clean(target[0],syncfilename)
 
     content = source[0].get_text_contents()
 
@@ -676,7 +722,9 @@ def tex_emitter_core(target, source, env, graphics_extensions):
                          makeglossary_re,
                          makeglossaries_re,
                          makeacronyms_re,
-                         beamer_re ]
+                         beamer_re,
+                         newglossary_re,
+                         biblatex_re ]
     # set up list with the file suffixes that need emitting
     # when a feature is found
     file_tests_suff = [['.aux','aux_file'],
@@ -693,7 +741,10 @@ def tex_emitter_core(target, source, env, graphics_extensions):
                   ['.glo', '.gls', '.glg','glossary'],
                   ['.glo', '.gls', '.glg','glossaries'],
                   ['.acn', '.acr', '.alg','acronyms'],
-                  ['.nav', '.snm', '.out', '.toc','beamer'] ]
+                  ['.nav', '.snm', '.out', '.toc','beamer'],
+                  ['newglossary',],
+                  ['.bcf', '.blg','biblatex'] ]
+    # for newglossary the suffixes are added as we find the command
     # build the list of lists
     file_tests = []
     for i in range(len(file_tests_search)):
@@ -722,6 +773,7 @@ def tex_emitter_core(target, source, env, graphics_extensions):
     if Verbose:
         print "search path ",paths
 
+    # scan all sources for side effect files
     aux_files = []
     file_tests = ScanFiles(source[0], target, paths, file_tests, file_tests_search, env, graphics_extensions, targetdir, aux_files)
 
@@ -839,6 +891,11 @@ def generate_common(env):
     if BibTeXAction is None:
         BibTeXAction = SCons.Action.Action("$BIBTEXCOM", "$BIBTEXCOMSTR")
 
+    # Define an action to run Biber on a file.
+    global BiberAction
+    if BiberAction is None:
+        BiberAction = SCons.Action.Action("$BIBERCOM", "$BIBERCOMSTR")
+
     # Define an action to run MakeIndex on a file.
     global MakeIndexAction
     if MakeIndexAction is None:
@@ -898,6 +955,10 @@ def generate_common(env):
     env['BIBTEXFLAGS'] = SCons.Util.CLVar('')
     env['BIBTEXCOM']   = CDCOM + '${TARGET.dir} && $BIBTEX $BIBTEXFLAGS ${SOURCE.filebase}'
 
+    env['BIBER']      = 'biber'
+    env['BIBERFLAGS'] = SCons.Util.CLVar('')
+    env['BIBERCOM']   = CDCOM + '${TARGET.dir} && $BIBER $BIBERFLAGS ${SOURCE.filebase}'
+
     env['MAKEINDEX']      = 'makeindex'
     env['MAKEINDEXFLAGS'] = SCons.Util.CLVar('')
     env['MAKEINDEXCOM']   = CDCOM + '${TARGET.dir} && $MAKEINDEX $MAKEINDEXFLAGS ${SOURCE.file}'
@@ -917,6 +978,9 @@ def generate_common(env):
     env['MAKENCLFLAGS'] = '-s ${MAKENCLSTYLE} -t ${SOURCE.filebase}.nlg'
     env['MAKENCLCOM']   = CDCOM + '${TARGET.dir} && $MAKENCL ${SOURCE.filebase}.nlo $MAKENCLFLAGS -o ${SOURCE.filebase}.nls'
 
+    env['MAKENEWGLOSSARY']      = 'makeindex'
+    env['MAKENEWGLOSSARYCOM']   = CDCOM + '${TARGET.dir} && $MAKENEWGLOSSARY '
+
 def exists(env):
     generate_darwin(env)
     return env.Detect('tex')
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/textfile.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/textfile.py
similarity index 96%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/textfile.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/textfile.py
index 44fd99941714b0d1af538bdf110541f41ab1550f..9c2b3a1f8325842eea3dbc7733c7b4c1969fe602 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/textfile.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/textfile.py
@@ -1,6 +1,6 @@
 # -*- python -*-
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -44,7 +44,7 @@ Textfile/Substfile builder for SCons.
     is unpredictible whether the expansion will occur.
 """
 
-__revision__ = "src/engine/SCons/Tool/textfile.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/textfile.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import SCons
 
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/tlib.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/tlib.py
similarity index 89%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/tlib.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/tlib.py
index 5a24a0cf2e4112ba12655ac6ab84a5d3ad07d35c..9040439070aaeb179e1181448bed6266f03a2053 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/tlib.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/tlib.py
@@ -5,7 +5,7 @@ XXX
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -27,7 +27,7 @@ XXX
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/tlib.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/tlib.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import SCons.Tool
 import SCons.Tool.bcc32
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/wix.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/wix.py
similarity index 75%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/wix.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/wix.py
index eb88ce383ae9633579a023c5dacc8dc785753e82..1291f184a8dbc2f633f209cc3b3a5c31c57bd07c 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/wix.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/wix.py
@@ -8,7 +8,7 @@ selection method.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -30,7 +30,7 @@ selection method.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/wix.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/wix.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import SCons.Builder
 import SCons.Action
@@ -47,15 +47,17 @@ def generate(env):
 
     env['WIXLIGHTFLAGS'].append( '-nologo' )
     env['WIXLIGHTCOM'] = "$WIXLIGHT $WIXLIGHTFLAGS -out ${TARGET} ${SOURCES}"
+    env['WIXSRCSUF'] = '.wxs'
+    env['WIXOBJSUF'] = '.wixobj'
 
     object_builder = SCons.Builder.Builder(
         action      = '$WIXCANDLECOM',
-        suffix      = '.wxiobj',
-        src_suffix  = '.wxs')
+        suffix      = '$WIXOBJSUF',
+        src_suffix  = '$WIXSRCSUF')
 
     linker_builder = SCons.Builder.Builder(
         action      = '$WIXLIGHTCOM',
-        src_suffix  = '.wxiobj',
+        src_suffix  = '$WIXOBJSUF',
         src_builder = object_builder)
 
     env['BUILDERS']['WiX'] = linker_builder
@@ -66,7 +68,6 @@ def exists(env):
 
     # try to find the candle.exe and light.exe tools and 
     # add the install directory to light libpath.
-    #for path in os.environ['PATH'].split(os.pathsep):
     for path in os.environ['PATH'].split(os.pathsep):
         if not path:
             continue
@@ -80,13 +81,17 @@ def exists(env):
 
         # search for the tools in the PATH environment variable
         try:
-            if env['WIXCANDLE'] in os.listdir(path) and\
-               env['WIXLIGHT']  in os.listdir(path):
-                   env.PrependENVPath('PATH', path)
-                   env['WIXLIGHTFLAGS'] = [ os.path.join( path, 'wixui.wixlib' ),
-                                            '-loc',
-                                            os.path.join( path, 'WixUI_en-us.wxl' ) ]
-                   return 1
+            files = os.listdir(path)
+            if env['WIXCANDLE'] in files and env['WIXLIGHT'] in files:
+                env.PrependENVPath('PATH', path)
+                # include appropriate flags if running WiX 2.0
+                if 'wixui.wixlib' in files and 'WixUI_en-us.wxl' in files:
+                    env['WIXLIGHTFLAGS'] = [ os.path.join( path, 'wixui.wixlib' ),
+                                             '-loc',
+                                             os.path.join( path, 'WixUI_en-us.wxl' ) ]
+                else:
+                    env['WIXLIGHTFLAGS'] = []
+                return 1
         except OSError:
             pass # ignore this, could be a stale PATH entry.
 
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/xgettext.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/xgettext.py
similarity index 97%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/xgettext.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/xgettext.py
index 9a5167c887f7027ff606b8cba7106293cfad9aef..ed6245d475d736be14826085148d90a6a2819c14 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/xgettext.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/xgettext.py
@@ -3,7 +3,7 @@
 Tool specific initialization of `xgettext` tool.
 """
 
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 # 
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -24,7 +24,7 @@ Tool specific initialization of `xgettext` tool.
 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
-__revision__ = "src/engine/SCons/Tool/xgettext.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/xgettext.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 #############################################################################
 class _CmdRunner(object):
@@ -271,7 +271,10 @@ def generate(env,**kw):
   import SCons.Util
   from SCons.Tool.GettextCommon import RPaths, _detect_xgettext
 
-  env['XGETTEXT'] = _detect_xgettext(env)
+  try:
+    env['XGETTEXT'] = _detect_xgettext(env)
+  except:
+    env['XGETTEXT'] = 'xgettext' 
   # NOTE: sources="$SOURCES" would work as well. However, we use following
   # construction to convert absolute paths provided by scons onto paths
   # relative to current working dir. Note, that scons expands $SOURCE(S) to
@@ -323,7 +326,10 @@ def generate(env,**kw):
 def exists(env):
   """ Check, whether the tool exists """
   from SCons.Tool.GettextCommon import _xgettext_exists
-  return _xgettext_exists(env)
+  try:
+    return _xgettext_exists(env)
+  except:
+    return False
 #############################################################################
 
 # Local Variables:
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/yacc.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/yacc.py
similarity index 95%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/yacc.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/yacc.py
index 580fe76ffb9236b576c38f1f331cda82a08375be..4b8d9380a330d3c8b4751463a4be320e60160b60 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/yacc.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/yacc.py
@@ -9,7 +9,7 @@ selection method.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -31,7 +31,7 @@ selection method.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/yacc.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/yacc.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import os.path
 
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/zip.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/zip.py
similarity index 88%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/zip.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/zip.py
index 77515ad35a15196c3d429251c0cd8de3be6e5fc7..750769a45317c2640c571e80f9bc392e1a29c08b 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Tool/zip.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Tool/zip.py
@@ -9,7 +9,7 @@ selection method.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -31,7 +31,7 @@ selection method.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Tool/zip.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Tool/zip.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import os.path
 
@@ -57,9 +57,9 @@ if internal_zip:
                     for fname in filenames:
                         path = os.path.join(dirpath, fname)
                         if os.path.isfile(path):
-                            zf.write(path)
+                            zf.write(path, os.path.relpath(path, str(env.get('ZIPROOT', ''))))
             else:
-                zf.write(str(s))
+                zf.write(str(s), os.path.relpath(str(s), str(env.get('ZIPROOT', ''))))
         zf.close()
 else:
     zipcompression = 0
@@ -88,6 +88,7 @@ def generate(env):
     env['ZIPCOM']     = zipAction
     env['ZIPCOMPRESSION'] =  zipcompression
     env['ZIPSUFFIX']  = '.zip'
+    env['ZIPROOT']    = SCons.Util.CLVar('')
 
 def exists(env):
     return internal_zip or env.Detect('zip')
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Util.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Util.py
similarity index 99%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Util.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Util.py
index c1f87a2e7868e59b31ea43f266a12560a359888d..343f0a795ce7090508a72ced023e9e7ec00905bc 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Util.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Util.py
@@ -3,7 +3,7 @@
 Various utility functions go here.
 """
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -24,7 +24,7 @@ Various utility functions go here.
 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
-__revision__ = "src/engine/SCons/Util.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Util.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import os
 import sys
@@ -992,7 +992,7 @@ class Selector(OrderedDict):
     def __call__(self, env, source, ext=None):
         if ext is None:
             try:
-                ext = source[0].suffix
+                ext = source[0].get_suffix()
             except IndexError:
                 ext = ""
         try:
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Variables/BoolVariable.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Variables/BoolVariable.py
similarity index 92%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Variables/BoolVariable.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Variables/BoolVariable.py
index 492f95e32804b119f6f801a53625bad9a07b5200..1594559e59016250595c3ee1c276a6e0ea21aaaa 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Variables/BoolVariable.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Variables/BoolVariable.py
@@ -12,7 +12,7 @@ Usage example:
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -34,7 +34,7 @@ Usage example:
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Variables/BoolVariable.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Variables/BoolVariable.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 __all__ = ['BoolVariable',]
 
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Variables/EnumVariable.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Variables/EnumVariable.py
similarity index 94%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Variables/EnumVariable.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Variables/EnumVariable.py
index e12c133ce38ca1d00beab1aad9bb2d56ef6fc3bc..bc95cf640e9bc3ee1b049cc101c4635b18edd968 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Variables/EnumVariable.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Variables/EnumVariable.py
@@ -15,7 +15,7 @@ Usage example:
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -37,7 +37,7 @@ Usage example:
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Variables/EnumVariable.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Variables/EnumVariable.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 __all__ = ['EnumVariable',]
 
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Variables/ListVariable.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Variables/ListVariable.py
similarity index 95%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Variables/ListVariable.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Variables/ListVariable.py
index 0763b29c465ccc570dbec74f3b462e5c5c553d00..1faee7296278d46e34063a463b7cab572c82232e 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Variables/ListVariable.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Variables/ListVariable.py
@@ -25,7 +25,7 @@ Usage example:
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -46,7 +46,7 @@ Usage example:
 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
-__revision__ = "src/engine/SCons/Variables/ListVariable.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Variables/ListVariable.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 # Know Bug: This should behave like a Set-Type, but does not really,
 # since elements can occur twice.
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Variables/PackageVariable.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Variables/PackageVariable.py
similarity index 93%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Variables/PackageVariable.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Variables/PackageVariable.py
index dfac082e45c09ef5baa63fe05936924a6ffb5061..b7a59fe0ef371a2e5fb9d0ea5fc51eba34cf28d1 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Variables/PackageVariable.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Variables/PackageVariable.py
@@ -28,7 +28,7 @@ Usage example:
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -50,7 +50,7 @@ Usage example:
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Variables/PackageVariable.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Variables/PackageVariable.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 __all__ = ['PackageVariable',]
 
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Variables/PathVariable.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Variables/PathVariable.py
similarity index 96%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Variables/PathVariable.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Variables/PathVariable.py
index 77ef83edae2278407ce878989c13da964caafcc6..b095cbc45616a89c1ad3f807562bddb19023f0e1 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Variables/PathVariable.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Variables/PathVariable.py
@@ -46,7 +46,7 @@ Usage example:
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -68,7 +68,7 @@ Usage example:
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/Variables/PathVariable.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Variables/PathVariable.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 __all__ = ['PathVariable',]
 
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Variables/__init__.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Variables/__init__.py
similarity index 98%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Variables/__init__.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Variables/__init__.py
index 88df0218bad74fd3faee85aa68b909b231ff2856..a00d4f8b8c0da5f002a3294ee7843e687ec63bd3 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Variables/__init__.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Variables/__init__.py
@@ -5,7 +5,7 @@ customizable variables to an SCons build.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -26,7 +26,7 @@ customizable variables to an SCons build.
 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
-__revision__ = "src/engine/SCons/Variables/__init__.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Variables/__init__.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import os.path
 import sys
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Warnings.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Warnings.py
similarity index 95%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Warnings.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Warnings.py
index 42e396f880430985ff1d7335b182107d9eab4f7a..615bc4550f281eaf006e77c7b4506e109f63902a 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/Warnings.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/Warnings.py
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -27,7 +27,7 @@ This file implements the warnings framework for SCons.
 
 """
 
-__revision__ = "src/engine/SCons/Warnings.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/Warnings.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import sys
 
@@ -42,6 +42,9 @@ class WarningOnByDefault(Warning):
 
 # NOTE:  If you add a new warning class, add it to the man page, too!
 
+class TargetNotBuiltWarning(Warning): # Should go to OnByDefault
+    pass
+
 class CacheWriteErrorWarning(Warning):
     pass
 
@@ -51,6 +54,9 @@ class CorruptSConsignWarning(WarningOnByDefault):
 class DependencyWarning(Warning):
     pass
 
+class DevelopmentVersionWarning(WarningOnByDefault):
+    pass
+
 class DuplicateEnvironmentWarning(WarningOnByDefault):
     pass
 
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/__init__.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/__init__.py
similarity index 77%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/__init__.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/__init__.py
index d4b619f718c5ae06a04f415a31640efb9f68ff05..019cbf92529e75e13de515f49276aba4e0c59758 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/__init__.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/__init__.py
@@ -5,7 +5,7 @@ The main package for the SCons software construction utility.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -27,17 +27,17 @@ The main package for the SCons software construction utility.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/__init__.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/__init__.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
-__version__ = "2.2.0"
+__version__ = "2.4.0"
 
-__build__ = "issue-2856:2676:d23b7a2f45e8[MODIFIED]"
+__build__ = "rel_2.4.0:3365:9259ea1c13d7"
 
-__buildsys__ = "oberbrunner-dev"
+__buildsys__ = "hpmicrodog"
 
-__date__ = "2012/08/05 15:38:28"
+__date__ = "2015/09/21 14:03:43"
 
-__developer__ = "garyo"
+__developer__ = "bdbaddog"
 
 # make sure compatibility is always in place
 import SCons.compat
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/compat/__init__.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/compat/__init__.py
similarity index 97%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/compat/__init__.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/compat/__init__.py
index 7dc6a68d591fe42be2cd7fa925c473c4a3b43a03..2352d4c5064d0b3b157113b85f105a6461a6f882 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/compat/__init__.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/compat/__init__.py
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -60,7 +60,7 @@ function defined below loads the module as the "real" name (without the
 rest of our code will find our pre-loaded compatibility module.
 """
 
-__revision__ = "src/engine/SCons/compat/__init__.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/compat/__init__.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import os
 import sys
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/compat/_scons_builtins.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/compat/_scons_builtins.py
similarity index 68%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/compat/_scons_builtins.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/compat/_scons_builtins.py
index 32f4e7536a4d3d64bcbbe01a4bd3173916b061e8..bf2005faf25a08a804956eb4dcb5ee34e9f05564 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/compat/_scons_builtins.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/compat/_scons_builtins.py
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -37,7 +37,6 @@ This module checks for the following builtins names:
 
         all()
         any()
-        sorted()
         memoryview()
 
 Implementations of functions are *NOT* guaranteed to be fully compliant
@@ -52,7 +51,7 @@ the FUNCTIONS or DATA output, that means those names are already built in
 to this version of Python and we don't need to add them from this module.
 """
 
-__revision__ = "src/engine/SCons/compat/_scons_builtins.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/compat/_scons_builtins.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import builtins
 
@@ -101,48 +100,6 @@ except NameError:
                 return self.obj[indx]
     builtins.memoryview = memoryview
 
-try:
-    sorted
-except NameError:
-    # Pre-2.4 Python has no sorted() function.
-    #
-    # The pre-2.4 Python list.sort() method does not support
-    # list.sort(key=) nor list.sort(reverse=) keyword arguments, so
-    # we must implement the functionality of those keyword arguments
-    # by hand instead of passing them to list.sort().
-    def sorted(iterable, cmp=None, key=None, reverse=False):
-        if key is not None:
-            result = [(key(x), x) for x in iterable]
-        else:
-            result = iterable[:]
-        if cmp is None:
-            # Pre-2.3 Python does not support list.sort(None).
-            result.sort()
-        else:
-            result.sort(cmp)
-        if key is not None:
-            result = [t1 for t0,t1 in result]
-        if reverse:
-            result.reverse()
-        return result
-    builtins.sorted = sorted
-
-#if sys.version_info[:3] in ((2, 2, 0), (2, 2, 1)):
-#    def lstrip(s, c=string.whitespace):
-#        while s and s[0] in c:
-#            s = s[1:]
-#        return s
-#    def rstrip(s, c=string.whitespace):
-#        while s and s[-1] in c:
-#            s = s[:-1]
-#        return s
-#    def strip(s, c=string.whitespace, l=lstrip, r=rstrip):
-#        return l(r(s, c), c)
-#
-#    object.__setattr__(str, 'lstrip', lstrip)
-#    object.__setattr__(str, 'rstrip', rstrip)
-#    object.__setattr__(str, 'strip', strip)
-
 # Local Variables:
 # tab-width:4
 # indent-tabs-mode:nil
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/compat/_scons_collections.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/compat/_scons_collections.py
similarity index 88%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/compat/_scons_collections.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/compat/_scons_collections.py
index 4687642ddf794a18ed445737e580a57ac1647919..1f13065000c5c7f0661800a83ccef0eddd9cda93 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/compat/_scons_collections.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/compat/_scons_collections.py
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -30,7 +30,7 @@ used by SCons, in an interface that looks enough like collections for
 our purposes.
 """
 
-__revision__ = "src/engine/SCons/compat/_scons_collections.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/compat/_scons_collections.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 # Use exec to hide old names from fixers.
 exec("""if True:
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/compat/_scons_dbm.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/compat/_scons_dbm.py
similarity index 88%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/compat/_scons_dbm.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/compat/_scons_dbm.py
index 0506ac804110aa176b27021a847ea9df02d1d9c5..3bc0768f017d263289e5c1b62d9ac7911cf4f1c3 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/compat/_scons_dbm.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/compat/_scons_dbm.py
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -30,7 +30,7 @@ that the whichdb.whichdb() implementstation in the various 2.X versions of
 Python won't blow up even if dbm wasn't compiled in.
 """
 
-__revision__ = "src/engine/SCons/compat/_scons_dbm.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/compat/_scons_dbm.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 class error(Exception):
     pass
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/compat/_scons_hashlib.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/compat/_scons_hashlib.py
similarity index 91%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/compat/_scons_hashlib.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/compat/_scons_hashlib.py
index 52cf3ba605702ea288b86a40d1d1ae880c27af25..de93e4bac8007e94766096e439c0f5413366b1e6 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/compat/_scons_hashlib.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/compat/_scons_hashlib.py
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -31,7 +31,7 @@ purposes, anyway).  In fact, this module will raise an ImportError if
 the underlying md5 module isn't available.
 """
 
-__revision__ = "src/engine/SCons/compat/_scons_hashlib.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/compat/_scons_hashlib.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import md5
 from string import hexdigits
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/compat/_scons_io.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/compat/_scons_io.py
similarity index 88%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/compat/_scons_io.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/compat/_scons_io.py
index df4d444977f1bed151fa0a7853c7cf873fbf493f..72cd3b6d3cbf7e8b7c7592a1ea1d5bcf57e0e3c9 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/compat/_scons_io.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/compat/_scons_io.py
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -29,7 +29,7 @@ functionality.  It only wraps the portions of io functionality used
 by SCons, in an interface that looks enough like io for our purposes.
 """
 
-__revision__ = "src/engine/SCons/compat/_scons_io.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/compat/_scons_io.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 # Use the "imp" module to protect the imports below from fixers.
 import imp
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/compat/_scons_sets.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/compat/_scons_sets.py
similarity index 100%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/compat/_scons_sets.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/compat/_scons_sets.py
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/compat/_scons_subprocess.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/compat/_scons_subprocess.py
similarity index 100%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/compat/_scons_subprocess.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/compat/_scons_subprocess.py
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/cpp.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/cpp.py
similarity index 98%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/cpp.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/cpp.py
index 74fff7c708714b1f6117700337889545687e5e67..cf80a4b7c1da57815de3fabccef44b1b78f3f711 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/cpp.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/cpp.py
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -21,7 +21,7 @@
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/cpp.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/cpp.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 __doc__ = """
 SCons C Pre-Processor module
@@ -395,9 +395,10 @@ class PreProcessor(object):
 
         """
         d = self.dispatch_table
-        d['import'] = self.do_import
-        d['include'] =  self.do_include
-        d['include_next'] =  self.do_include
+        p = self.stack[-1] if self.stack else self.default_table
+
+        for k in ('import', 'include', 'include_next'):
+            d[k] = p[k]
 
     def stop_handling_includes(self, t=None):
         """
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/dblite.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/dblite.py
similarity index 100%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/dblite.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/dblite.py
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/exitfuncs.py b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/exitfuncs.py
similarity index 77%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/exitfuncs.py
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/exitfuncs.py
index 4e604e193254288996c361431f3352a8ea22793f..19c8e8e06e44c6ffa4d9f8d4bc0b3eda0654b353 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/SCons/exitfuncs.py
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/SCons/exitfuncs.py
@@ -5,7 +5,7 @@ Register functions which are executed when SCons exits for any reason.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -27,9 +27,10 @@ Register functions which are executed when SCons exits for any reason.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "src/engine/SCons/exitfuncs.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/engine/SCons/exitfuncs.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 
+import atexit
 
 _exithandlers = []
 def _run_exitfuncs():
@@ -52,23 +53,9 @@ def register(func, *targs, **kargs):
     """
     _exithandlers.append((func, targs, kargs))
 
-import sys
 
-try:
-    x = sys.exitfunc
-
-    # if x isn't our own exit func executive, assume it's another
-    # registered exit function - append it to our list...
-    if x != _run_exitfuncs:
-        register(x)
-
-except AttributeError:
-    pass
-
-# make our exit function get run by python when it exits:    
-sys.exitfunc = _run_exitfuncs
-
-del sys
+# make our exit function get run by python when it exits
+atexit.register(_run_exitfuncs)
 
 # Local Variables:
 # tab-width:4
diff --git a/installers/WinInstaller/scons-local/scons-local-2.2.0/scons-2.2.0.egg-info b/installers/WinInstaller/scons-local/scons-local-2.4.0/scons-2.4.0-py2.7.egg-info
similarity index 96%
rename from installers/WinInstaller/scons-local/scons-local-2.2.0/scons-2.2.0.egg-info
rename to installers/WinInstaller/scons-local/scons-local-2.4.0/scons-2.4.0-py2.7.egg-info
index b8f8d5e88b34a18e0a5d0beb44df42b46844b793..7a848af0f5d42b92d8ae51c33c6327c1b76dbbe9 100644
--- a/installers/WinInstaller/scons-local/scons-local-2.2.0/scons-2.2.0.egg-info
+++ b/installers/WinInstaller/scons-local/scons-local-2.4.0/scons-2.4.0-py2.7.egg-info
@@ -1,6 +1,6 @@
 Metadata-Version: 1.0
 Name: scons
-Version: 2.2.0
+Version: 2.4.0
 Summary: Open Source next-generation build tool.
 Home-page: http://www.scons.org/
 Author: Steven Knight
diff --git a/installers/WinInstaller/scons-local/scons-time.py b/installers/WinInstaller/scons-local/scons-time.py
old mode 100644
new mode 100755
index 1d774cb22996ca8d82e4815543086d12016881f9..f37d90694837f00a3c075d878d3c2ac2f262404c
--- a/installers/WinInstaller/scons-local/scons-time.py
+++ b/installers/WinInstaller/scons-local/scons-time.py
@@ -9,7 +9,7 @@
 #
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -32,7 +32,7 @@
 from __future__ import division
 from __future__ import nested_scopes
 
-__revision__ = "src/script/scons-time.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/script/scons-time.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
 import getopt
 import glob
diff --git a/installers/WinInstaller/scons-local/scons.py b/installers/WinInstaller/scons-local/scons.py
index 24686385c8e54ab944904d4f24c4ae98b4e3b209..0e59647dc50db65d237ab12bcde99af3963227cf 100644
--- a/installers/WinInstaller/scons-local/scons.py
+++ b/installers/WinInstaller/scons-local/scons.py
@@ -2,7 +2,7 @@
 #
 # SCons - a Software Constructor
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -23,21 +23,22 @@
 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
-__revision__ = "src/script/scons.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/script/scons.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
-__version__ = "2.2.0"
+__version__ = "2.4.0"
 
-__build__ = "issue-2856:2676:d23b7a2f45e8[MODIFIED]"
+__build__ = "rel_2.4.0:3365:9259ea1c13d7"
 
-__buildsys__ = "oberbrunner-dev"
+__buildsys__ = "hpmicrodog"
 
-__date__ = "2012/08/05 15:38:28"
+__date__ = "2015/09/21 14:03:43"
 
-__developer__ = "garyo"
+__developer__ = "bdbaddog"
 
 import os
 import sys
 
+
 ##############################################################################
 # BEGIN STANDARD SCons SCRIPT HEADER
 #
@@ -55,18 +56,12 @@ import sys
 # engine modules if they're in either directory.
 
 
-# Check to see if the python version is > 3.0 which is currently unsupported
-# If so exit with error message
-try:
-    if  sys.version_info >= (3,0,0):
-        msg = "scons: *** SCons version %s does not run under Python version %s.\n\
-Python 3.0 and later are not yet supported.\n"
-        sys.stderr.write(msg % (__version__, sys.version.split()[0]))
-        sys.exit(1)
-except AttributeError:
-    # Pre-1.6 Python has no sys.version_info
-    # No need to check version as we then know the version is < 3.0.0 and supported
-    pass
+if sys.version_info >= (3,0,0):
+    msg = "scons: *** SCons version %s does not run under Python version %s.\n\
+Python 3 is not yet supported.\n"
+    sys.stderr.write(msg % (__version__, sys.version.split()[0]))
+    sys.exit(1)
+
 
 script_dir = sys.path[0]
 
@@ -78,6 +73,11 @@ libs = []
 if "SCONS_LIB_DIR" in os.environ:
     libs.append(os.environ["SCONS_LIB_DIR"])
 
+# - running from source takes priority (since 2.3.2), excluding SCONS_LIB_DIR settings
+script_path = os.path.abspath(os.path.dirname(__file__))
+source_path = os.path.join(script_path, '..', 'engine')
+libs.append(source_path)
+
 local_version = 'scons-local-' + __version__
 local = 'scons-local'
 if script_dir:
@@ -91,6 +91,8 @@ scons_version = 'scons-%s' % __version__
 # preferred order of scons lookup paths
 prefs = []
 
+
+# - running from egg check
 try:
     import pkg_resources
 except ImportError:
@@ -184,7 +186,14 @@ sys.path = libs + sys.path
 ##############################################################################
 
 if __name__ == "__main__":
-    import SCons.Script
+    try:
+        import SCons.Script
+    except:
+        print("Import failed. Unable to find SCons files in:")
+        for path in libs:
+            print("  %s" % path)
+        raise
+
     # this does all the work, and calls sys.exit
     # with the proper exit status when done.
     SCons.Script.main()
diff --git a/installers/WinInstaller/scons-local/sconsign.py b/installers/WinInstaller/scons-local/sconsign.py
index 6e8df4e944bb39bdd2173b253ede3df1bc8b6a20..35dad8a00a6b0c72782aecc41d675622ddbdea44 100644
--- a/installers/WinInstaller/scons-local/sconsign.py
+++ b/installers/WinInstaller/scons-local/sconsign.py
@@ -2,7 +2,7 @@
 #
 # SCons - a Software Constructor
 #
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
+# Copyright (c) 2001 - 2015 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -23,17 +23,17 @@
 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
-__revision__ = "src/script/sconsign.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
+__revision__ = "src/script/sconsign.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
 
-__version__ = "2.2.0"
+__version__ = "2.4.0"
 
-__build__ = "issue-2856:2676:d23b7a2f45e8[MODIFIED]"
+__build__ = "rel_2.4.0:3365:9259ea1c13d7"
 
-__buildsys__ = "oberbrunner-dev"
+__buildsys__ = "hpmicrodog"
 
-__date__ = "2012/08/05 15:38:28"
+__date__ = "2015/09/21 14:03:43"
 
-__developer__ = "garyo"
+__developer__ = "bdbaddog"
 
 import os
 import sys
@@ -278,7 +278,7 @@ def field(name, entry, verbose=Verbose):
 def nodeinfo_raw(name, ninfo, prefix=""):
     # This just formats the dictionary, which we would normally use str()
     # to do, except that we want the keys sorted for deterministic output.
-    d = ninfo.__dict__
+    d = ninfo.__getstate__()
     try:
         keys = ninfo.field_list + ['_version_id']
     except AttributeError:
diff --git a/scripts/Inelastic/Direct/DirectEnergyConversion.py b/scripts/Inelastic/Direct/DirectEnergyConversion.py
index 74394d53c59d56718d782f4b99e3b56634f1a1f9..5e55de2c83af1c3029a0e6a2b895f9d0243bb55b 100644
--- a/scripts/Inelastic/Direct/DirectEnergyConversion.py
+++ b/scripts/Inelastic/Direct/DirectEnergyConversion.py
@@ -1,4 +1,4 @@
-#pylint: disable=too-many-lines
+#pylint: disable=too-many-lines
 #pylint: disable=invalid-name
 from mantid.simpleapi import *
 from mantid.kernel import funcreturns
@@ -29,7 +29,9 @@ def setup_reducer(inst_name,reload_instrument=False):
     except RuntimeError:
         raise RuntimeError('Unknown instrument "%s" or wrong IDF file for this instrument, cannot continue' % inst_name)
 
-
+#How could it be that abstract class is not referenced R0921? What it means?
+#pylint: disable=R0921
+#pylint: disable=too-many-instance-attributes
 class DirectEnergyConversion(object):
     """
     Performs a convert to energy assuming the provided instrument is
@@ -138,6 +140,8 @@ class DirectEnergyConversion(object):
    hardmaskOnly=Filename :load a hardmask and use as only mask
    """
 #-------------------------------------------------------------------------------
+#pylint: disable=too-many-branches
+#pylint: disable=too-many-locals
     def diagnose(self, white,diag_sample=None,**kwargs):
         """run diagnostics on the provided workspaces.
 
@@ -185,8 +189,10 @@ class DirectEnergyConversion(object):
         """
         # output workspace name.
         try:
+#pylint: disable=unused-variable
             n,r = funcreturns.lhs_info('both')
             out_ws_name = r[0]
+#pylint: disable=bare-except
         except:
             out_ws_name = None
         # modify properties using input arguments
@@ -223,10 +229,13 @@ class DirectEnergyConversion(object):
 
         # Get the white beam vanadium integrals
         whiteintegrals = self.do_white(white, None, None) # No grouping yet
+#pylint: disable=access-member-before-definition
         if self.second_white:
             #TODO: fix THIS DOES NOT WORK!
+#pylint: disable=unused-variable
             second_white = self.second_white
             other_whiteintegrals = self.do_white(PropertyManager.second_white, None, None) # No grouping yet
+#pylint: disable=attribute-defined-outside-init
             self.second_white = other_whiteintegrals
 
         # Get the background/total counts from the sample run if present
@@ -300,7 +309,7 @@ class DirectEnergyConversion(object):
                 white.add_masked_ws(white_masked_ws)
                 DeleteWorkspace(white_masked_ws)
         else:
-            for index, bank in enumerate(diag_spectra_blocks):
+            for bank in diag_spectra_blocks:
                 diag_params['start_index'] = bank[0] - 1
                 diag_params['end_index'] = bank[1] - 1
                 white_masked_ws = diagnostics.diagnose(whiteintegrals, **diag_params)
@@ -314,7 +323,8 @@ class DirectEnergyConversion(object):
                 mask = diag_sample.get_masking(1)
                 diag_mask = CloneWorkspace(mask,OutputWorkspace=out_ws_name)
             else: # either WB was diagnosed or WB masks were applied to it
-                # Extract a mask workspace
+                # Extract the mask workspace
+#pylint: disable=unused-variable
                 diag_mask, det_ids = ExtractMask(InputWorkspace=whiteintegrals,OutputWorkspace=out_ws_name)
         else:
             diag_mask = None
@@ -332,6 +342,9 @@ class DirectEnergyConversion(object):
 
         return diag_mask
 #-------------------------------------------------------------------------------
+#pylint: disable=too-many-arguments
+#pylint: disable=too-many-branches
+#pylint: disable=too-many-locals
     def convert_to_energy(self,wb_run=None,sample_run=None,ei_guess=None,rebin=None,map_file=None,
                           monovan_run=None,wb_for_monovan_run=None,**kwargs):
         """ One step conversion of run into workspace containing information about energy transfer
@@ -345,8 +358,10 @@ class DirectEnergyConversion(object):
 
         # output workspace name.
         try:
+#pylint: disable=unused-variable
             n,r = funcreturns.lhs_info('both')
             out_ws_name = r[0]
+#pylint: disable=bare-except
         except:
             out_ws_name = None
         prop_man = self.prop_man
@@ -451,6 +466,7 @@ class DirectEnergyConversion(object):
             # initialize list to store resulting workspaces to return
             result = []
         else:
+#pylint: disable=attribute-defined-outside-init
             self._multirep_mode = False
             num_ei_cuts = 0
 #------------------------------------------------------------------------------------------
@@ -541,7 +557,7 @@ class DirectEnergyConversion(object):
                     format(end_time - start_time),'notice')
         prop_man.log("****************************************************************")
         return result
-
+#pylint: disable=too-many-arguments
     def _do_abs_corrections(self,deltaE_ws_sample,cashed_mono_int,ei_guess,\
         mono_ws_base,tof_range, cut_ind,num_ei_cuts):
         """Do absolute corrections using various sources of such corrections
@@ -561,6 +577,7 @@ class DirectEnergyConversion(object):
             deltaE_ws_sample = self.apply_absolute_normalization(deltaE_ws_sample,PropertyManager.monovan_run,\
                                                             ei_guess,PropertyManager.wb_for_monovan_run,\
                                                              ' -cached- ')
+#pylint: disable=attribute-defined-outside-init
             self.mono_correction_factor = None
         else:   # Calculate corrections
             if self._multirep_mode:
@@ -576,7 +593,9 @@ class DirectEnergyConversion(object):
             # calculations and result placed in cash. Workspace unsuitable
             # for further calculations. Mark it cashed not to verify presence on consecutive runs
             # with the same monovan ws
+#pylint: disable=protected-access
             PropertyManager.monovan_run._in_cash = True
+#pylint: disable=attribute-defined-outside-init
         self.check_background = current_bkg_opt
         return deltaE_ws_sample,mono_ws_base
 
@@ -654,7 +673,7 @@ class DirectEnergyConversion(object):
         return bleed_mask
 
 
-
+#pylint: disable=too-many-arguments
     def mono_sample(self, mono_run, ei_guess, white_run=None, map_file=None,
                     spectra_masks=None, result_name=None, Tzero=None):
         """Convert a mono-chromatic sample run to DeltaE.
@@ -763,6 +782,7 @@ class DirectEnergyConversion(object):
 
 
         # Calculate the incident energy
+#pylint: disable=unused-variable
         ei,mon1_peak,mon1_index,tzero = \
             GetEi(InputWorkspace=monitor_ws, Monitor1Spec=ei_mon_spectra[0],
                   Monitor2Spec=ei_mon_spectra[1],
@@ -1031,6 +1051,9 @@ class DirectEnergyConversion(object):
         return (0.95*tof_min,t_step,1.05*tof_max)
         #return (tof_min,t_step,tof_max)
     #
+#pylint: disable=too-many-arguments
+#pylint: disable=too-many-branches
+#pylint: disable=too-many-locals
     def get_TOF_for_energies(self,workspace,energy_list,specID_list,ei=None,debug_mode=False):
         """ Method to find what TOF range corresponds to given energy range
            for given workspace and detectors.
@@ -1067,6 +1090,7 @@ class DirectEnergyConversion(object):
 
                 # Calculate the incident energy and TOF when the particles access Monitor1
                 try:
+#pylint: disable=unused-variable
                     ei,mon1_peak,mon1_index,tzero = \
                     GetEi(InputWorkspace=monitor_ws, Monitor1Spec=mon_1_spec_ID,
                         Monitor2Spec=mon_2_spec_ID,
@@ -1074,7 +1098,8 @@ class DirectEnergyConversion(object):
                     mon1_det = monitor_ws.getDetector(mon1_index)
                     mon1_pos = mon1_det.getPos()
                     src_name = monitor_ws.getInstrument().getSource().getName()
-                except :
+#pylint: disable=bare-except
+                except:
                     src_name = None
                     mon1_peak = 0
                     en_bin  = [energy_list[0],energy_list[1]-energy_list[0],energy_list[3]]
@@ -1119,6 +1144,7 @@ class DirectEnergyConversion(object):
 
         return TOF_range
     #
+#pylint: disable=too-many-branches
     def save_results(self, workspace, save_file=None, formats=None):
         """
         Save the result workspace to the specified filename using the list of formats specified in
@@ -1224,9 +1250,11 @@ class DirectEnergyConversion(object):
             else:
                 self._spectra_masks = None
         else:
+#pylint: disable=attribute-defined-outside-init
             self._spectra_masks = None
         return
 #-------------------------------------------------------------------------------
+#pylint: disable=too-many-arguments
     def apply_absolute_normalization(self,sample_ws,monovan_run=None,ei_guess=None,wb_mono=None,abs_norm_factor_is=None):
         """  Function applies absolute normalization factor to the target workspace
              and calculates this factor if necessary
@@ -1286,6 +1314,8 @@ class DirectEnergyConversion(object):
 
         return sample_ws
 #-------------------------------------------------------------------------------
+#pylint: disable=too-many-branches
+#pylint: disable=too-many-locals
     def get_abs_normalization_factor(self,monovan_run,ei_monovan):
         """get absolute normalization factor for monochromatic vanadium
 
@@ -1324,6 +1354,7 @@ class DirectEnergyConversion(object):
         for i in range(nhist):
             try:
                 det = data_ws.getDetector(i)
+#pylint: disable=broad-except
             except Exception:
                 continue
             if det.isMasked():
@@ -1390,8 +1421,8 @@ class DirectEnergyConversion(object):
 
         scale_factor = van_multiplier * sample_multiplier / xsection
 
-        for type,val in norm_factor.iteritems():
-            norm_factor[type] = val * scale_factor
+        for norm_type,val in norm_factor.iteritems():
+            norm_factor[norm_type] = val * scale_factor
 
         # check for NaN
         if (norm_factor['LibISIS'] != norm_factor['LibISIS']) | (izerc != 0):    # It is an error, print diagnostics:
@@ -1484,14 +1515,18 @@ class DirectEnergyConversion(object):
         to be always set-up from a calling script
         """
         # Internal properties and keys
+#pylint: disable=attribute-defined-outside-init
         self._keep_wb_workspace = True # for the time being.  May be auto-calculated later but should it?
+#pylint: disable=attribute-defined-outside-init
         self._do_ISIS_reduction = True
         # if normalized by monitor-2, range have to be established before
         # shifting the instrument
+#pylint: disable=attribute-defined-outside-init
         self._mon2_norm_time_range = None
         # WB may not have monitors. In this case the property have to be set to True
         # and WB normalization will not fail but will run normalize by current
         self.__in_white_normalization = False
+#pylint: disable=attribute-defined-outside-init
         self._debug_mode = False
         self.spectra_masks = None
 
@@ -1506,6 +1541,7 @@ class DirectEnergyConversion(object):
                 self._propMan = PropertyManager(instr)
         else:
             old_name = self._propMan.instrument.getName()
+#pylint: disable=protected-access
             if isinstance(instr,geometry._geometry.Instrument):
                 new_name = self._propMan.instrument.getName()
             elif isinstance(instr,PropertyManager):
@@ -1514,10 +1550,11 @@ class DirectEnergyConversion(object):
                 new_name = instr
             #end if
             if old_name != new_name or reload_instrument:
+#pylint: disable=attribute-defined-outside-init
                 self._propMan = PropertyManager(new_name)
             #end if
         #
-
+#pylint: disable=unused-argument
     def setup_instrument_properties(self, workspace=None,reload_instrument=False):
         if workspace != None:
             instrument = workspace.getInstrument()
@@ -1532,6 +1569,7 @@ class DirectEnergyConversion(object):
            if it is what provided.
        """
         if not isinstance(run,RunDescriptor):
+#pylint: disable=protected-access
             tRun = copy.copy(PropertyManager._tmp_run)
             tRun.__set__(None,run)
             return tRun
@@ -1542,6 +1580,7 @@ class DirectEnergyConversion(object):
 #         This actually does the conversion for the mono-sample and
 #         mono-vanadium runs
 # -------------------------------------------------------------------------------------------
+#pylint: disable=too-many-arguments
     def _do_mono_SNS(self, data_ws, result_name, ei_guess,\
                  white_run=None, map_file=None, spectra_masks=None, Tzero=None):
         # does not work -- retrieve from repo and fix if this functionality is needed.
@@ -1549,10 +1588,13 @@ class DirectEnergyConversion(object):
                                   " if necessary and fix")
         #return
 #-------------------------------------------------------------------------------
+#pylint: disable=too-many-arguments
+#pylint: disable=unused-argument
     def _do_mono_ISIS(self, data_run, ei_guess,\
                  white_run=None, map_file=None, spectra_masks=None, Tzero=None):
 
         # Do ISIS stuff for Ei
+#pylint: disable=unused-variable
         ei_value, mon1_peak = self.get_ei(data_run, ei_guess)
 
 
@@ -1651,6 +1693,7 @@ class DirectEnergyConversion(object):
 
         return bkgr_ws
 #-------------------------------------------------------------------------------
+#pylint disable=too-many-arguments
     def _do_mono(self, run,  ei_guess,
                  white_run=None, map_file=None, spectra_masks=None, Tzero=None):
         """
@@ -1734,6 +1777,7 @@ class DirectEnergyConversion(object):
         # Normalize
         self.__in_white_normalization = True
         white_ws = self.normalise(run, self.normalise_method,0.0)
+#pylint: disable=attribute-defined-outside-init
         self.__in_white_normalization = False
         new_ws_name = run.set_action_suffix('_norm_white')
         old_name = white_ws.name()
@@ -1785,7 +1829,8 @@ def get_failed_spectra_list_from_masks(masked_wksp,prop_man):
         return (failed_spectra,0)
     try:
         masked_wksp.name()
-    except Exeption as ex:
+#pylint: disable=broad-except
+    except Exeption:
         prop_man.log("***WARNING: cached mask workspace invalidated. Incorrect masking reported")
         return (failed_spectra,0)
 
diff --git a/scripts/Inelastic/Direct/NonIDF_Properties.py b/scripts/Inelastic/Direct/NonIDF_Properties.py
index 26830d3fa3128573afb037d8de374432fd54b430..c0f1d8dfbce6b0be01a3baf58bbfd4c817819bd6 100644
--- a/scripts/Inelastic/Direct/NonIDF_Properties.py
+++ b/scripts/Inelastic/Direct/NonIDF_Properties.py
@@ -14,6 +14,7 @@ class NonIDF_Properties(object):
     """
 
     # logging levels available for user
+#pylint: disable=unnecessary-lambda
     log_options = \
         { "error" :       (1,lambda (msg):   logger.error(msg)),
           "warning" :     (2,lambda (msg):   logger.warning(msg)),
@@ -40,7 +41,9 @@ class NonIDF_Properties(object):
         self._set_instrument_and_facility(Instrument,run_workspace)
 
         # set up descriptors holder class reference
+#pylint: disable=protected-access
         RunDescriptor._holder = self
+#pylint: disable=protected-access
         RunDescriptor._logger = self.log
         # Initiate class-level properties to defaults (Each constructor clears class-level properties?)
         super(NonIDF_Properties,self).__setattr__('sample_run',None)
@@ -132,6 +135,7 @@ class NonIDF_Properties(object):
         return self._cashe_sum_ws
     @cashe_sum_ws.setter
     def cashe_sum_ws(self,val):
+#pylint: disable=attribute-defined-outside-init
         self._cashe_sum_ws = bool(val)
     # -----------------------------------------------------------------------------
     @property
@@ -148,15 +152,14 @@ class NonIDF_Properties(object):
     #
 
     def _set_instrument_and_facility(self,Instrument,run_workspace=None):
-        """simple method used to obtain default instrument for testing """
-        # TODO: implement advanced instrument setter, used in DirectEnergy
-        # conversion
+        """Obtain default instrument and facility and store it in properties"""
 
         if run_workspace:
             instrument = run_workspace.getInstrument()
             instr_name = instrument.getFullName()
             new_name,full_name,facility_ = prop_helpers.check_instrument_name(None,instr_name)
         else:
+#pylint: disable=protected-access
             if isinstance(Instrument,geometry._geometry.Instrument):
                 instrument = Instrument
                 instr_name = instrument.getFullName()
diff --git a/scripts/Inelastic/Direct/PropertiesDescriptors.py b/scripts/Inelastic/Direct/PropertiesDescriptors.py
index b697419a5a848e5ae362acec35041ebfe4380d92..97c8dff136af54eee4769b56bad2b31ee07a052e 100644
--- a/scripts/Inelastic/Direct/PropertiesDescriptors.py
+++ b/scripts/Inelastic/Direct/PropertiesDescriptors.py
@@ -13,6 +13,7 @@ from mantid import api,geometry,config
 import numpy as np
 
 import Direct.ReductionHelpers as prop_helpers
+#pylint: disable=unused-import
 import Direct.CommonFunctions as common
 from collections import Iterable
 
@@ -25,6 +26,7 @@ class PropDescriptor(object):
     def dependencies(self):
         """Returns the list of other properties names, this property depends on"""
         return []
+#pylint: disable=unused-argument		
     def validate(self,instance, owner):
         """Interface to validate property descriptor,
            provided to check properties interaction before long run
@@ -89,7 +91,7 @@ class IncidentEnergy(PropDescriptor):
         if instance is None:
             return self
         return self._incident_energy
-
+#pylint: disable=too-many-branches
     def __set__(self,instance,value):
         """ Set up incident energy or range of energies in various formats """
         if value != None:
@@ -131,7 +133,7 @@ class IncidentEnergy(PropDescriptor):
         else:
             self._num_energies = 1
         self._cur_iter_en = 0
-
+#pylint: disable=unused-variable
         ok,sev,message = self.validate(instance)
         if not ok:
             raise KeyError(message)
@@ -344,6 +346,7 @@ class SaveFileName(PropDescriptor):
                 if owner.monovan_run.run_number():
                     name +='_Abs'
                 name = name.replace('.','d')
+#pylint: disable=bare-except
             except:
                 name = None
         return name
@@ -369,7 +372,7 @@ class InstrumentDependentProp(PropDescriptor):
 
         if instance is None:
             return self
-
+#pylint: disable=protected-access
         if instance._pInstrument is None:
             raise KeyError("Attempt to use uninitialized property manager")
         else:
@@ -497,6 +500,7 @@ class PropertyFromRange(PropDescriptor):
 
     def __set__(self,instance,val):
         if val in self._availible_values:
+#pylint: disable=attribute-defined-outside-init
             self._current_value = val
         else:
             raise KeyError(' Property can not have value {0}'.format(val))
@@ -522,7 +526,7 @@ class DetCalFile(PropDescriptor):
     def __set__(self,instance,val):
         """ set detector calibration file using various formats """
 
-        if val is None or isinstance(val,api.Workspace) or isinstance(val,str):
+        if val is None or isinstance(val,api.Workspace):
        # nothing provided or workspace provided or filename probably provided
             if str(val) in mtd:
              # workspace name provided
@@ -530,6 +534,20 @@ class DetCalFile(PropDescriptor):
             self._det_cal_file = val
             self._calibrated_by_run = False
             return
+        if isinstance(val,str):
+            if val in mtd:
+                val = mtd[val]
+                self._det_cal_file = val
+                self._calibrated_by_run = False
+                return
+            try:
+                intVal = int(val)
+            except ValueError:
+                self._det_cal_file = val
+                self._calibrated_by_run = False
+                return
+            val = intVal
+
 
 
         if isinstance(val,int):
@@ -554,7 +572,7 @@ class DetCalFile(PropDescriptor):
     def calibrated_by_run(self):
         """ reports if the detector calibration is in a run-file or separate file(workspace)"""
         return self._calibrated_by_run
-
+#pylint: disable=unused-argument
     def find_file(self,instance,**kwargs):
         """ Method to find file, correspondent to
             current _det_cal_file file hint
@@ -591,6 +609,7 @@ class DetCalFile(PropDescriptor):
         if len(file_name) == 0: # it still can be a run number as string
             try:
                 file_name = FileFinder.findRuns(self._det_cal_file)[0]
+#pylint: disable=bare-except
             except:
                 return (False,"Can not find file or run file corresponding to name : {0}".format(self._det_cal_file))
         else:
@@ -617,6 +636,7 @@ class MapMaskFile(PropDescriptor):
 
     def __set__(self,instance,value):
         if not value is None:
+#pylint: disable=unused-variable
             fileName, fileExtension = os.path.splitext(value)
             if not fileExtension:
                 value = value + self._file_ext
@@ -649,7 +669,7 @@ class HardMaskPlus(prop_helpers.ComplexProperty):
     """
     def __init__(self):
         prop_helpers.ComplexProperty.__init__(self,['use_hard_mask_only','run_diagnostics'])
-    def __get__(self,instance,type=None):
+    def __get__(self,instance,class_type=None):
         if instance is None:
             return self
 
@@ -657,6 +677,7 @@ class HardMaskPlus(prop_helpers.ComplexProperty):
 
     def __set__(self,instance,value):
         if value != None:
+#pylint: disable=unused-variable
             fileName, fileExtension = os.path.splitext(value)
             if not fileExtension:
                 value = value + '.msk'
@@ -665,7 +686,9 @@ class HardMaskPlus(prop_helpers.ComplexProperty):
         else:
             prop_helpers.ComplexProperty.__set__(self,instance.__dict__,[True,False])
         try:
+#pylint: disable=protected-access
             del instance.__changed_properties['hardmaskOnly']
+#pylint: disable=bare-except
         except:
             pass
 
@@ -712,7 +735,9 @@ class HardMaskOnly(prop_helpers.ComplexProperty):
             run_diagnostics = True
         prop_helpers.ComplexProperty.__set__(self,instance.__dict__,[use_hard_mask_only,run_diagnostics])
         try:
+#pylint: disable=protected-access
             del instance.__changed_properties['hardmaskPlus']
+#pylint: disable=bare-except
         except:
             pass
 #end HardMaskOnly
@@ -769,7 +794,7 @@ class MonovanIntegrationRange(prop_helpers.ComplexProperty):
 
     def __set__(self,instance,value):
         if isinstance(instance,dict):
-            dDict = instance
+            tDict = instance
         else:
             tDict = instance.__dict__
         if value is None:
@@ -842,7 +867,7 @@ class EiMonSpectra(prop_helpers.ComplexProperty):
             return
 
         if isinstance(instance,dict):
-            dDict = instance
+            tDict = instance
         else:
             tDict = instance.__dict__
 
@@ -1176,7 +1201,7 @@ class MonoCorrectionFactor(PropDescriptor):
         self._cor_factor = value
     #
         if value is None:
-#pylint: disable=W0212
+#pylint: disable=protected-access
             self._mono_run_prop._in_cash = False # enable monovan run validation if any
     #
     def set_val_to_cash(self,instance,value):
@@ -1330,12 +1355,13 @@ class RotationAngle(PropDescriptor):
                 working_ws = mtd[external_ws]
 
         value = None
-#pylint: disable=W0212
+#pylint: disable=protected-access
         log_names = self._motor_log._log_names
         for name in log_names:
             try:
                 value = working_ws.getRun().getLogData(name).timeAverageValue()
                 break
+#pylint: disable=bare-except
             except:
                 pass
         return value
@@ -1344,7 +1370,7 @@ class RotationAngle(PropDescriptor):
         """Independent method to read rotation angle from workspace and
          previously set log and offset parameters
         """
-#pylint: disable=W0212
+#pylint: disable=protected-access
         offset = self._mot_offset._offset
         if offset is None:
             return np.NaN
diff --git a/scripts/Inelastic/Direct/PropertyManager.py b/scripts/Inelastic/Direct/PropertyManager.py
index d5949862d8cd8c4ae0a14fe853ae82d3a2fbaaa9..30b74b6c4afd0919b49a862cd1026dff3be2c58d 100644
--- a/scripts/Inelastic/Direct/PropertyManager.py
+++ b/scripts/Inelastic/Direct/PropertyManager.py
@@ -345,6 +345,7 @@ class PropertyManager(NonIDF_Properties):
 
         return result
     #
+#pylint: disable=too-many-branches
     def update_defaults_from_instrument(self,pInstrument,ignore_changes=False):
         """ Method used to update default parameters from the same instrument (with different parameters).
 
@@ -379,6 +380,7 @@ class PropertyManager(NonIDF_Properties):
             if not prop_name in param_list:
                 try:
                     dependencies = getattr(PropertyManager,prop_name).dependencies()
+#pylint: disable=bare-except
                 except:
                     dependencies = []
                 modified = False
@@ -409,9 +411,11 @@ class PropertyManager(NonIDF_Properties):
                     cur_val = getattr(self,key)
                     setattr(self,key,val)
                     new_val = getattr(self,key)
+#pylint: disable=bare-except
                 except:
                     try:
                         cur_val = getattr(self,key)
+#pylint: disable=bare-except
                     except:
                         cur_val = "Undefined"
                     self.log("Retrieving or reapplying script property {0} failed. Property value remains: {1}"\
@@ -436,6 +440,7 @@ class PropertyManager(NonIDF_Properties):
                 # dependencies removed either properties are equal or not
                 try:
                     dependencies = getattr(PropertyManager,key).dependencies()
+#pylint: disable=bare-except
                 except:
                     dependencies = []
 
@@ -466,6 +471,7 @@ class PropertyManager(NonIDF_Properties):
                 try: # this is reliability check, and except ideally should never be hit. May occur if old IDF contains
                     # properties, not present in recent IDF.
                     cur_val = getattr(self,public_name)
+#pylint: disable=bare-except
                 except:
                     self.log("Can not retrieve property {0} value from existing reduction parameters. Ignoring this property"\
                         .format(public_name),'warning')
@@ -480,6 +486,7 @@ class PropertyManager(NonIDF_Properties):
             # too, as property has been set up as whole.
             try:
                 dependencies = val.dependencies()
+#pylint: disable=bare-except
             except:
                 dependencies =[]
             for dep_name in dependencies:
@@ -555,6 +562,7 @@ class PropertyManager(NonIDF_Properties):
             file list to sum
         """
         # this returns only runs, left to sum with current sample_run sum settings
+#pylint: disable=unused-variable
         runs,sum_ws,added      = PropertyManager.sample_run.get_runs_to_sum(None,num_files)
         if len(runs) == 0:
             return (True,[],[])
@@ -572,16 +580,16 @@ class PropertyManager(NonIDF_Properties):
         file_errors={}
         for prop_name in file_prop_names:
             theProp = getattr(PropertyManager,prop_name)
-            ok,file = theProp.find_file(self,be_quet=True)
+            ok,file_name = theProp.find_file(self,be_quet=True)
             if not ok:
-                file_errors[prop_name]=file
+                file_errors[prop_name]=file_name
 
         if self.sum_runs:
             missing=[]
-            found=[]
+#pylint: disable=unused-variable
             ok,missing,found=self.find_files_to_sum()
             #Presence of Cashe sum ws assumes that you sum files to workspace as they appear
-            # This mean, that we should not expect all files to be there at the begining
+            # This mean, that we should not expect all files to be there at the beginning
             if not ok and not self.cashe_sum_ws:
                 file_errors['missing_runs_toSum']=str(missing)
 
@@ -597,6 +605,7 @@ class PropertyManager(NonIDF_Properties):
             fp.close()
             os.remove(test_file)
             return (True,'')
+#pylint: disable=bare-except
         except:
             return (False,'Can not write to default save directory {0}.\n Reduction results can be lost'.format(targ_dir))
     #
@@ -607,6 +616,7 @@ class PropertyManager(NonIDF_Properties):
         """
 
         if self.mono_correction_factor: # disable check for monovan_run, as it is not used if mono_correction provided
+#pylint: disable=protected-access
             PropertyManager.monovan_run._in_cash = True  # as soon as monovan_run is set up (mono correction disabled)
         # this will be dropped
         error_list={}
@@ -637,7 +647,7 @@ class PropertyManager(NonIDF_Properties):
         for prop in changed_prop:
             try:
                 theProp =getattr(PropertyManager,prop)
-#pylint: disable=W0702
+#pylint: disable=bare-except
             except: # not all changed properties are property manager properties
                 continue # we are not validating them
             try:
@@ -653,7 +663,7 @@ class PropertyManager(NonIDF_Properties):
                         self.log(mess,'warning')
                     else:
                         error_list[prop]=mess
-#pylint: disable=W0702
+#pylint: disable=bare-except
             except: # its simple dictionary value, which do not have validator or
                 pass # other property without validator
         #end
diff --git a/scripts/Inelastic/Direct/ReductionWrapper.py b/scripts/Inelastic/Direct/ReductionWrapper.py
index b8b7855564ea987fcf63a671408de3a02faad654..28462b0cd6a8b58a579773c10fed58fb78316723 100644
--- a/scripts/Inelastic/Direct/ReductionWrapper.py
+++ b/scripts/Inelastic/Direct/ReductionWrapper.py
@@ -10,13 +10,15 @@ import os
 import re
 from abc import abstractmethod
 
-
+#pylint: disable=R0921
+#pylint: disable=too-many-instance-attributes
 class ReductionWrapper(object):
     """ Abstract class provides interface to direct inelastic reduction
         allowing it to be run  from Mantid, web services, or system tests
         using the same interface and the same run file placed in different
         locations.
     """
+#pylint: disable=too-few-public-methods
     class var_holder(object):
         """ A simple wrapper class to keep web variables"""
         def __init__(self,Web_vars=None):
@@ -135,6 +137,7 @@ class ReductionWrapper(object):
                     docstring = prop.__doc__
                     if not docstring:
                         continue
+#pylint: disable=bare-except
                 except:
                     continue
                 contents = self._do_format(docstring)
@@ -190,7 +193,9 @@ class ReductionWrapper(object):
             The method can be overloaded to return a workspace
             or workspace name to validate results against.
         """
+#pylint: disable=protected-access
         if not PropertyManager.save_file_name._file_name is None:
+#pylint: disable=protected-access
             file_name = PropertyManager.save_file_name._file_name
             if isinstance(file_name,api.Workspace):
                 return file_name
@@ -225,7 +230,7 @@ class ReductionWrapper(object):
           User expected to overload this method within class instantiation """
         return None
 
-
+#pylint: disable=too-many-branches
     def build_or_validate_result(self,Error=1.e-6,ToleranceRelErr=True):
         """ Method validates results of the reduction against reference file or workspace.
 
@@ -258,12 +263,14 @@ class ReductionWrapper(object):
                     config.appendDataSearchDir(path)
                 # it there bug in getFullPath? It returns the same string if given full path
                 # but file has not been found
+#pylint: disable=unused-variable
                 name,fext=os.path.splitext(name)
                 fileName = FileFinder.getFullPath(name+'.nxs')
                 if len(fileName)>0:
                     build_validation = False
                     try:
                         reference_ws = Load(fileName)
+#pylint: disable=bare-except
                     except:
                         build_validation = True
                 else:
@@ -325,6 +332,7 @@ class ReductionWrapper(object):
             return True,'Reference file and reduced workspace are equal with accuracy {0:<3.2f}'\
                         .format(TOLL)
         else:
+#pylint: disable=unused-variable
             fname,ext = os.path.splitext(fileName)
             filename = fname+'-mismatch.nxs'
             self.reducer.prop_man.log("***WARNING: can not get results matching the reference file.\n"\
@@ -374,6 +382,7 @@ class ReductionWrapper(object):
             reduction properties between script and web variables
         """
         if input_file:
+#pylint: disable=attribute-defined-outside-init
             self.reducer.sample_run = str(input_file)
         if output_directory:
             config['defaultsave.directory'] = str(output_directory)
@@ -390,7 +399,8 @@ class ReductionWrapper(object):
                 self._run_pause(timeToWait)
                 Found,input_file = PropertyManager.sample_run.find_file(self.reducer.prop_man,file_hint=file_hint,be_quet=True)
                 if Found:
-                    file,found_ext=os.path.splitext(input_file)
+#pylint: disable=unused-variable
+                    file_name,found_ext=os.path.splitext(input_file)
                     if found_ext != fext:
                         wait_counter+=1
                         if wait_counter<2:
@@ -415,6 +425,7 @@ class ReductionWrapper(object):
         """ procedure used to sum and reduce runs in case when not all files
            are available and user have to wait for these files to appear
        """
+#pylint: disable=protected-access
         if not PropertyManager.sample_run._run_list:
             raise RuntimeError("sum_and_reduce expects run file list to be defined")
 
@@ -506,14 +517,14 @@ class ReductionWrapper(object):
 # --------### reduce list of runs one by one ----------------------------###
             runfiles = PropertyManager.sample_run.get_run_file_list()
             if out_ws_name is None:
-                for file in runfiles:
-                    self.reduce(file)
+                for file_name in runfiles:
+                    self.reduce(file_name)
                 return None
             else:
                 results = []
                 nruns = len(runfiles)
-                for num,file in enumerate(runfiles):
-                    red_ws = self.reduce(file)
+                for num,file_name in enumerate(runfiles):
+                    red_ws = self.reduce(file_name)
                     if isinstance(red_ws,list):
                         for ws in red_ws:
                             results.append(ws)
@@ -544,9 +555,9 @@ def MainProperties(main_prop_definition):
         prop_dict = main_prop_definition(*args)
         #print "in decorator: ",properties
         host = args[0]
-#pylint: disable=access-to-protected-member
+#pylint: disable=protected-access
         if not host._run_from_web: # property run locally
-#pylint: disable=access-to-protected-member
+#pylint: disable=protected-access
             host._wvs.standard_vars = prop_dict
             host.reducer.prop_man.set_input_parameters(**prop_dict)
         return prop_dict
@@ -561,7 +572,9 @@ def AdvancedProperties(adv_prop_definition):
         prop_dict = adv_prop_definition(*args)
         #print "in decorator: ",properties
         host = args[0]
+#pylint: disable=protected-access
         if not host._run_from_web: # property run locally
+#pylint: disable=protected-access
             host._wvs.advanced_vars = prop_dict
             host.reducer.prop_man.set_input_parameters(**prop_dict)
         return prop_dict
@@ -578,6 +591,7 @@ def iliad(reduce):
         #seq = inspect.stack()
         # output workspace name.
         try:
+#pylint: disable=unused-variable
             n,r = funcreturns.lhs_info('both')
             out_ws_name = r[0]
         except:
@@ -600,6 +614,7 @@ def iliad(reduce):
                 try:
                     config.appendDataSearchDir(str(data_path))
                     args[1] = os.path.basename(input_file)
+#pylint: disable=bare-except
                 except: # if mantid is not available, this should ignore config
                     pass
         if output_directory:
diff --git a/scripts/Inelastic/Direct/RunDescriptor.py b/scripts/Inelastic/Direct/RunDescriptor.py
index 56bc9f12f36eccab240c185211056f664029908c..7bf9b7e50d233940c0a0b6b46f6ead023f093cab 100644
--- a/scripts/Inelastic/Direct/RunDescriptor.py
+++ b/scripts/Inelastic/Direct/RunDescriptor.py
@@ -53,6 +53,7 @@ class RunList(object):
                     local_fext.append(fext)
             else:
                 runs.append(int(item))
+#pylint: disable=attribute-defined-outside-init
         self._run_numbers = runs
         self._set_fnames(local_fnames,local_fext)
 #--------------------------------------------------------------------------------------------------
@@ -144,6 +145,7 @@ class RunList(object):
         """
         fext_given =self._fext[index]
         if fext_given is None:
+#pylint: disable=protected-access
             return self._theRun._holder.data_file_ext
         else:
             return fext_given
@@ -166,6 +168,7 @@ class RunList(object):
         """Return list of files, used corresponding to runs"""
         run_files = []
         for ind,run in enumerate(self._run_numbers):
+#pylint: disable=unused-variable
             fname,index = self.get_file_guess(inst_name,run,ind)
             run_files.append(fname)
         return run_files
@@ -294,8 +297,8 @@ class RunList(object):
         for run in run_list:
             file_hint,index = self.get_file_guess(inst_name,run)
             try:
-                file = FileFinder.findRuns(file_hint)[0]
-                fpath,fname = os.path.split(file)
+                file_name = FileFinder.findRuns(file_hint)[0]
+                fpath,fname = os.path.split(file_name)
                 fname,fex = os.path.splitext(fname)
                 self._fext[index] = fex
                 self._file_path[index] = fpath
@@ -307,6 +310,8 @@ class RunList(object):
 #--------------------------------------------------------------------------------------------------
 #--------------------------------------------------------------------------------------------------
 #--------------------------------------------------------------------------------------------------
+#pylint: disable=too-many-instance-attributes
+#pylint: disable=too-many-public-methods
 class RunDescriptor(PropDescriptor):
     """Descriptor to work with a run or list of runs specified
        either as run number (run file) or as
@@ -342,6 +347,7 @@ class RunDescriptor(PropDescriptor):
         if not self._run_number:
             return 0
         if self._run_list:
+#pylint: disable=protected-access
             return len(self._run_list._run_numbers)
         else:
             return 1
@@ -372,7 +378,7 @@ class RunDescriptor(PropDescriptor):
         self._ws_suffix = ''
         # property contains run lists
         self._run_list = None
-        #
+#pylint: disable=attribute-defined-outside-init
         self._in_cash = False
         # clear masking workspace if any available
         if self._mask_ws_name:
@@ -391,6 +397,7 @@ class RunDescriptor(PropDescriptor):
         else:
             return self._run_number
 #--------------------------------------------------------------------------------------------------------------------
+#pylint: disable=too-many-branches
     def __set__(self,instance,value):
         """Set up Run number and define workspace name from any source """
         #
@@ -445,7 +452,9 @@ class RunDescriptor(PropDescriptor):
 
         if self._run_list and instance.sum_runs:
             ind = self._run_list.add_or_replace_run(self._run_number,file_path,fext)
+#pylint: disable=protected-access
             self._run_file_path = self._run_list._file_path[ind]
+#pylint: disable=protected-access
             self._fext = self._run_list._fext[ind]
             self._ws_name = new_ws_name
         else:
@@ -506,7 +515,9 @@ class RunDescriptor(PropDescriptor):
         """
         if not noutputs:
             try:
+#pylint: disable=unused-variable
                 noutputs,r = funcreturns.lhs_info('both')
+#pylint: disable=bare-except
             except:
                 noutputs=0
 
@@ -533,13 +544,15 @@ class RunDescriptor(PropDescriptor):
            to use with this run workspace
         """
         if self._mask_ws_name:
+#pylint: disable=unused-variable
             mask_ws = mtd[self._mask_ws_name]
             add_mask_name = self._prop_name + '_tmp_masking'
         else:
             add_mask_name = self._prop_name + 'CurrentMasking'
-
+#pylint: disable=unused-variable
         masks,spectra = ExtractMask(InputWorkspace=masked_ws,OutputWorkspace=add_mask_name)
         if self._mask_ws_name:
+#pylint: disable=unused-variable
             mask_ws +=masks
             DeleteWorkspace(add_mask_name)
         else:
@@ -644,7 +657,6 @@ class RunDescriptor(PropDescriptor):
 
         if run_list:
             existing = self._run_list.get_all_run_list()
-            non_existing = []
             for run in run_list:
                 if not run in existing:
                     raise RuntimeError('run {0} is not in the existing run list'.format(run))
@@ -694,12 +706,15 @@ class RunDescriptor(PropDescriptor):
         new_name = self._build_ws_name()
         old_name = workspace.name()
         if new_name != old_name:
-            RenameWorkspace(InputWorkspace=old_name,OutputWorkspace=new_name)
-
-            old_mon_name = old_name + '_monitors'
-            new_mon_name = new_name + '_monitors'
-            if old_mon_name in mtd:
-                RenameWorkspace(InputWorkspace=old_mon_name,OutputWorkspace=new_mon_name)
+            # Compatibility with old test code comes here:
+            try:
+                mon_ws = workspace.getMonitorWorkspace()
+            except RuntimeError: # Its possible that monitor workspace for some reason was not attached
+                mon_ws_name = old_name + '_monitors' # to current workspace
+                if mon_ws_name in mtd:
+                    mon_ws = mtd[mon_ws_name]
+                    workspace.setMonitorWorkspace(mon_ws)
+            RenameWorkspace(InputWorkspace=old_name,OutputWorkspace=new_name,RenameMonitors=True)
         self._ws_name = new_name
 #--------------------------------------------------------------------------------------------------------------------
     @staticmethod
@@ -739,7 +754,8 @@ class RunDescriptor(PropDescriptor):
                 if self._run_list and RunDescriptor._holder.sum_runs : # Sum runs
                     ws = self._load_and_sum_runs(inst_name,RunDescriptor._holder.load_monitors_with_workspace)
                 else: # load current workspace
-                    ws = self.load_run(inst_name, calibration,False, RunDescriptor._holder.load_monitors_with_workspace,prefer_ws_calibration)
+                    ws = self.load_run(inst_name, calibration,False, \
+                         RunDescriptor._holder.load_monitors_with_workspace,prefer_ws_calibration)
 
 
                 self.synchronize_ws(ws)
@@ -769,43 +785,60 @@ class RunDescriptor(PropDescriptor):
         self.synchronize_ws(value)
 
 #--------------------------------------------------------------------------------------------------------------------
+#pylint: disable=too-many-arguments
     def chop_ws_part(self,origin,tof_range,rebin,chunk_num,n_chunks):
-        """Chop part of the original workspace and sets it up to this run as new original
-           Return the pointer to workspace being chopped
+        """Chop part of the original workspace and sets it up to this run as new original.
+
+           Return the pointer to the original workspace (the chunk has been taken) if the
+           chunk is not the last one, or pointer to last chunk if the last chunk was taken
+           (original workspace was destroyed in this case)
         """
         if not origin:
             origin = self.get_workspace()
 
         origin_name = origin.name()
+        # Check separate monitor's ws, attached to origin workspace (not to runWorkspace)
         try:
-            mon_ws = mtd[origin_name + '_monitors']
-        except:
-            mon_ws = None
+            mon_ws = origin.getMonitorWorkspace()
+        except RuntimeError:
+            mon_ws_name = origin_name+'_monitors'
+            if mon_ws_name in mtd:
+                mon_ws = mtd[mon_ws_name]
+                origin.setMonitorWorkspace(mon_ws)
+            else:
+                mon_ws = None
+        #
 
         target_name = '#{0}/{1}#'.format(chunk_num,n_chunks) + origin_name
         if chunk_num == n_chunks:
-            RenameWorkspace(InputWorkspace=origin_name,OutputWorkspace=target_name)
-            if mon_ws:
-                RenameWorkspace(InputWorkspace=mon_ws,OutputWorkspace=target_name + '_monitors')
+            RenameWorkspace(InputWorkspace=origin_name,OutputWorkspace=target_name,RenameMonitors=True)
             origin_name = target_name
-            origin_invalidated = True
         else:
             if mon_ws:
-                CloneWorkspace(InputWorkspace=mon_ws,OutputWorkspace=target_name + '_monitors')
-            origin_invalidated = False
+                mon_ws = CloneWorkspace(InputWorkspace=mon_ws,OutputWorkspace=target_name + '_monitors')
 
         if rebin: # debug and compatibility mode with old reduction
-            Rebin(origin_name,OutputWorkspace=target_name,Params=[tof_range[0],tof_range[1],tof_range[2]],PreserveEvents=False)
+            target=Rebin(origin_name,OutputWorkspace=target_name,Params=[tof_range[0],tof_range[1],tof_range[2]],PreserveEvents=False)
+            # Rebin in place does not conserves mon_ws?
+            origin_deleted = True
         else:
-            CropWorkspace(origin_name,OutputWorkspace=target_name,XMin=tof_range[0],XMax=tof_range[2])
+            target = CropWorkspace(origin_name,OutputWorkspace=target_name,XMin=tof_range[0],XMax=tof_range[2])
+            if origin_name == target_name:
+                origin_deleted = True
+            else:
+                origin_deleted = False
+        if mon_ws:
+            target.setMonitorWorkspace(mon_ws)
+
 
         self._set_ws_as_source(mtd[target_name])
-        if origin_invalidated:
+        if origin_deleted:
             return self.get_workspace()
         else:
-            return origin
+            return mtd[origin_name]
 
 #--------------------------------------------------------------------------------------------------------------------
+#pylint: disable=too-many-branches
     def get_monitors_ws(self,monitors_ID=None,otherWS=None):
         """Get pointer to a workspace containing monitors.
 
@@ -819,18 +852,31 @@ class RunDescriptor(PropDescriptor):
         if not data_ws:
             return None
 
-        monWS_name = data_ws.name() + '_monitors'
-        if monWS_name in mtd:
-            mon_ws = mtd[monWS_name]
-            monitors_separate = True
-        else:
-            mon_ws = data_ws
+        try:
+            mon_ws = data_ws.getMonitorWorkspace()
+        except RuntimeError: # May be old code or some problem connecting workspace with monitor workspace
+            ws_name = data_ws.name()
+            mon_ws_name = ws_name+'_monitors'
+            if mon_ws_name in mtd:
+                mon_ws = mtd[mon_ws_name]
+                data_ws.setMonitorWorkspace(mon_ws) # connect workspace and monitors together
+            else:
+                mon_ws = None
+
+        if mon_ws is None:
             monitors_separate = False
+            mon_ws = data_ws
+        else:
+            monitors_separate = True
 
         spec_to_mon = RunDescriptor._holder.spectra_to_monitors_list
-        if monitors_separate and spec_to_mon :
+        if monitors_separate and spec_to_mon:
+            mon_ws_name = mon_ws.name()
             for specID in spec_to_mon:
                 mon_ws = self.copy_spectrum2monitors(data_ws,mon_ws,specID)
+            if mon_ws:
+                mon_ws=mtd[mon_ws_name] # very weird operation needed
+                data_ws.setMonitorWorkspace(mon_ws)
 
         if monitors_ID:
             def flatten_list(targ_list,source):
@@ -850,10 +896,13 @@ class RunDescriptor(PropDescriptor):
         #
         for monID in mon_list:
             try:
+#pylint: disable=unused-variable
                 ws_ind = mon_ws.getIndexFromSpectrumNumber(int(monID))
+#pylint: disable=bare-except
             except:
                 try:
                     monws_name = mon_ws.name()
+#pylint: disable=bare-except
                 except:
                     monws_name = 'None'
                 RunDescriptor._logger('*** Monitor workspace {0} does not have spectra with ID {1}. Monitor workspace set to None'.\
@@ -910,6 +959,7 @@ class RunDescriptor(PropDescriptor):
         if os.path.exists(fname):
             return fname,old_ext
         else:
+#pylint: disable=unused-variable
             fp,hint = os.path.split(fname)
         return hint,old_ext
 #--------------------------------------------------------------------------------------------------------------------
@@ -929,26 +979,27 @@ class RunDescriptor(PropDescriptor):
         #
         file_hint,old_ext = self.file_hint(run_num_str,filePath,fileExt,**kwargs)
 
-        def _check_ext(file):
-            fname,fex = os.path.splitext(file)
+        def _check_ext(file_name):
+            fname,fex = os.path.splitext(file_name)
             if old_ext != fex:
                 message = '*** Cannot find run-file with extension {0}.\n'\
-                          '    Found file {1} instead'.format(old_ext,file)
+                          '    Found file {1} instead'.format(old_ext,file_name)
                 RunDescriptor._logger(message,'notice')
             self._run_file_path = os.path.dirname(fname)
             self._fext = fex
 
         #------------------------------------------------
         try:
-            file = FileFinder.findRuns(file_hint)[0]
-            _check_ext(file)
-            return (True,file)
+            file_name = FileFinder.findRuns(file_hint)[0]
+            _check_ext(file_name)
+            return (True,file_name)
         except RuntimeError:
             try:
+#pylint: disable=unused-variable
                 file_hint,oext = os.path.splitext(file_hint)
-                file = FileFinder.findRuns(file_hint)[0]
-                _check_ext(file)
-                return (True,file)
+                file_name = FileFinder.findRuns(file_hint)[0]
+                _check_ext(file_name)
+                return (True,file_name)
             except RuntimeError:
                 message = '*** Cannot find file matching hint {0} on Mantid search paths '.\
                         format(file_hint)
@@ -956,11 +1007,11 @@ class RunDescriptor(PropDescriptor):
                     RunDescriptor._logger(message,'warning')
                 return (False,message)
 #--------------------------------------------------------------------------------------------------------------------
-
+#pylint: disable=too-many-arguments
     def load_file(self,inst_name,ws_name,run_number=None,load_mon_with_workspace=False,filePath=None,fileExt=None,**kwargs):
         """Load run for the instrument name provided. If run_numner is None, look for the current run"""
 
-        ok,data_file = self.find_file(RunDescriptor._holder,None,run_number,filePath,fileExt,**kwargs)
+        ok,data_file = self.find_file(RunDescriptor._holder,inst_name,run_number,filePath,fileExt,**kwargs)
         if not ok:
             self._ws_name = None
             raise IOError(data_file)
@@ -987,7 +1038,8 @@ class RunDescriptor(PropDescriptor):
             mon_load_option = 'Separate'
         #
         nxs_file=False
-        file,ext = os.path.splitext(data_file)
+#pylint: disable=unused-variable
+        file_name,ext = os.path.splitext(data_file)
         if ext == '.nxs':
             nxs_file = True
         try: # Hack: LoadEventNexus does not understand Separate at the moment and throws.
@@ -1002,6 +1054,7 @@ class RunDescriptor(PropDescriptor):
             if instr_name == 'LET' and self._run_number>14151 and self._run_number<14382:
                 FrameworkManager.clearInstruments()
                 idf_file = api.ExperimentInfo.getInstrumentFilename(instr_name)
+#pylint: disable=unused-variable
                 idf_path,tile = os.path.split(idf_file)
                 idf_file = os.path.join(idf_path,'LET_Definition.xml')
                 LoadInstrument(ws_name,idf_file,RewriteSpectraMap='0')
@@ -1012,7 +1065,7 @@ class RunDescriptor(PropDescriptor):
 
         return loaded_ws
 #--------------------------------------------------------------------------------------------------------------------
-
+#pylint: disable=too-many-arguments
     def load_run(self,inst_name, calibration=None, force=False, mon_load_option=False,use_ws_calibration=True,\
                  filePath=None,fileExt=None,**kwargs):
         """Loads run into workspace with name provided.
@@ -1037,6 +1090,7 @@ class RunDescriptor(PropDescriptor):
         self.apply_calibration(loaded_ws,calibration,use_ws_calibration)
         return loaded_ws
 #--------------------------------------------------------------------------------------------------------------------
+#pylint: disable=too-many-branches
     def apply_calibration(self,loaded_ws,calibration=None,use_ws_calibration=True):
         """If calibration is present, apply it to the workspace
 
@@ -1066,7 +1120,8 @@ class RunDescriptor(PropDescriptor):
                     if len(ws_calibration) == 0:
                         raise RuntimeError('Can not find defined in run {0} calibration file {1}\n'\
                                            'Define det_cal_file reduction parameter properly'.format(loaded_ws.name(),test_name))
-                    RunDescriptor._logger('*** load_data: Calibrating data using workspace defined calibration file: {0}'.format(ws_calibration),'notice')
+                    RunDescriptor._logger('*** load_data: Calibrating data using workspace defined calibration file: {0}'.\
+                                            format(ws_calibration),'notice')
             except KeyError: # no det_cal_file defined in workspace
                 if calibration:
                     ws_calibration = calibration
@@ -1134,6 +1189,8 @@ class RunDescriptor(PropDescriptor):
             ws_index = mon_ws.getIndexFromSpectrumNumber(spectraID)
             # Spectra is already in the monitor workspace
             return mon_ws
+# no exception type specified -- do not know what it throws
+#pylint: disable=bare-except
         except:
             try:
                 ws_index = data_ws.getIndexFromSpectrumNumber(spectraID)
@@ -1189,6 +1246,7 @@ class RunDescriptor(PropDescriptor):
 
         self._ws_name = ''
         self._ws_cname = ''
+#pylint: disable=attribute-defined-outside-init
         self._ws_suffix = ''
         if ws_name in mtd:
             ws = mtd[ws_name]
@@ -1198,6 +1256,7 @@ class RunDescriptor(PropDescriptor):
             DeleteWorkspace(mon_name)
         if self._run_list:
             ind = self._run_list.add_or_replace_run(self._run_number)
+#pylint: disable=protected-access
             self._run_file_path = self._run_list._file_path[ind]
             self._fext = self._run_list.get_fext(ind)
 #--------------------------------------------------------------------------------------------------------------------
@@ -1250,8 +1309,12 @@ class RunDescriptor(PropDescriptor):
         if self._run_number:
             instr_name = self._instr_name()
             name = name.replace(instr_name,'',1)
+# Hell knows how to redefine these warnings or if they are valid or not
+#pylint: disable=W0141
+#pylint: disable=W0110
             self._ws_cname = part_ind + filter(lambda c: not c.isdigit(), name)
         else:
+#pylint: disable=attribute-defined-outside-init
             self._ws_cname = part_ind + name
     #
     def _instr_name(self):
@@ -1277,11 +1340,17 @@ class RunDescriptor(PropDescriptor):
                 rl = self._run_list
                 self._clear_all()
                 rl.set_last_ind2sum(-1) # this will reset index to default
+# disable attribute defined outside __init__. This is where it value changes,
+# what to do about it?
+#pylint: disable=attribute-defined-outside-init
                 self._run_list = rl
                 run_num,file_path,main_fext,ind = self._run_list.get_current_run_info(new_value)
                 self._run_list.set_last_ind2sum(ind)
+#pylint: disable=attribute-defined-outside-init
                 self._run_number = run_num
+#pylint: disable=attribute-defined-outside-init
                 self._run_file_path = file_path
+#pylint: disable=attribute-defined-outside-init
                 self._fext = main_fext
                 self._ws_name = self._build_ws_name(new_value)
             if new_value is False:
@@ -1308,7 +1377,7 @@ class RunDescriptor(PropDescriptor):
         else:
             RunDescriptor._logger("*** Loading #{0}/{1}, run N: {2} ".\
                    format(1,num_to_sum,runs_to_sum[0]))
-
+#pylint: disable=unused-variable
             f_guess,index = self._run_list.get_file_guess(inst_name,runs_to_sum[0])
             ws = self.load_file(inst_name,'Sum_ws',False,monitors_with_ws,
                                 False,file_hint=f_guess)
@@ -1465,6 +1534,7 @@ class RunDescriptorDependent(RunDescriptor):
         else:
             return self._host.get_ws_clone(clone_name)
 #pylint: disable=too-many-arguments
+#pylint: disable=too-many-public-methods
     def chop_ws_part(self,origin,tof_range,rebin,chunk_num,n_chunks):
         if self._has_own_value:
             return super(RunDescriptorDependent,self).chop_ws_part(origin,tof_range,rebin,chunk_num,n_chunks)
@@ -1473,7 +1543,8 @@ class RunDescriptorDependent(RunDescriptor):
 
     def get_monitors_ws(self,monitor_ID=None,otherWS=None):
         if self._has_own_value:
-            return super(RunDescriptorDependent,self).get_monitors_ws(monitor_ID,otherWS)
+            return super(RunDescriptorDependent,self).\
+                   get_monitors_ws(monitor_ID,otherWS)
         else:
             return self._host.get_monitors_ws(monitor_ID,otherWS)
 
@@ -1497,8 +1568,8 @@ class RunDescriptorDependent(RunDescriptor):
 #pylint: disable=too-many-arguments
     def load_file(self,inst_name,ws_name,run_number=None,load_mon_with_workspace=False,filePath=None,fileExt=None,**kwargs):
         if self._has_own_value:
-            return super(RunDescriptorDependent,self).load_file(inst_name,ws_name,run_number,load_mon_with_workspace,\
-                         filePath,fileExt,**kwargs)
+            return super(RunDescriptorDependent,self).load_file(inst_name,ws_name,run_number,\
+                        load_mon_with_workspace,filePath,fileExt,**kwargs)
         else:
             return self._host.load_file(inst_name,ws_name,run_number,load_mon_with_workspace,filePath,fileExt,**kwargs)
 #pylint: disable=too-many-arguments
@@ -1542,6 +1613,7 @@ class RunDescriptorDependent(RunDescriptor):
             return self._host.export_normalization(other_workspace)
 #--------------------------------------------------------------------------------------------------------------------
 #--------------------------------------------------------------------------------------------------------------------
+
 def build_run_file_name(run_num,inst,file_path='',fext=''):
     """Build the full name of a runfile from all possible components"""
     if fext is None:
@@ -1549,14 +1621,13 @@ def build_run_file_name(run_num,inst,file_path='',fext=''):
     if isinstance(run_num,str):
         run_num_str = run_num
     else:
-#pylint: disable=W0212
+#pylint: disable=protected-access
         fac = RunDescriptor._holder.facility
-        zero_padding    = fac.instrument(inst).zeroPadding(run_num)
-        run_num_str = str(run_num).zfill(zero_padding)
+        zero_padding = fac.instrument(inst).zeroPadding(run_num)
+        run_num_str  = str(run_num).zfill(zero_padding)
 
     fname = '{0}{1}{2}'.format(inst,run_num_str,fext)
     if not file_path is None:
         if os.path.exists(file_path):
             fname = os.path.join(file_path,fname)
     return fname
-
diff --git a/scripts/SANS/SANSUtility.py b/scripts/SANS/SANSUtility.py
index 00e66a500675e9cd6a5035926f19b6f6ef40d0d0..e72ae54912f3d2a780b5a74e73f382ccd512d872 100644
--- a/scripts/SANS/SANSUtility.py
+++ b/scripts/SANS/SANSUtility.py
@@ -1,4 +1,4 @@
-#pylint: disable=too-many-lines
+#pylint: disable=too-many-lines
 #pylint: disable=invalid-name
 #########################################################
 # This module contains utility functions common to the
@@ -1167,7 +1167,7 @@ def correct_q_resolution_for_can(original_workspace, can_workspace, subtracted_w
     @param subtracted_workspace: the subtracted workspace
     '''
     dummy1 = can_workspace
-    if original_workspace.getNumberHistograms() == 1:
+    if original_workspace.getNumberHistograms() == 1 and original_workspace.hasDx(0):
         subtracted_workspace.setDx(0, original_workspace.dataDx(0))
 
 def correct_q_resolution_for_merged(count_ws_front, count_ws_rear,
diff --git a/scripts/test/DirectEnergyConversionTest.py b/scripts/test/DirectEnergyConversionTest.py
index adad80b36cf157078ab3e27ff6500bb0c184f93a..79147f9364a822c02626455ead487a31fa8aceb8 100644
--- a/scripts/test/DirectEnergyConversionTest.py
+++ b/scripts/test/DirectEnergyConversionTest.py
@@ -1,5 +1,5 @@
-import os, sys
-#os.environ["PATH"] = r"c:\Mantid\Code\builds\br_master\bin\Release;"+os.environ["PATH"]
+import os, sys
+#os.environ["PATH"] = r"c:\Mantid\_builds\br_master\bin\Release;"+os.environ["PATH"]
 from mantid.simpleapi import *
 from mantid import api
 import unittest
@@ -282,11 +282,14 @@ class DirectEnergyConversionTest(unittest.TestCase):
         run = CreateSampleWorkspace( Function='Multiple Peaks',WorkspaceType='Event',NumBanks=8, BankPixelWidth=1, NumEvents=100000,
                                     XUnit='TOF',xMin=tMin,xMax=tMax)
         LoadInstrument(run,InstrumentName='MARI')
+        run.setMonitorWorkspace(run_monitors)
+
         wb_ws   = Rebin(run,Params=[tMin,1,tMax],PreserveEvents=False)
 
         # References used to test against ordinary reduction
         ref_ws = Rebin(run,Params=[tMin,1,tMax],PreserveEvents=False)
         ref_ws_monitors = CloneWorkspace('run_monitors')
+        ref_ws.setMonitorWorkspace(ref_ws_monitors)
         # just in case, wb should work without clone too.
         wb_clone = CloneWorkspace(wb_ws)
 
@@ -489,10 +492,12 @@ class DirectEnergyConversionTest(unittest.TestCase):
                                      NumEvents=100000, XUnit='TOF',xMin=tMin,xMax=tMax)
         LoadInstrument(run,InstrumentName='MARI')
         AddSampleLog(run,LogName='gd_prtn_chrg',LogText='1.',LogType='Number')
+        run.setMonitorWorkspace(run_monitors)
 
         # build "monovanadium"
         mono = CloneWorkspace(run)
         mono_monitors = CloneWorkspace(run_monitors)
+        mono.setMonitorWorkspace(mono_monitors)
 
         # build "White-beam"
         wb_ws   = Rebin(run,Params=[tMin,1,tMax],PreserveEvents=False)
@@ -500,6 +505,7 @@ class DirectEnergyConversionTest(unittest.TestCase):
         # build "second run" to ensure repeated execution
         run2 = CloneWorkspace(run)
         run2_monitors = CloneWorkspace(run_monitors)
+        run2.setMonitorWorkspace(run2_monitors)
 
         # Run multirep
         tReducer = DirectEnergyConversion(run.getInstrument())
@@ -619,6 +625,6 @@ class DirectEnergyConversionTest(unittest.TestCase):
 
 
 if __name__=="__main__":
-   #test = DirectEnergyConversionTest('test_sum_monitors')
-   #test.test_sum_monitors()
+   #test = DirectEnergyConversionTest('test_multirep_mode')
+   #test.test_multirep_mode()
    unittest.main()
diff --git a/scripts/test/DirectPropertyManagerTest.py b/scripts/test/DirectPropertyManagerTest.py
index 6f11d70a4ad47caf77eb3725d1468a78c4d10932..0df8ff30d31c8125d68c068f123bc4a1467574e1 100644
--- a/scripts/test/DirectPropertyManagerTest.py
+++ b/scripts/test/DirectPropertyManagerTest.py
@@ -1,5 +1,5 @@
 import os
-os.environ["PATH"] = r"c:/Mantid/Code/builds/br_master/bin/Release;" + os.environ["PATH"]
+#os.environ["PATH"] = r"c:/Mantid/_builds/br_master/bin/Release;"+os.environ["PATH"]
 from mantid.simpleapi import *
 from mantid import api
 import unittest
@@ -1044,6 +1044,8 @@ class DirectPropertyManagerTest(unittest.TestCase):
 
         ok,fail_list = propman._check_file_properties()
         self.assertTrue(ok)
+        if not ok:
+            print "fail prop list: ",fail_list
 
         api.AnalysisDataService.clear()
 
@@ -1158,7 +1160,6 @@ class DirectPropertyManagerTest(unittest.TestCase):
 
 
 if __name__ == "__main__":
-    unittest.main()
     #tester = DirectPropertyManagerTest('test_set_energy_bins_and_ei')
     #tester.run()
-
+    unittest.main()
diff --git a/scripts/test/MariReduction.py b/scripts/test/MariReduction.py
index 43692987240fd78ac3fc5906338787cfdc589c4f..2f766687a4842b9443ec5b084387b8b91c487aca 100644
--- a/scripts/test/MariReduction.py
+++ b/scripts/test/MariReduction.py
@@ -40,7 +40,7 @@ class ReduceMARI(ReductionWrapper):
       prop['map_file'] = "mari_res.map"
       prop['monovan_mapfile'] = "mari_res.map"
       prop['hard_mask_file'] = "mar11015.msk"
-      prop['det_cal_file'] = "11060"
+      prop['det_cal_file'] = 11060
       prop['save_format'] = ''
       return prop
       #
diff --git a/scripts/test/ReductionWrapperTest.py b/scripts/test/ReductionWrapperTest.py
index 397b09ce3c9f9c0f17842d3d679f736eac94f170..5100345743c4ee7a6ca65595c5a401a71c1bf911 100644
--- a/scripts/test/ReductionWrapperTest.py
+++ b/scripts/test/ReductionWrapperTest.py
@@ -179,6 +179,9 @@ class ReductionWrapperTest(unittest.TestCase):
         red._wvs.standard_vars={}
         red._wvs.advanced_vars={}
         ok,level,errors = red.validate_settings()
+        if not ok:
+            print "Errors found at level",level
+            print errors
 
         self.assertTrue(ok)
         self.assertEqual(level,0)
diff --git a/scripts/test/RunDescriptorTest.py b/scripts/test/RunDescriptorTest.py
index 663c7972c988c771022b444b197a384c29842eaa..5e7969932e844ca0e980caee42504ec207f5b22d 100644
--- a/scripts/test/RunDescriptorTest.py
+++ b/scripts/test/RunDescriptorTest.py
@@ -1,5 +1,5 @@
 import os,sys,inspect
-#os.environ["PATH"] =r"c:/Mantid/Code/builds/br_master/bin/Release;"+os.environ["PATH"]
+#os.environ["PATH"] =r"c:/Mantid/_builds/br_master/bin/Release;"+os.environ["PATH"]
 from mantid.simpleapi import *
 from mantid import api
 import unittest
@@ -144,6 +144,8 @@ class RunDescriptorTest(unittest.TestCase):
         propman  = self.prop_man
         run_ws = CreateSampleWorkspace( Function='Multiple Peaks', WorkspaceType = 'Event',NumBanks=1, BankPixelWidth=5, NumEvents=100)
         run_ws_monitors = CreateSampleWorkspace( Function='Multiple Peaks', WorkspaceType = 'Histogram',NumBanks=2, BankPixelWidth=1, NumEvents=100)
+        run_ws.setMonitorWorkspace(run_ws_monitors)
+
         self.assertEqual(run_ws_monitors.getNumberHistograms(),2)
 
 
@@ -159,8 +161,9 @@ class RunDescriptorTest(unittest.TestCase):
         propman  = self.prop_man
         run_ws = CreateSampleWorkspace( Function='Multiple Peaks', WorkspaceType = 'Event',NumBanks=1, BankPixelWidth=5, NumEvents=100)
         run_ws_monitors = CreateSampleWorkspace( Function='Multiple Peaks', WorkspaceType = 'Histogram',NumBanks=2, BankPixelWidth=1, NumEvents=100)
-
         run_ws_monitors = Rebin(run_ws_monitors,Params='1,-0.01,20000')
+        run_ws.setMonitorWorkspace(run_ws_monitors)
+
         x=run_ws_monitors.readX(0)
         dx = x[1:]-x[:-1]
         min_step0 = min(dx)
@@ -568,7 +571,52 @@ class RunDescriptorTest(unittest.TestCase):
         propman.sample_run = None
         DeleteWorkspace(a_wksp)
 
+    def test_monitors_renamed(self):
+        wksp=CreateSampleWorkspace(Function='Multiple Peaks',WorkspaceType='Event',
+                                NumBanks=1, BankPixelWidth=1, NumEvents=1, XUnit='TOF',
+                                XMin=2000, XMax=20000, BinWidth=1)
+        wksp_monitors=CreateSampleWorkspace(Function='Multiple Peaks',WorkspaceType='Histogram',
+                                NumBanks=3, BankPixelWidth=1, NumEvents=1, XUnit='TOF',
+                                XMin=2000, XMax=20000, BinWidth=1)
+        propman  = self.prop_man
+
+        propman.sample_run = wksp
+
+        fail = False
+        try:
+            mon_ws = wksp.getMonitorWorkspace()
+        except:
+            fail= True
+        self.assertFalse(fail)
+
+        mon_ws = PropertyManager.sample_run.get_monitors_ws()
+        self.assertEqual(mon_ws.name(),'SR_wksp_monitors')
+
+        wsr = RenameWorkspace(wksp,OutputWorkspace='Renamed1',RenameMonitors=True)
+        PropertyManager.sample_run.synchronize_ws(wsr)
+
+        mon_ws = PropertyManager.sample_run.get_monitors_ws()
+        self.assertEqual(mon_ws.name(),'SR_wksp_monitors')
+
+        wsr.clearMonitorWorkspace()
+        fail = False
+        try:
+            mon_ws = wksp.getMonitorWorkspace()
+        except:
+            fail= True
+        self.assertTrue(fail)
+
+        mon_ws = PropertyManager.sample_run.get_monitors_ws()
+
+        fail = False
+        try:
+            mon_ws = wksp.getMonitorWorkspace()
+        except:
+            fail= True
+        self.assertFalse(fail)
 
 
 if __name__=="__main__":
+    #tester=RunDescriptorTest('test_monitors_renamed')
+    #tester.test_monitors_renamed()
     unittest.main()
diff --git a/scripts/test/SANSUtilityTest.py b/scripts/test/SANSUtilityTest.py
index 4a301439f6ce04f5f8a0a457822b580fd6e09013..1adf5513260cf9174ff67e062dd640bb06cd1297 100644
--- a/scripts/test/SANSUtilityTest.py
+++ b/scripts/test/SANSUtilityTest.py
@@ -1,4 +1,4 @@
-
+
 import unittest
 # Need to import mantid before we import SANSUtility
 import mantid
@@ -1058,6 +1058,26 @@ class TestGetCorrectQResolution(unittest.TestCase):
         DeleteWorkspace(can)
         DeleteWorkspace(result)
 
+    def test_error_is_not_passed_on_when_did_not_exist_beforehand(self):
+        # Arrange
+        orig_name = "orig"
+        can_name = "can"
+        result_name = "result"
+        provide_workspace_with_x_errors(orig_name, False, 1)
+        provide_workspace_with_x_errors(can_name, False, 1)
+        provide_workspace_with_x_errors(result_name, False, 1)
+        orig = mtd[orig_name]
+        can = mtd[can_name]
+        result = mtd[result_name]
+        # Act
+        su.correct_q_resolution_for_can(orig, can, result)
+        # Assert
+        self.assertFalse(result.hasDx(0))
+        # Clean up
+        DeleteWorkspace(orig)
+        DeleteWorkspace(can)
+        DeleteWorkspace(result)
+
 
 class TestGetQResolutionForMergedWorkspaces(unittest.TestCase):
     def test_error_is_ignored_for_more_than_one_spectrum(self):