[lokisetup] Setting the Current Path

Timothee Besset ttimo at idsoftware.com
Fri Jul 5 02:55:12 EDT 2002


There is no reliable / works in all cases way of retrieving the path of
the binary in Linux. What we do for Q3 / RTCW is install a wrapper script
in /usr/local/bin, which cd to /usr/local/games/<game> and executes the
game from it's current directory.

TTimo

On 04 Jul 2002 23:27:32 -0700
Chris Thielen <chris at luethy.net> wrote:

> I'm using Loki Setup as the installation program for one of my games,
> and I was wondering what the common way was to get the path the game's
> installed in. My game is installed in, say, /usr/local/games/my_game,
> and I need to get data out of files in /usr/local/games/my_game/data,
> but internally, my game only has the path as "data/whatever.dat". Is
> there a function for Linux/Win32/MacOS to get the directory the binary
> is being run from, so I could set the current directory to that, or is
> there a better way to do this? Should I have Loki Setup write some sort
> of ~/.my_game/path file and grab that everytime the game starts? What is
> normally done for this?
> 
> -- chris (chris at luethy.net)
> 
> 
> 



More information about the Lokisetup mailing list