Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

stein

current directory

This topic is 5673 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have my application that loads different files. So, when I fopen("myfile.txt", "r") I''ll get myfile.txt from the same directory from where the executable is run. The problem is, that if I place a shortcut to my exe in the startmenu - for example - then the current directory is ''.../start menu/'', and that kinda messes the whole thing up. How do you guys get around this problem? thanks in advance!

Share this post


Link to post
Share on other sites
Advertisement
Yes... in the ''Start in:''-field I can write the correct directory, but here''s the thing: I''m making an installer for my game, using Inno Setup 3... and, I can tell it to place shortcuts in the startmenu and on the desktop, but I can''t make them with anything prewritten in the ''Start in:''-field. So how do I go about that?
thanks

Share this post


Link to post
Share on other sites
In your program, create the full directory each time you load something, with [path to the exe, stored in registry]\[path to resource]

EDIT: I can't help on THIS idea, but it might be worth digging : create a game "launcher" that is targeted by the shortcut, and that launches the game itself in the correct directory.

ToohrVyk
-------------
Extatica - a free 3d game engine
Available soon!
Click here to learn more

[edited by - ToohrVyk on February 8, 2003 4:18:01 PM]

Share this post


Link to post
Share on other sites
Yea, I''ve been thinking about the same thing with the registry. I just thought it was sorta overkill using the registry just for that... The launcher-thing, sounds like a good idea. I''ll look into that
thanks

Share this post


Link to post
Share on other sites
The launcher-thing will also need this (it needs to find in which path the game lies). I, personnally, would''ve used my own installer (even if it was DOS-based).

Also, if registry is too much for you, look into ini files.

ToohrVyk
-------------
Extatica - a free 3d game engine
Available soon!
Click here to learn more

Share this post


Link to post
Share on other sites
Hmm... just wrote a couple of functions for my game [using the GetModuleFileName()], and everything is working great now. Thanks!

[edited by - stein on February 8, 2003 5:38:59 PM]

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!