I would go one of three ways... First you could modify the installer to write the absolute path of the base directory where it's installed to, to a constant location. I mean it's a drawback because then it is almost like you have two locations for one file, but it's a possibility I just figured I'd throw it out there.
The second way I would consider is almost the same, but instead of writting the absolute base directory to a file, you could put it in an environmental variable (like what DaWei [I think] was saying).
The third way is the other way you mentioned in you're orginal post. The last version of DigitalMarsCompiler that I downloaded would automatically include the whole absolute path of the current file in argv[], then you could just parse that with whatever other directory. I'm sure you can do this with whatever compiler you're using too.
//Edit
Also a fourth, somewhat ugly solution, would be to use something like...
http://www.germane-software.com/soft...ries/registry/
__________________
#if 0 /* in case someone actually tries to compile this */
- libpng version 1.2.8 (example.c)
<Jim_McNeat> Is there like a way to put a compiler in "Just trust me on that one" mode?