> hello, I created an executable using py2exe and innosetup for 
> windows.
> I need to figure out where the user has installed my program
> so that I can direct the program to the installation files that it 
> needs to run.

The location of the installation files - I assume you mean some
kind of config file? - should not be hard coded in that way, much
better to store the files in a flexible location and use an
environment variable or registry setting to point to it.

> when this file type is double clicked my application is launched.
> when this happens my program thinks the working directory
> is the directory where that registered file was located...

Interesting, I didn't know Windows would do that.

> the working directory back to the installation directory...
> but where is this?

If the current working directory is not set to the home location
of your program but rather to the target file then I don't know!
Another good reason for setting an environment variable or
registry entry.

However the sys module contains two functions that might help:
exec_prefix()
and
executable()

Not sure how they play with py2exe however.

HTH,

Alan Gauld
Author of the Learn to Program web site
http://www.freenetpages.co.uk/hp/alan.gauld


_______________________________________________
Tutor maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/tutor

Reply via email to