Index: code/branches/kicklib2/src/libraries/core/CorePrereqs.h
===================================================================
--- code/branches/kicklib2/src/libraries/core/CorePrereqs.h	(revision 8284)
+++ code/branches/kicklib2/src/libraries/core/CorePrereqs.h	(revision 8285)
@@ -262,5 +262,6 @@
 namespace boost
 {
-#if BOOST_VERSION < 104400
+#if (BOOST_VERSION < 104400)
+
     namespace filesystem
     {
@@ -269,5 +270,8 @@
         typedef basic_path<std::string, path_traits> path;
     }
-#elif BOOST_VERSION < 104600
+
+#elif (BOOST_VERSION < 104800)
+
+# if BOOST_FILESYSTEM_VERSION == 2
     namespace filesystem2
     {
@@ -282,14 +286,25 @@
         using filesystem2::path;
     }
+# elif BOOST_FILESYSTEM_VERSION == 3
+    namespace filesystem3
+    {
+        class path;
+    }
+    namespace filesystem
+    {
+        using filesystem3::path;
+    }
+# endif
+
 #else
-    namespace filesystem3
+
+    // TODO: Check this once boost 1.48 is released
+    namespace filesystem
     {
         class path;
     }
-    namespace filesystem
-    {
-        using filesystem3::path;
-    }
+
 #endif
+
     class thread;
     class mutex;
Index: code/branches/kicklib2/src/libraries/core/GraphicsManager.cc
===================================================================
--- code/branches/kicklib2/src/libraries/core/GraphicsManager.cc	(revision 8284)
+++ code/branches/kicklib2/src/libraries/core/GraphicsManager.cc	(revision 8285)
@@ -30,4 +30,5 @@
 #include "GraphicsManager.h"
 
+#include <cstdlib>
 #include <fstream>
 #include <sstream>
@@ -120,10 +121,9 @@
         // Only for development runs
         if (PathConfig::isDevelopmentRun())
-        {
             Ogre::ResourceGroupManager::getSingleton().addResourceLocation(PathConfig::getExternalDataPathString(), "FileSystem");
-            extResources_.reset(new XMLFile("resources.oxr"));
-            extResources_->setLuaSupport(false);
-            Loader::open(extResources_.get());
-        }
+
+        extResources_.reset(new XMLFile("resources.oxr"));
+        extResources_->setLuaSupport(false);
+        Loader::open(extResources_.get());
 
         if (bLoadRenderer)
@@ -150,6 +150,5 @@
         // Undeclare the resources
         Loader::unload(resources_.get());
-        if (PathConfig::isDevelopmentRun())
-            Loader::unload(extResources_.get());
+        Loader::unload(extResources_.get());
     }
 
@@ -158,6 +157,4 @@
         SetConfigValue(ogreConfigFile_,  "ogre.cfg")
             .description("Location of the Ogre config file");
-        SetConfigValue(ogrePluginsDirectory_, specialConfig::ogrePluginsDirectory)
-            .description("Folder where the Ogre plugins are located.");
         SetConfigValue(ogrePlugins_, specialConfig::ogrePlugins)
             .description("Comma separated list of all plugins to load.");
@@ -251,18 +248,32 @@
     void GraphicsManager::loadOgrePlugins()
     {
-        // just to make sure the next statement doesn't segfault
-        if (ogrePluginsDirectory_.empty())
-            ogrePluginsDirectory_ = '.';
-
-        boost::filesystem::path folder(ogrePluginsDirectory_);
+        // Plugin path can have many different locations...
+        std::string pluginPath = specialConfig::ogrePluginsDirectory;
+#ifdef DEPENDENCY_PACKAGE_ENABLE
+        if (!PathConfig::isDevelopmentRun())
+        {
+#  if defined(ORXONOX_PLATFORM_WINDOWS)
+            pluginPath = PathConfig::getExecutablePathString();
+#  elif defined(ORXONOX_PLATFORM_APPLE)
+            // TODO: Where are the plugins being installed to?
+            pluginPath = PathConfig::getExecutablePathString();
+#  endif
+        }
+#endif
+
+#ifdef ORXONOX_PLATFORM_WINDOWS
+        // Add OGRE plugin path to the environment. That way one plugin could
+        // also depend on another without problems on Windows
+        const char* currentPATH = getenv("PATH");
+        std::string newPATH = pluginPath;
+        if (currentPATH != NULL)
+            newPATH = std::string(currentPATH) + ';' + newPATH;
+        putenv(const_cast<char*>(("PATH=" + newPATH).c_str()));
+#endif
+
         // Do some SubString magic to get the comma separated list of plugins
         SubString plugins(ogrePlugins_, ",", " ", false, '\\', false, '"', false, '{', '}', false, '\0');
-        // Use backslash paths on Windows! file_string() already does that though.
         for (unsigned int i = 0; i < plugins.size(); ++i)
-#if BOOST_FILESYSTEM_VERSION < 3
-            ogreRoot_->loadPlugin((folder / plugins[i]).file_string());
-#else
-            ogreRoot_->loadPlugin((folder / plugins[i]).string());
-#endif
+            ogreRoot_->loadPlugin(pluginPath + '/' + plugins[i]);
     }
 
@@ -290,13 +301,4 @@
 
         Ogre::WindowEventUtilities::addWindowEventListener(this->renderWindow_, ogreWindowEventListener_.get());
-
-// HACK
-#ifdef ORXONOX_PLATFORM_APPLE
-        //INFO: This will give our window focus, and not lock it to the terminal
-        ProcessSerialNumber psn = {0, kCurrentProcess};
-        TransformProcessType(&psn, kProcessTransformToForegroundApplication);
-        SetFrontProcess(&psn);
-#endif
-// End of HACK
 
         // create a full screen default viewport
Index: code/branches/kicklib2/src/libraries/core/GraphicsManager.h
===================================================================
--- code/branches/kicklib2/src/libraries/core/GraphicsManager.h	(revision 8284)
+++ code/branches/kicklib2/src/libraries/core/GraphicsManager.h	(revision 8285)
@@ -128,5 +128,4 @@
         // config values
         std::string         ogreConfigFile_;           //!< ogre config filename
-        std::string         ogrePluginsDirectory_;     //!< Directory where the Ogre plugins are located
         std::string         ogrePlugins_;              //!< Comma separated list of all plugins to load
         std::string         ogreLogFile_;              //!< log filename for Ogre log messages
Index: code/branches/kicklib2/src/libraries/core/Identifier.h
===================================================================
--- code/branches/kicklib2/src/libraries/core/Identifier.h	(revision 8284)
+++ code/branches/kicklib2/src/libraries/core/Identifier.h	(revision 8285)
@@ -395,5 +395,5 @@
     {
         // Get the name of the class
-        const std::string& name = typeid(T).name();
+        std::string name = typeid(T).name();
 
         // create a new identifier anyway. Will be deleted in Identifier::getIdentifier if not used.
Index: code/branches/kicklib2/src/libraries/core/PathConfig.cc
===================================================================
--- code/branches/kicklib2/src/libraries/core/PathConfig.cc	(revision 8284)
+++ code/branches/kicklib2/src/libraries/core/PathConfig.cc	(revision 8285)
@@ -33,5 +33,4 @@
 #include <cstdio>
 #include <vector>
-#include <boost/version.hpp>
 #include <boost/filesystem.hpp>
 
@@ -56,11 +55,13 @@
 #include "CommandLineParser.h"
 
-// Boost 1.36 has some issues with deprecated functions that have been omitted
-#if (BOOST_VERSION == 103600)
-#  define BOOST_LEAF_FUNCTION filename
-#elif (BOOST_FILESYSTEM_VERSION < 3)
-#  define BOOST_LEAF_FUNCTION leaf
+// Differentiate Boost Filesystem v2 and v3
+#if (BOOST_FILESYSTEM_VERSION < 3)
+#  define BF_LEAF leaf
+#  define BF_GENERIC_STRING string
+#  define BF_NATIVE_STRING file_string
 #else
-#  define BOOST_LEAF_FUNCTION path().filename().string
+#  define BF_LEAF path().filename().string
+#  define BF_GENERIC_STRING generic_string
+#  define BF_NATIVE_STRING string
 #endif
 
@@ -242,5 +243,5 @@
             {
                 ThrowException(General, std::string("The ") + it->second + " directory has been preoccupied by a file! \
-                                         Please remove " + it->first.string());
+                                         Please remove " + it->first.BF_GENERIC_STRING());
             }
             if (bf::create_directories(it->first)) // function may not return true at all (bug?)
@@ -259,7 +260,12 @@
         size_t moduleextensionlength = moduleextension.size();
 
+#ifdef ORXONOX_PLATFORM_WINDOWS
         // Add that path to the PATH variable in case a module depends on another one
-        std::string pathVariable(getenv("PATH"));
-        putenv(const_cast<char*>(("PATH=" + pathVariable + ';' + modulePath_.string()).c_str()));
+        const char* currentPATH = getenv("PATH");
+        std::string newPATH = modulePath_.BF_NATIVE_STRING();
+        if (currentPATH != NULL)
+            newPATH = std::string(currentPATH) + ';' + newPATH;
+        putenv(const_cast<char*>(("PATH=" + newPATH).c_str()));
+#endif
 
         // Make sure the path exists, otherwise don't load modules
@@ -273,5 +279,5 @@
         while (file != end)
         {
-            std::string filename = file->BOOST_LEAF_FUNCTION();
+            std::string filename = file->BF_LEAF();
 
             // Check if the file ends with the extension in question
@@ -282,9 +288,5 @@
                     // We've found a helper file
                     const std::string& library = filename.substr(0, filename.size() - moduleextensionlength);
-#if BOOST_FILESYSTEM_VERSION < 3
-                    modulePaths.push_back((modulePath_ / library).file_string());
-#else
-                    modulePaths.push_back((modulePath_ / library).string());
-#endif
+                    modulePaths.push_back(getModulePathString() + library);
                 }
             }
@@ -297,35 +299,35 @@
     /*static*/ std::string PathConfig::getRootPathString()
     {
-        return getInstance().rootPath_.string() + '/';
+        return getInstance().rootPath_.BF_GENERIC_STRING() + '/';
     }
 
     /*static*/ std::string PathConfig::getExecutablePathString()
     {
-        return getInstance().executablePath_.string() + '/';
+        return getInstance().executablePath_.BF_GENERIC_STRING() + '/';
     }
 
     /*static*/ std::string PathConfig::getDataPathString()
     {
-        return getInstance().dataPath_.string() + '/';
+        return getInstance().dataPath_.BF_GENERIC_STRING() + '/';
     }
 
     /*static*/ std::string PathConfig::getExternalDataPathString()
     {
-        return getInstance().externalDataPath_.string() + '/';
+        return getInstance().externalDataPath_.BF_GENERIC_STRING() + '/';
     }
 
     /*static*/ std::string PathConfig::getConfigPathString()
     {
-        return getInstance().configPath_.string() + '/';
+        return getInstance().configPath_.BF_GENERIC_STRING() + '/';
     }
 
     /*static*/ std::string PathConfig::getLogPathString()
     {
-        return getInstance().logPath_.string() + '/';
+        return getInstance().logPath_.BF_GENERIC_STRING() + '/';
     }
 
     /*static*/ std::string PathConfig::getModulePathString()
     {
-        return getInstance().modulePath_.string() + '/';
+        return getInstance().modulePath_.BF_GENERIC_STRING() + '/';
     }
 }
Index: code/branches/kicklib2/src/libraries/core/PathConfig.h
===================================================================
--- code/branches/kicklib2/src/libraries/core/PathConfig.h	(revision 8284)
+++ code/branches/kicklib2/src/libraries/core/PathConfig.h	(revision 8285)
@@ -113,5 +113,5 @@
             static std::string getModulePathString();
 
-            //! Return trrue for runs in the build directory (not installed)
+            //! Return true for runs in the build directory (not installed)
             static bool isDevelopmentRun() { return getInstance().bDevRun_; }
 
Index: code/branches/kicklib2/src/libraries/core/Resource.cc
===================================================================
--- code/branches/kicklib2/src/libraries/core/Resource.cc	(revision 8284)
+++ code/branches/kicklib2/src/libraries/core/Resource.cc	(revision 8285)
@@ -33,4 +33,11 @@
 #include <OgreFileSystem.h>
 #include <OgreResourceGroupManager.h>
+
+// Differentiate Boost Filesystem v2 and v3
+#if (BOOST_FILESYSTEM_VERSION < 3)
+#  define BF_GENERIC_STRING string
+#else
+#  define BF_GENERIC_STRING generic_string
+#endif
 
 namespace orxonox
@@ -98,5 +105,5 @@
                     boost::filesystem::path base(it->archive->getName());
                     base /= it->filename;
-                    ptr->fileSystemPath = base.string();
+                    ptr->fileSystemPath = base.BF_GENERIC_STRING();
                 }
                 return ptr;
Index: code/branches/kicklib2/src/libraries/core/command/ArgumentCompletionFunctions.cc
===================================================================
--- code/branches/kicklib2/src/libraries/core/command/ArgumentCompletionFunctions.cc	(revision 8284)
+++ code/branches/kicklib2/src/libraries/core/command/ArgumentCompletionFunctions.cc	(revision 8285)
@@ -35,5 +35,4 @@
 
 #include <map>
-#include <boost/version.hpp>
 #include <boost/filesystem.hpp>
 
@@ -47,14 +46,13 @@
 #include "TclThreadManager.h"
 
-// Boost 1.36 has some issues with deprecated functions that have been omitted
-#if (BOOST_VERSION == 103600)
-#  define BOOST_LEAF_FUNCTION filename
-#  define BOOST_DICTIONARY_ENTRY_NAME string
-#elif (BOOST_FILESYSTEM_VERSION < 3)
-#  define BOOST_LEAF_FUNCTION leaf
-#  define BOOST_DICTIONARY_ENTRY_NAME string
+// Differentiate Boost Filesystem v2 and v3
+#if (BOOST_FILESYSTEM_VERSION < 3)
+#  define BF_LEAF leaf
+#  define BF_GENERIC_STRING string
+#  define BF_DICTIONARY_ENTRY_NAME string
 #else
-#  define BOOST_LEAF_FUNCTION path().filename().string
-#  define BOOST_DICTIONARY_ENTRY_NAME path().string
+#  define BF_LEAF path().filename().string
+#  define BF_GENERIC_STRING generic_string
+#  define BF_DICTIONARY_ENTRY_NAME path().string
 #endif
 
@@ -250,5 +248,5 @@
                 else
                 {
-                    const std::string& dir = startdirectory.string();
+                    const std::string& dir = startdirectory.BF_GENERIC_STRING();
                     if (dir.size() > 0 && dir[dir.size() - 1] == ':')
                         startdirectory = dir + '/';
@@ -262,7 +260,7 @@
                 {
                     if (boost::filesystem::is_directory(*file))
-                        dirlist.push_back(ArgumentCompletionListElement(file->BOOST_DICTIONARY_ENTRY_NAME() + '/', getLowercase(file->BOOST_DICTIONARY_ENTRY_NAME()) + '/', file->BOOST_LEAF_FUNCTION() + '/'));
+                        dirlist.push_back(ArgumentCompletionListElement(file->BF_DICTIONARY_ENTRY_NAME() + '/', getLowercase(file->BF_DICTIONARY_ENTRY_NAME()) + '/', file->BF_LEAF() + '/'));
                     else
-                        filelist.push_back(ArgumentCompletionListElement(file->BOOST_DICTIONARY_ENTRY_NAME(), getLowercase(file->BOOST_DICTIONARY_ENTRY_NAME()), file->BOOST_LEAF_FUNCTION()));
+                        filelist.push_back(ArgumentCompletionListElement(file->BF_DICTIONARY_ENTRY_NAME(), getLowercase(file->BF_DICTIONARY_ENTRY_NAME()), file->BF_LEAF()));
                     ++file;
                 }
