Feature #1023

Use a standard application path for writing files

Added by kervala almost 5 years ago. Updated over 4 years ago.

Status:Closed Start date:07/16/2010
Priority:High Due date:
Assignee:kervala % Done:

100%

Category:Client: General
Target version:Version 0.8.0

Description

When Ryzom Core client is installed in a path where current user can't write files, we should change current path so files are written in the right location.

History

#1 Updated by kervala almost 5 years ago

  • % Done changed from 0 to 80

#2 Updated by kervala almost 5 years ago

Define CHANGE_CURRENT_PATH if you want to use system default application path, define NL_ETC_PREFIX to directory where all _default.cfg files are installed and NL_SHARE_PREFIX where data are installed.

For Ryzom client, servers and tools :

  • NL_ETC_PREFIX should be /etc/ryzom
  • NL_SHARE_PREFIX should be /usr/share/games/ryzom

If CHANGE_CURRENT_PATH is defined, logs and other users data will be written in ~/.ryzom else it will use current directory from where you launched executable.

#3 Updated by jayme almost 5 years ago

There is a bracket missing in code/nel/src/misc/path.cpp introduced with Revision r489

diff -r 437aa3643277 code/nel/src/misc/path.cpp
--- a/code/nel/src/misc/path.cpp        Fri Jul 16 23:12:25 2010 +0200
+++ b/code/nel/src/misc/path.cpp        Sat Jul 17 15:48:14 2010 +0200
@@ -2454,7 +2454,7 @@
        if (!appName.empty())
                path = CPath::standardizePath(path + appName);
 #else
-       if (!appName.empty))
+       if (!appName.empty())
                path = CPath::standardizePath(path + "." + toLower(appName));
 #endif

#4 Updated by kervala almost 5 years ago

Thanks jayme, I noticed that this morning when I was compiling under Linux :)

I changed CMake variables names (specified values are those used on Debian based systems) :

  • RYZOM_PREFIX should be /usr
  • RYZOM_BIN_PREFIX should be /usr/games
  • RYZOM_ETC_PREFIX should be /etc/ryzom
  • RYZOM_SHARE_PREFIX should be /usr/share/games/ryzom

All these variables are now defined in config.h and a HAVE_CONFIG_H is defined if config.h is created by CMake.

  • CHANGE_CURRENT_PATH is not used anymore, it automatically detects if you run client from Ryzom directory or not.

#5 Updated by kervala almost 5 years ago

  • % Done changed from 80 to 90

#6 Updated by kervala almost 5 years ago

  • Status changed from Assigned to Resolved
  • Target version set to Version 0.8.0
  • % Done changed from 90 to 100

#7 Updated by Minthos almost 5 years ago

The same would be useful for the server too..

#8 Updated by ThibG almost 5 years ago

Great! But avoiding using ~/.ryzom and use the XDG Basedir spec (http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html) instead would be even better!

#9 Updated by kervala over 4 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF