Revision: 2793
          http://rigsofrods.svn.sourceforge.net/rigsofrods/?rev=2793&view=rev
Author:   rorthomas
Date:     2012-06-07 14:01:22 +0000 (Thu, 07 Jun 2012)
Log Message:
-----------
fixes #952

Modified Paths:
--------------
    trunk/source/main/utils/Settings.cpp

Modified: trunk/source/main/utils/Settings.cpp
===================================================================
--- trunk/source/main/utils/Settings.cpp        2012-06-07 11:59:10 UTC (rev 
2792)
+++ trunk/source/main/utils/Settings.cpp        2012-06-07 14:01:22 UTC (rev 
2793)
@@ -376,8 +376,18 @@
                path_add(resources_path, "resources");
                if (!folderExists(resources_path))
                {
-                       showError(_L("Startup error"), _L("Resources folder not 
found. Check if correctly installed."));
-                       exit(1);
+                       // 3rd fallback: check the installation path
+#ifndef WIN32
+                       // linux fallback
+                       // TODO: use installation patch values from CMake
+                       strcpy(resources_path, 
"/usr/share/rigsofrods/resources/");
+#endif // WIN32
+
+                       if (!folderExists(resources_path))
+                       {
+                               showError(_L("Startup error"), _L("Resources 
folder not found. Check if correctly installed."));
+                               exit(1);
+                       }
                }
        }
 
@@ -388,7 +398,16 @@
 
        //setup config files names
        char plugins_fname[1024] = {};
+
+#ifdef WIN32
+       // under windows, the plugins.cfg is in the installation directory
        strcpy(plugins_fname, program_path);
+#else
+       // under linux, the plugins.cfg is somewhere in 
/usr/share/rigsofrods/resources
+       strcpy(plugins_fname, resources_path);
+#endif // WIN32
+
+
 #ifdef _DEBUG
        strcat(plugins_fname, "plugins_d.cfg");
 #else

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Rigsofrods-devel mailing list
Rigsofrods-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rigsofrods-devel

Reply via email to